Upsert booking

This api can be used to create a booking using external_id as main primary key.



⚠️ ATTENTION: this api will handle multiple requests using the same external_id. If you send at the same time 2 requests with the same external_id, 2 different bookings will be created. You must handle the true unique constraint of the value.



Upsert logic:

  • This api will use external_id as primary key and will ignore the id of the booking.
  • If a booking with the given external_id is found, it will be updated; otherwise it will be created.

Customer handling:

  • In bookings you need to set a customer_id. In this api, setting the booking_customer with the unique uuid will use the reference of the original customer already present.
  • If the customer is not found, a new one will be created.
  • Customer constraints must be followed in any case: uuid is always required, as well as either company_name or first_name + last_name.
  • If the uuid already exists, data of the customer will NOT be overwritten.

Sale generation:

If the body sets status="arrived" while the previous status was different or not existing at all, a sale with the booking reference will be generated. The sale_id generated will be placed in the response as sale_id. This sale_id is unique for the POST with status arrived.
You can search for the generated sale looking for GET /v2/sales?booking_id={booking_id}&pagination=false or by sale_id GET /v2/sales/:sale_id

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

must have customer uuid and external_id

string
required

must use the ISO 8601 standard. In the body of the request it is recommended to use the UTC format. The api response will always use the ISO 8601 standard with the UTC format

booking_customer
object
required
string

this will be the channel used for sale when booking is set as arrived

integer
required
string
required

must be unique. Tilby do not check unique contraint on db. First element found will be used.

string
integer
string

must have customer id or pms_reservation_id

string
integer
string
string
enum
required
Allowed:
tables
array of objects
tables
tags
array of objects
tags
Responses

422

Error: Unprocessable Entity

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json