4. Booking Creation#
During this step, the availability item that has been created in the options step and edited up until now is used to create a booking on the supplier’s system. This is done through the following endpoint.
createBooking#
Given an availability ID, the endpoint returns a booking ID and a list of the chosen options and tickets.
Path
POST /booking-flow/v1/bookings
Input example
Request Header |
Mandatory |
Example |
Format |
Usage |
|---|---|---|---|---|
externalClientId |
No |
ABCDEF |
Alphanumeric, 255 maximum length |
A string that the CustomerSystem can use to associate a booking to a specific traveler |
Request Param |
Mandatory |
Example |
Format |
Usage |
|---|---|---|---|---|
resellerRef |
yes |
bookingIdentifer |
Alphanumeric, 255 maximum length |
It represents the booking identifer from client side |
Body:
{
"availabilityId" : "01d0597b-a819-478b-b32d-f99290b70e88",
"resellerRef": "bookingIdentifer"
}
Output body example
{
"id": "60cdd167-e2ff-4746-b609-c2bee07d9985",
"availabilityDateTime": "2023-12-19T12:00+01:00[Europe/Paris]",
"resellerRef": "MY_COMPANY",
"status": "ON_HOLD",
"paymentStatus": "ON_HOLD",
"creationDate": "2023-12-14T08:53:05.349042915Z",
"availability": {
"id": "01d0597b-a819-478b-b32d-f99290b70e88",
"availabilityDate": "2023-12-19",
"availabilityOptions": [
{
"label": "Ticket Type",
"level": "0",
"id": "24deeda6-bcda-4c04-9659-e2ca2b2beedc",
"selectedOptionId": "528446",
"optionChoices": {
"528446": "Eiffel ,2 Day Bus Pass &Cruise"
}
},
{
"label": "Start Time",
"level": "1",
"id": "01d28c41-0b26-4d3a-a0ec-229125e07c63",
"selectedOptionId": "420013_20231219",
"optionChoices": {
"420013_20231219": "12:00"
}
}
],
"unitOptions": [
{
"label": "Adult",
"id": "143731",
"restrictions": {
"minQuantity": 1,
"maxQuantity": 10,
"accompagniedBy": []
},
"price": {
"retail": 114.9,
"currency": "EUR"
},
"unitQuantity": 2,
"minAge": 13,
"maxAge": 99
},
{
"label": "Child",
"id": "112820",
"restrictions": {
"minQuantity": 1,
"maxQuantity": 10,
"accompagniedBy": []
},
"price": {
"retail": 99.9,
"currency": "EUR"
},
"unitQuantity": 1,
"minAge": 4,
"maxAge": 12
},
{
"label": "Infant",
"id": "112821",
"restrictions": {
"minQuantity": 1,
"maxQuantity": 10,
"accompagniedBy": []
},
"price": {
"retail": 0.0,
"currency": "EUR"
},
"unitQuantity": 0,
"minAge": 0,
"maxAge": 3
}
],
"maxParticipants": 10,
"minParticipants": 1,
"isOptionStepCompleted": true,
"isPricingStepCompleted": true
},
"cancellation": {
"isCancellable": false,
"cancellationPolicy": []
},
"isQuestionStepComplete": false,
"travelerDetails": {
"externalClientId": "ABCDEF"
}
}
Note
The booking status will be ON_HOLD until confirmation.
Booking creation does not imply any “Hold” process on supplier side, and no ticket is reserved until the booking is successfully confirmed
Warning
At booking creation time, the API may validate that the selected product, date, and options are still available.
The following outcomes are possible:
Product unavailable
If the selected product is no longer available for the requested date and options, the booking request fails with error
9563("The product is no longer available for the selected date and options") and HTTP status500.Price change detected
If the selected options are still available but their prices have changed since the availability check, the booking request fails with error
9573("Prices have changed since your selection. Please review the updated prices and confirm again.") and HTTP status400. Prices are updated in the availability object. Once the updated prices have been accepted by the end-user, the booking confirmation request can be submitted again to proceed with the booking process.
Status Codes
HTTP Code |
Error Code |
Description |
|---|---|---|
201 |
- |
Successful creation of the booking |
400 |
6606 |
Booking already cancelled |
400 |
9510 |
Invalid availability ID |
400 |
9520 |
Language change error |
400 |
9531 |
Booking already confirmed |
400 |
9548 |
Currency change error |
400 |
9573 |
Prices have changed. Check and confirm the booking again |
403 |
6501 |
Forbidden |
500 |
9563 |
Selected availability is no longer available |
500 |
… |
Internal server error |