{"openapi":"3.1.0","info":{"title":"Coastly Partner API","version":"v1","summary":"Server-to-server API for property managers, channel managers and POS systems working with Coastly businesses.","description":"Read and write properties, room types, availability, rates, reservations and orders for a Coastly business, and read its invoices and commission. Authenticate with a secret API key (ck_test_ or ck_live_) as a bearer token; keys are created by the business in the Coastly vendor dashboard under Developers and are scoped per resource. Guides: https://coastly.surf/developers. Field-level reference: https://coastly.surf/developers/reference.","contact":{"name":"Coastly support","email":"support@coastly.surf","url":"https://coastly.surf/support"},"termsOfService":"https://coastly.surf/terms"},"externalDocs":{"description":"Coastly Partner API docs","url":"https://coastly.surf/developers"},"servers":[{"url":"https://coastly.surf/api/v1","description":"Production (test and live mode are chosen by the key)"}],"tags":[{"name":"Meta"},{"name":"Catalog"},{"name":"Properties"},{"name":"Room types"},{"name":"Availability"},{"name":"Rates"},{"name":"Reservations"},{"name":"Orders"},{"name":"Invoices"},{"name":"Commission"}],"paths":{"/":{"get":{"operationId":"get","summary":"API discovery root (no auth)","tags":["Meta"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"security":[]}},"/towns":{"get":{"operationId":"getTowns","summary":"List Coastly towns (live and onboarding)","tags":["Catalog"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"security":[{"bearerAuth":[]}],"x-required-scope":"listings:read","description":"Requires an API key with the `listings:read` scope."}},"/listings":{"get":{"operationId":"getListings","summary":"Search public marketplace listings in a town","tags":["Catalog"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"town","in":"query","required":false,"description":"Town slug (required), e.g. cabarete","schema":{"type":"string"}},{"name":"type","in":"query","required":false,"description":"restaurants | stays | tours | events","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"Case-insensitive title search","schema":{"type":"string"}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"security":[{"bearerAuth":[]}],"x-required-scope":"listings:read","description":"Requires an API key with the `listings:read` scope."}},"/listings/{id}":{"get":{"operationId":"getListingsById","summary":"Retrieve a public listing or event","tags":["Catalog"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"bearerAuth":[]}],"x-required-scope":"listings:read","description":"Requires an API key with the `listings:read` scope."}},"/properties":{"get":{"operationId":"getProperties","summary":"List properties","tags":["Properties"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"security":[{"bearerAuth":[]}],"x-required-scope":"properties:read","description":"Requires an API key with the `properties:read` scope."},"post":{"operationId":"postProperties","summary":"Create a property","tags":["Properties"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"security":[{"bearerAuth":[]}],"x-required-scope":"properties:write","description":"Requires an API key with the `properties:write` scope."}},"/properties/{id}":{"get":{"operationId":"getPropertiesById","summary":"Retrieve a property","tags":["Properties"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"bearerAuth":[]}],"x-required-scope":"properties:read","description":"Requires an API key with the `properties:read` scope."},"patch":{"operationId":"patchPropertiesById","summary":"Update a property","tags":["Properties"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"security":[{"bearerAuth":[]}],"x-required-scope":"properties:write","description":"Requires an API key with the `properties:write` scope."}},"/room-types":{"get":{"operationId":"getRoomTypes","summary":"List room types","tags":["Room types"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"property_id","in":"query","required":false,"description":"Only room types of this property","schema":{"type":"string"}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"security":[{"bearerAuth":[]}],"x-required-scope":"room_types:read","description":"Requires an API key with the `room_types:read` scope."},"post":{"operationId":"postRoomTypes","summary":"Create a room type","tags":["Room types"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"security":[{"bearerAuth":[]}],"x-required-scope":"room_types:write","description":"Requires an API key with the `room_types:write` scope."}},"/room-types/{id}":{"get":{"operationId":"getRoomTypesById","summary":"Retrieve a room type","tags":["Room types"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"bearerAuth":[]}],"x-required-scope":"room_types:read","description":"Requires an API key with the `room_types:read` scope."},"patch":{"operationId":"patchRoomTypesById","summary":"Update a room type","tags":["Room types"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"security":[{"bearerAuth":[]}],"x-required-scope":"room_types:write","description":"Requires an API key with the `room_types:write` scope."}},"/room-types/{id}/calendar.ics":{"get":{"operationId":"getRoomTypesByIdCalendarIcs","summary":"Busy calendar of a room type as an iCalendar feed","tags":["Room types"],"responses":{"200":{"description":"iCalendar feed","content":{"text/calendar":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"bearerAuth":[]}],"x-required-scope":"availability:read","description":"Requires an API key with the `availability:read` scope."}},"/availability":{"get":{"operationId":"getAvailability","summary":"Read availability for a room type over a date range","tags":["Availability"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"room_type_id","in":"query","required":false,"description":"Room type id","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"First night (YYYY-MM-DD)","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"description":"Last night (YYYY-MM-DD)","schema":{"type":"string","format":"date"}}],"security":[{"bearerAuth":[]}],"x-required-scope":"availability:read","description":"Requires an API key with the `availability:read` scope."},"put":{"operationId":"putAvailability","summary":"Push availability","tags":["Availability"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"security":[{"bearerAuth":[]}],"x-required-scope":"availability:write","description":"Requires an API key with the `availability:write` scope."}},"/rates":{"get":{"operationId":"getRates","summary":"Read rates for a room type","tags":["Rates"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"room_type_id","in":"query","required":false,"description":"Room type id","schema":{"type":"string"}}],"security":[{"bearerAuth":[]}],"x-required-scope":"rates:read","description":"Requires an API key with the `rates:read` scope."},"put":{"operationId":"putRates","summary":"Push rates","tags":["Rates"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"security":[{"bearerAuth":[]}],"x-required-scope":"rates:write","description":"Requires an API key with the `rates:write` scope."}},"/reservations":{"get":{"operationId":"getReservations","summary":"List reservations","tags":["Reservations"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"status","in":"query","required":false,"description":"Only reservations in this status","schema":{"type":"string"}},{"name":"check_in_from","in":"query","required":false,"description":"Only check-ins on or after this date","schema":{"type":"string","format":"date"}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"security":[{"bearerAuth":[]}],"x-required-scope":"reservations:read","description":"Requires an API key with the `reservations:read` scope."},"post":{"operationId":"postReservations","summary":"Create a reservation","tags":["Reservations"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"security":[{"bearerAuth":[]}],"x-required-scope":"reservations:write","description":"Requires an API key with the `reservations:write` scope."}},"/reservations/{id}":{"get":{"operationId":"getReservationsById","summary":"Retrieve a reservation","tags":["Reservations"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"bearerAuth":[]}],"x-required-scope":"reservations:read","description":"Requires an API key with the `reservations:read` scope."},"patch":{"operationId":"patchReservationsById","summary":"Modify a reservation","tags":["Reservations"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"security":[{"bearerAuth":[]}],"x-required-scope":"reservations:write","description":"Requires an API key with the `reservations:write` scope."}},"/reservations/{id}/cancel":{"post":{"operationId":"postReservationsByIdCancel","summary":"Cancel a reservation","tags":["Reservations"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"security":[{"bearerAuth":[]}],"x-required-scope":"reservations:write","description":"Requires an API key with the `reservations:write` scope."}},"/reservations/{id}/lodging-payment":{"post":{"operationId":"postReservationsByIdLodgingPayment","summary":"Report a lodging payment collected on the hotel's own processor","tags":["Reservations"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"security":[{"bearerAuth":[]}],"x-required-scope":"reservations:write","description":"Requires an API key with the `reservations:write` scope."}},"/orders":{"get":{"operationId":"getOrders","summary":"List orders","tags":["Orders"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"status","in":"query","required":false,"description":"Only orders in this status","schema":{"type":"string"}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"security":[{"bearerAuth":[]}],"x-required-scope":"orders:read","description":"Requires an API key with the `orders:read` scope."},"post":{"operationId":"postOrders","summary":"Create an order","tags":["Orders"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"security":[{"bearerAuth":[]}],"x-required-scope":"orders:write","description":"Requires an API key with the `orders:write` scope."}},"/orders/{id}":{"get":{"operationId":"getOrdersById","summary":"Retrieve an order","tags":["Orders"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"bearerAuth":[]}],"x-required-scope":"orders:read","description":"Requires an API key with the `orders:read` scope."},"patch":{"operationId":"patchOrdersById","summary":"Update an order","tags":["Orders"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"security":[{"bearerAuth":[]}],"x-required-scope":"orders:write","description":"Requires an API key with the `orders:write` scope."}},"/invoices":{"get":{"operationId":"getInvoices","summary":"List invoices","tags":["Invoices"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"status","in":"query","required":false,"description":"Only invoices in this status","schema":{"type":"string"}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"security":[{"bearerAuth":[]}],"x-required-scope":"invoices:read","description":"Requires an API key with the `invoices:read` scope."}},"/commission":{"get":{"operationId":"getCommission","summary":"Commission statement for a period","tags":["Commission"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"500":{"$ref":"#/components/responses/Problem"}},"parameters":[{"name":"from","in":"query","required":false,"description":"Period start (YYYY-MM-DD)","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"description":"Period end (YYYY-MM-DD)","schema":{"type":"string","format":"date"}}],"security":[{"bearerAuth":[]}],"x-required-scope":"commission:read","description":"Requires an API key with the `commission:read` scope."}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Secret API key, ck_test_... or ck_live_...; server-side only."}},"parameters":{"Limit":{"name":"limit","in":"query","required":false,"description":"Page size, default 50, maximum 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},"Cursor":{"name":"cursor","in":"query","required":false,"description":"Opaque next_cursor from the previous page.","schema":{"type":"string"}},"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"Makes a retried write safe; required on money writes.","schema":{"type":"string"}}},"schemas":{"List":{"type":"object","required":["data","has_more"],"properties":{"data":{"type":"array","items":{"type":"object"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{},"request_id":{"type":"string"}}}}},"Problem":{"type":"object","required":["type","title","status","detail","code","request_id"],"properties":{"type":{"type":"string","format":"uri","description":"https://coastly.surf/developers/guides/errors#{code}"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string","description":"Stable machine-readable code (same as error.code in the JSON envelope)"},"request_id":{"type":"string"},"details":{}}}},"responses":{"Problem":{"description":"Typed error. Live responses use application/json with the Error envelope; the Problem schema is the RFC 9457 mapping of the same fields. See https://coastly.surf/developers/guides/errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Same value as error.request_id / Problem.request_id"},"RateLimit":{"schema":{"type":"string"},"description":"IETF RateLimit structured field, e.g. \"partner\";r=0;t=12"},"RateLimit-Policy":{"schema":{"type":"string"},"description":"IETF RateLimit-Policy, e.g. \"partner\";q=120;w=60"},"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying (429)"},"Deprecation":{"schema":{"type":"string"},"description":"RFC 9745 Deprecation date when the operation is deprecated"},"Sunset":{"schema":{"type":"string"},"description":"RFC 8594 Sunset HTTP-date when the operation will be removed"}}}}}}