Create your orders
Learn to create an order using the /orders/preview and /orders/create endpoints
To create an order, you must use the following endpoints in sequence:
Endpoint | Use it to... |
---|---|
/orders/preview |
|
/orders/create |
|
Order creation process
Once a traveller selects their desired products, you can follow these steps to create the booking.
Step 1 - Call the /orders/preview
Use the /orders/preview endpoint to validate the order details before proceeding.
The request should be built using product and accommodation data returned in the previous step of your integration flow.
Integration type: | Use data from: |
---|---|
Search and book | /accommodations/search endpoint. |
Search, look and book | /accommodations/availability endpoint. |
Define the request
Your /orders/preview request must include:
booker
,currency
,accommodation.checkin
andaccommodation.checkout
- Use the values from the previous response.accommodation.id
andproducts
- Use the values from the preceding response for the products selected by the traveller.
Guest allocation
If the booking includes multiple rooms, specify how guests are distributed using products.allocation
.
Example: Booking two identical rooms, with one adult allocated to each:
{
"products": [
{
"id": "1050736002_377311511_0_2_0",
"number_of_adults": 1,
"room": 1050736002
},
{
"id": "1050736002_377311511_0_2_0",
"number_of_adults": 1,
"room": 1050736002
}
]
}
Allocation data depends on your integration type:
Search and book
The products
returned in the /accommodations/search endpoint response already include guest allocation.
Search, look and book flow
recommendation.products
in the /accommodations/availability response includes guest allocation.
For example:
{
"recommendation": {
"products": [
{
"id": "1050736003_377312697_1_2_0",
"number_of_adults": 1,
"room": 1050736002
},
{
"id": "1050736003_377312697_1_2_0",
"number_of_adults": 1,
"room": 1050736002
}
]
}
}
- For non-recommended products, check
products.maximum_occupancy
and assign guests manually.
For more details about occupancy and allocation, refer to the child policies guide
Orders/preview response
A successful response from the /orders/preview endpoint includes:
Accommodation-specific details:
Final
price
.Supported payment timings and methods.
Product-specific details:
Final product
price
(See Accommodation pricing guide for details and examples)policies
including cancellation fees and schedules, and meal plans.
Order token.
- Encapsulated order details needed for /orders/create request.
The order_token
expires after 15 minutes.
Note on payment object
Different products may support different payment timelines and methods.
The payment
object in the preview includes only the methods and timings supported by all selected products.
Step 2 - Display the order preview page
Display the order details in the preview page so traveller can:
Review the booking.
Choose a payment method and timing.
Provide guest and arrival information.
Example:
Step 3 - Call the /orders/create endpoint
Once the traveller confirms the booking, call /orders/create, with the order_token
from the orders/preview response, and all required inputs.
Required fields
The /orders/create request requires the following fields:
Mandatory field | Description |
---|---|
accommodation.products.id | ID for this product. Must match the product ID from /orders/preview request. |
accommodation.products[].guests[] | Name and email for each guest in the product. |
booker | Contact details of the person placing the order. |
| Copy the token from the /orders/preview response. The |
| Payment method, timing, and optionally, card details. Refer to Payments section for more details on how to set orders for different use cases and payment methods. |
Considerations about booker
Some fields under booker are conditionally required:
booker.address
- If /accommodations/details indicates
booker_address_required=true
, this field is mandatory. Otherwise, it is optional. - All address subfields (address_line, city, country, and post_code) must be provided if used.
And other optional:
booker.company
: Use for B2B or invoicing.
Optional fields
These are not required to create the order but may help with additional use cases:
Optional field | Description | Use it for... |
---|---|---|
accommodation.label | A free-text label that helps you identify this order later when retrieving its details. | To associate a reservation with a specific campaign. It helps with reporting, and attribution. |
accommodation.products[].bed_configuration | An identifier for the desired bed configuration (returned from accommodations/details response) | To indicate a prefer bed setup for guests. |
accommodation.remarks | Contains optional guest requests. | Communicate time-sensitive or special needs to the property. There are two options:
|
booker.company | Provides the booker’s company name. | Use it for B2B bookings or invoicing purposes. |
payment.include_receipt | Is set to "false" by default. Set to "true" if you wish to generate a receipt for the payment. | To generate a receipt. |
Receipt generation
Payment timing | How to generate receipt |
---|---|
pay_online_now | You can generate a receipt via orders/create endpoint only when the payment timing is pay_online_now . |
| In this timing you can retrieve a credit slip calling the orders/details/accommodations endpoint once the scheduled payment is active. Example: 3 days prior to arrival depending on the payment policy of the reservation. |
Best practices for optional fields
Only provide optional fields if:
They are relevant to your integration.
They are required by your internal business logic.
The endpoint or booking context explicitly requires them.
This helps minimise complexity and keeps your request payload lightweight and easier to manage.
Example - order/ create request
In this request, we have included the optional fields: products bed_configuration, remarks and receipt generation:
{
"accommodation": {
"products": [
{
"id": "333",
"bed_configuration": "123456",
"guests": [
{
"email": "test.name@booking.com",
"name": "Test Name"
}
]
}
],
"remarks": {
"estimated_arrival_time": {
"hour": 12
},
"special_requests": "We will need an extra cot."
}
},
"booker": {
"address": {
"address_line": "Road-1, house-2",
"city": "Amsterdam",
"country": "nl",
"post_code": "11111"
},
"company": "Booking B.V",
"email": "test.name@booking.com",
"language": "en-gb",
"name": {
"first_name": "Test",
"last_name": "Name"
},
"telephone": "12345678"
},
"order_token": "sample-token",
"payment": {
"card": {
"cardholder": "Test Name",
"cvc": "111",
"expiry_date": "2030-10",
"number": "23333333333333"
},
"include_receipt": true,
"method": "card",
"timing": "pay_at_the_property"
}
}
Example - orders/create response
A successful response from /orders/create returns the following information about the order:
Field | Description |
---|---|
payment.receipt_url | Link to the payment receipt for the order (if provided). |
authorisation_form_url | In this example, this field is null as no payment instructions or authorisations have been included.
|
accommodation.order |
|
accommodation.pincode | This is a shorter authorisation number that is required to perform certain operations on the order. |
accommodation.reservation | For backward compatibility with V2, only used if you need to access legacy orders. |
For more information about Reservation ID, see Migration guide.
Example response
{
"request_id": "01j69mtd91x3pdcmqyj0spebt9",
"data": {
"payment": {
"receipt_url": "https://secure.booking.com/payment_receipt.html?product_type=BookingBudget&aid=2373042&auth_key=8riKJJ0XuxDhk4ds&lang=en",
"authorisation_form_url": null
},
"accommodation": {
"order": "5006302528200239",
"pincode": "884512",
"reservation": 55303962
}
}
}
Step 4 - Confirm the booking with the traveller.
Use the /orders/create data to:
- Display your order confirmation page.
- Notify the traveller that their booking has been confirmed.
- Refer to the orders/details guide for instructions and examples on how to use this endpoint.
- Learn more about accommodation pricing and how you can display it in your application.