Last updated

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
  • Validate order details before booking. This includes:

    ✓ Guest allocation (essential for preventing pricing errors)

    ✓ Price breakdown verification.

    ✓ Review of available payment timings, methods and schedules for each product in the order.

  • Obtain a unique order_token, with encapsulated information needed to create the order. You must pass this token to the /orders/create request instead of having to rebuild the order again, reducing the risk of data errors.

/orders/create
  • Confirm the booking and process the payment.

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 and accommodation.checkout - Use the values from the previous response.

  • accommodation.id and products - 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:

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:

order-preview

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.idID for this product. Must match the product ID from /orders/preview request.
accommodation.products[].guests[]Name and email for each guest in the product.
bookerContact details of the person placing the order.

order_token

Copy the token from the /orders/preview response.

The order_token is only valid for 15 minutes after it is issued. If the order_token expires, repeat the /orders/preview call to generate a new one.

payment

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
DescriptionUse it for...
accommodation.labelA 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_configurationAn identifier for the desired bed configuration (returned from accommodations/details response)To indicate a prefer bed setup for guests.
accommodation.remarksContains optional guest requests.Communicate time-sensitive or special needs to the property. There are two options:
  • estimated_arrival_time: where traveller indicates when the guest expects to arrive.
  • special_requests: Free-text comments from the guest (e.g. “Extra cot needed” or "car parking request"). These are not guaranteed to be fulfilled.
booker.companyProvides the booker’s company name.Use it for B2B bookings or invoicing purposes.
payment.include_receiptIs 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_nowYou can generate a receipt via orders/create endpoint only when the payment timing is pay_online_now.

pay_online_later

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_urlLink to the payment receipt for the order (if provided).
authorisation_form_urlIn this example, this field is null as no payment instructions or authorisations have been included.
accommodation.order
  • Unique identifier for the booking, which can be used for cancellations or customer support.
  • Use it if you need order information for post-booking tasks (see /orders/details/*)
accommodation.pincodeThis is a shorter authorisation number that is required to perform certain operations on the order.
accommodation.reservationFor 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.

Curious to know more?