Booking.com Demand API (3.1)

The Demand API allows Affiliate Partners to access Booking.com’s inventory, including accommodation, car rental, and flight information.

- The API follows REST principles and returns JSON responses.
- You can consume them directly through HTTPS calls, using the POST method.
- Note: Authentication is required using your Affiliate ID and token credentials.

Try it out!

Download OpenAPI description
Languages
Servers
Production environment
https://demandapi.booking.com/3.1/
Sandbox environment
https://demandapi-sandbox.booking.com/3.1/

Accommodation

This API collection is specific for the stay part of the connected trip.

Use these endpoints to search for stays such as hotels and apartments, check availability, retrieve reviews, and get detailed property information.

Operations

Car rentals

This API collection is specific to the car rentals part of the connected trip.

Use these endpoints to search for car rentals, check car details and look for depots and suppliers.

Operations

Locations

Provides identifiers for a wide range of geographical locations, including airports, countries, cities, and regions.

Use these identifiers to construct your requests.

Note: These identifiers are available across all travel services and you can use them for both accommodotation and car rentals requests.

Operations

Payments

Provides generic payment-related endpoints, including supported currencies and payment types.

Operations

Languages

Provides a list of supported language codes for use in API requests.

Operations

Orders

Enables management of booking orders within the Demand API.

Use these endpoints to preview and create new orders, check order details, cancel or modify existing orders. This collection is required to integrate booking and order management functionality.

Operations

Messages

Provides endpoints for two-way post-booking communication between guests and properties.

Use these endpoints to send and retrieve messages, exchange images, and check conversation details.

Operations

Conversations

Provides endpoints to retrieve and manage messaging conversations.

Use these endpoints to list conversations, fetch conversation details, and track updates.

Operations

Attachments

Provides endpoints for handling message attachments.

Use these endpoints to upload and download images shared within conversations.

Operations

Upload an attachment

Request

Uploads a file to be used as a message attachment. The response includes an attachment ID to reference when sending messages.

Headers
X-Affiliate-Idintegerrequired

Include here your Affiliate identifier number

Bodyapplication/jsonrequired
conversationstringrequired

Unique identifier of the conversation.

accommodationstringrequired

Unique identifier of the property.

file_sizeintegerrequired

Size of the file in bytes.

file_namestringrequired

Original file name including extension.

file_typestringrequired

MIME type of the file.

file_contentstringrequired

Base64-encoded content of the file.

curl -i -X POST \
  https://demandapi.booking.com/3.1/messages/attachments/upload \
  -H 'Authorization: Bearer <YOUR_string_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'X-Affiliate-Id: 0' \
  -d '{
    "accommodation": "6819547",
    "conversation": "8586a789-44f4-5521-9f27-f5efd097cba6",
    "file_size": 17580,
    "file_name": "a3e062a0-3e6b-4592-9df2-64cf83688084.jpg",
    "file_type": "image/jpeg",
    "file_content": "/9j/4AAQSkZJRgABAQACWAJYAAD/2wCEAAgGBgc"
  }'

Download a message attachment

Request

Retrieves a file that was attached to a message. The response includes the file's content as a base64-encoded string.

Headers
X-Affiliate-Idintegerrequired

Include here your Affiliate identifier number

Bodyapplication/json
conversationstringrequired

The unique identifier of the conversation that contains the attachment.

accommodationstringrequired

The unique identifier of the property where the conversation occurred.

attachmentstringrequired

The unique identifier of the attachment to download.

curl -i -X POST \
  https://demandapi.booking.com/3.1/messages/attachments/download \
  -H 'Authorization: Bearer <YOUR_string_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'X-Affiliate-Id: 0' \
  -d '{
    "conversation": "8586a789-44f4-5521-9f27-f5efd097cba6",
    "accommodation": "6819547",
    "attachment": "9635be40-1dc6-11f0-8893-0130f0cdef6d"
  }'

Responses

Attachment successfully retrieved.

Bodyapplication/json
request_idstring

A unique ID for this request. Please include this when contacting support.

dataobject
Response
application/json
{ "request_id": "773e2c0d-1ab3-449b-b88a-3d6b5ce09ae7", "data": { "conversation": "8586a789-44f4-5521-9f27-f5efd097cba6", "file_content": "/9j/4AAQSkZJRgABAQACWAJYAAD/2wCEAAgGBgc..." } }

Retrieve attachment metadata

Request

Returns metadata for a file uploaded in a message, including its name, type, and size.

Headers
X-Affiliate-Idintegerrequired

Include here your Affiliate identifier number

Bodyapplication/json
conversationstringrequired

The unique identifier of the conversation that includes the attachment.

accommodationstringrequired

The unique identifier of the property associated with the conversation.

attachmentstringrequired

The unique identifier of the attachment whose metadata is being requested.

curl -i -X POST \
  https://demandapi.booking.com/3.1/messages/attachments/metadata \
  -H 'Authorization: Bearer <YOUR_string_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'X-Affiliate-Id: 0' \
  -d '{
    "conversation": "8586a789-44f4-5521-9f27-f5efd097cba6",
    "accommodation": "6819547",
    "attachment": "9635be40-1dc6-11f0-8893-0130f0cdef6d"
  }'

Responses

Successful response.

Bodyapplication/json
request_idstring

Uniquely identifies the request. Please provide this identifier when contacting support.

dataobject
Response
application/json
{ "request_id": "fec1a9bb-9c85-42fc-a109-3707e1ed4de7", "data": { "metadata": {} } }