{"openapi":"3.1.0","info":{"title":"AYAFLY Partner API","version":"1.0.0","description":"Search, price and book MSC Cruises, AROYA Cruises, Celebrity Cruises and Royal Caribbean on your own website. Sandbox keys (ayk_test_…) reach a test catalogue and never book for real; live keys (ayk_live_…) work once we activate your account."},"servers":[{"url":"https://ayafly.com/api/partner/v1","description":"Sandbox and live (the key decides)"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Authorization: Bearer ayk_test_… or ayk_live_…"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{}}}}},"Money":{"type":"object","required":["amount","currency"],"properties":{"amount":{"type":"number"},"currency":{"type":"string","example":"EUR"}}},"Sailing":{"type":"object","properties":{"id":{"type":"string","example":"MSC_WE20270103BCNBCN"},"line":{"type":"string","enum":["MSC","AROYA","CELEBRITY","ROYAL"]},"lineName":{"type":"string"},"product":{"type":"string","enum":["CRUISE","PACKAGE"]},"title":{"type":["string","null"]},"ship":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}}},"departureDate":{"type":"string","format":"date"},"returnDate":{"type":["string","null"],"format":"date"},"nights":{"type":"integer"},"embarkPort":{"type":"string"},"disembarkPort":{"type":["string","null"]},"ports":{"type":"array","items":{"type":"string"}},"region":{"type":["string","null"]},"fromPrice":{"oneOf":[{"type":"object","required":["amount","currency"],"properties":{"amount":{"type":"number"},"currency":{"type":"string","example":"EUR"}}},{"type":"null"}],"description":"Per guest, double cabin, before commission"},"imageUrl":{"type":["string","null"]}}},"Quote":{"type":"object","properties":{"quoteId":{"type":"string"},"sailingId":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"guests":{"type":"array","items":{"type":"object","properties":{"age":{"type":"integer"}}}},"currency":{"type":"string"},"options":{"type":"array","items":{"type":"object","properties":{"optionId":{"type":"string"},"category":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["INTERIOR","OCEANVIEW","BALCONY","SUITE","OTHER"]}}},"fare":{"type":"object","properties":{"code":{"type":["string","null"]},"name":{"type":["string","null"]}}},"price":{"type":"object","required":["gross","taxes","commission","net","currency"],"properties":{"gross":{"type":"number","description":"Price of the cabin for all guests (your selling reference)"},"taxes":{"type":"number","description":"Port taxes & fees included in gross (no commission on them)"},"commission":{"type":"number","description":"Your commission under your contract"},"net":{"type":"number","description":"What you pay: gross − commission"},"currency":{"type":"string"}}},"perGuest":{"type":"array","items":{"type":"object","properties":{"age":{"type":"integer"},"gross":{"type":"number"},"taxes":{"type":"number"}}}},"exact":{"type":"boolean","description":"false = indicative, confirmed at booking (409 price_changed if it moved)"},"availability":{"type":"string","enum":["AVAILABLE","LIMITED"]}}}}}},"Guest":{"type":"object","required":["firstName","lastName","gender","dateOfBirth","nationality"],"properties":{"title":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"gender":{"type":"string","enum":["M","F"]},"dateOfBirth":{"type":"string","format":"date"},"nationality":{"type":"string","example":"IR","description":"ISO 3166-1 alpha-2"},"passportNumber":{"type":"string","description":"Required for MSC and AROYA"},"passportExpiry":{"type":"string","format":"date"}}},"BookingRequest":{"type":"object","required":["quoteId","optionId","guests"],"properties":{"quoteId":{"type":"string"},"optionId":{"type":"string"},"guests":{"type":"array","items":{"$ref":"#/components/schemas/Guest"}},"customer":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}},"description":"Kept for our operations team; we never contact your customer"},"emergencyContact":{"type":"object","properties":{"name":{"type":"string"},"phone":{"type":"string"}}},"partnerReference":{"type":"string","maxLength":64},"acceptPriceChange":{"type":"boolean","default":false}}},"Booking":{"type":"object","properties":{"reference":{"type":"string"},"partnerReference":{"type":["string","null"]},"lineReference":{"type":["string","null"]},"status":{"type":"string","enum":["PENDING","HELD","CONFIRMED","CANCELLATION_REQUESTED","CANCELLED","FAILED"]},"paymentStatus":{"type":"string","enum":["UNPAID","PAID","PARTIAL","REFUNDED"]},"environment":{"type":"string","enum":["sandbox","live"]},"sailing":{"type":"object","properties":{"id":{"type":["string","null"]},"line":{"type":["string","null"]},"ship":{"type":["string","null"]},"departureDate":{"type":["string","null"]},"nights":{"type":["integer","null"]}}},"cabin":{"type":"object","properties":{"category":{"type":["string","null"]},"name":{"type":["string","null"]}}},"guests":{"type":"array","items":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"dateOfBirth":{"type":["string","null"]}}}},"price":{"type":"object","required":["gross","taxes","commission","net","currency"],"properties":{"gross":{"type":"number","description":"Price of the cabin for all guests (your selling reference)"},"taxes":{"type":"number","description":"Port taxes & fees included in gross (no commission on them)"},"commission":{"type":"number","description":"Your commission under your contract"},"net":{"type":"number","description":"What you pay: gross − commission"},"currency":{"type":"string"}}},"holdUntil":{"type":["string","null"],"format":"date-time"},"cancellation":{"type":["object","null"],"properties":{"status":{"type":"string"},"reason":{"type":"string"},"requestedAt":{"type":"string"},"refundAmount":{"type":["number","null"]}}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}},"paths":{"/ping":{"get":{"summary":"Check your key","responses":{"200":{"description":"Partner, environment, scopes, lines"},"401":{"description":"Missing / invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed (scope, line, status, IP)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or daily allowance reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/lines":{"get":{"summary":"Cruise lines and whether your contract includes them","responses":{"200":{"description":"Lines"},"401":{"description":"Missing / invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed (scope, line, status, IP)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or daily allowance reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sailings":{"get":{"summary":"Search sailings","parameters":[{"name":"dateFrom","in":"query","schema":{"type":"string","format":"date"},"description":"Default today"},{"name":"dateTo","in":"query","schema":{"type":"string","format":"date"},"description":"Default dateFrom + 60 days; at most 120 days after dateFrom"},{"name":"lines","in":"query","schema":{"type":"string"},"description":"Comma list: MSC,AROYA,CELEBRITY,ROYAL (default: all your lines)"},{"name":"nightsMin","in":"query","schema":{"type":"integer"}},{"name":"nightsMax","in":"query","schema":{"type":"integer"}},{"name":"region","in":"query","schema":{"type":"string"},"description":"Text match, e.g. Mediterranean"},{"name":"port","in":"query","schema":{"type":"string"},"description":"Embarkation port, text match"},{"name":"ship","in":"query","schema":{"type":"string"}},{"name":"product","in":"query","schema":{"type":"string","enum":["CRUISE","PACKAGE"]}},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":100}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"Sailings","content":{"application/json":{"schema":{"type":"object","properties":{"sailings":{"type":"array","items":{"$ref":"#/components/schemas/Sailing"}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}}}}}},"401":{"description":"Missing / invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed (scope, line, status, IP)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or daily allowance reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sailings/{id}":{"get":{"summary":"One sailing with its itinerary","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Sailing"},"401":{"description":"Missing / invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed (scope, line, status, IP)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown or past sailing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or daily allowance reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/quotes":{"post":{"summary":"Price every cabin type for a party (live availability; valid 30 minutes)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sailingId","guests"],"properties":{"sailingId":{"type":"string"},"guests":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"object","properties":{"age":{"type":"integer","description":"Age on the sailing date"}}}}}}}}},"responses":{"201":{"description":"Quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"401":{"description":"Missing / invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed (scope, line, status, IP)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"sold_out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid party","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or daily allowance reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bookings":{"get":{"summary":"Your bookings, newest first","parameters":[{"name":"status","in":"query","schema":{"type":"string"}},{"name":"createdFrom","in":"query","schema":{"type":"string","format":"date"}},{"name":"createdTo","in":"query","schema":{"type":"string","format":"date"}},{"name":"limit","in":"query","schema":{"type":"integer","default":50}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"Bookings"},"401":{"description":"Missing / invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed (scope, line, status, IP)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or daily allowance reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Book a quoted cabin (paid from your wallet)","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":80},"description":"Required live; the same key returns the first answer and never books twice"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingRequest"}}}},"responses":{"201":{"description":"Booked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Booking"}}}},"401":{"description":"Missing / invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"insufficient_credit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed (scope, line, status, IP)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"price_changed / sold_out / request_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"quote_expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid guests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or daily allowance reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"booking_failed (nothing charged)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bookings/{reference}":{"get":{"summary":"One booking (our reference or your partnerReference)","parameters":[{"name":"reference","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Booking"},"401":{"description":"Missing / invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed (scope, line, status, IP)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or daily allowance reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bookings/{reference}/cancel":{"post":{"summary":"Request cancellation (the outcome arrives as booking.updated)","parameters":[{"name":"reference","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["reason"],"properties":{"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"Booking with status CANCELLATION_REQUESTED"},"401":{"description":"Missing / invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed (scope, line, status, IP)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Already cancelled / pending","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or daily allowance reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/account":{"get":{"summary":"Wallet, commission, contract and limits","responses":{"200":{"description":"Account"},"401":{"description":"Missing / invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed (scope, line, status, IP)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or daily allowance reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{"booking":{"post":{"summary":"booking.created, booking.updated, booking.cancellation_requested","description":"Signed: X-AYA-Signature: t=<unix>,v1=<hex HMAC-SHA256(secret, \"<t>.<raw body>\")>. Answer 2xx within 10 s; we retry for 24 h.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"environment":{"type":"string"},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"booking":{"$ref":"#/components/schemas/Booking"}}}}}}}},"responses":{"200":{"description":"Received"}}}}}}