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_idas primary key and will ignore theidof the booking. - If a booking with the given
external_idis 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 thebooking_customerwith the uniqueuuidwill 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:
uuidis always required, as well as eithercompany_nameorfirst_name+last_name. - If the
uuidalready 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
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
422Error: Unprocessable Entity

