Last updated

Messaging API quick guide

If you're a Managed Affiliate Partner, you can start testing the Messaging API in your application today.


This guide helps you try out the Messaging API in 15–30 minutes using our dedicated test hotel with automated replies.

⏱️ Estimated time to complete: 15 - 30 minutes

  • Purpose: Quickly try out the Messaging API.
  • When to use: You want to test post-booking communication flows.
  • You'll learn how to:
    1. Create a test booking and trigger auto-replies.
    2. Retrieve an automated welcome message.
    3. Confirm receipt.
  • Code samples: Minimal, only required fields.

Before you start

Make sure you:

You'll need:

✓ A valid API key token.
✓ Your X-Affiliate-Id.
✓ Access to the sandbox environment.

Every Messaging API request must be authenticated with your Demand API v3.1 credentials.


Test setup

✓ Test accommodation ID 13921698 - Demand API Messaging Test Hotel

The Messaging Test Hotel is preconfigured with automated replies, such as:

  • Welcome message after booking confirmation.
  • Rejections for requests like extra beds or parking.

Note: Real accommodations can configure their own auto-replies via Booking.com’s Extranet messaging centre.

Try it out — minimal flow

book → get a message → confirm receipt.

Step 1 - Create a test order

Make a reservation at Demand API Messaging Test Hotel (ID 13921698) via /orders/preview and orders/create.

Important

Always provide a valid test credit card in the payment field; otherwise your booking request will fail.

See Testing payments and the orders/create guide for instructions on how to make a booking.

When successful, the orders/create response includes:

{
  "data": {
    "accommodation": {
      "reservation": "6066547158", 
      "order": "5006302528200239",
      "pincode": "884512"
    }
  }
}

→ Use the reservation id to fetch conversations and send messages.

Step 2 - Retrieve the welcome message

After the booking is confirmed, the Demand API Messaging Test Hotel automatically sends a welcome message.

  • Guest view: The welcome message appears in the guest’s email (or registered app).
  • Accommodation view: The property sees the booking and message in the Booking.com Extranet messaging centre.

Example in Booking.com Extranet messaging centre:

Booking.com Extranet showing auto-reply welcome message

Accommodation hosts can use Booking.com Extranet messaging centre or any other channel to communicate with guests.

→ Call /messages/latest endpoint to fetch the automated welcome message.

Request:

  • You don't need to provide parameters; just send an empty body POST request.

Response:

{
  "data": {
    "messages": [
      {
        "content": "Hello, thanks for booking Demand API Test Hotel!",
        "timestamp": "2025-07-29T12:04:05.466Z"
      }
    ]
  }
}

Step 3 - Confirm receipt

After processing, confirm messages with /messages/latest/confirm.

Request:

{
    "messages":["3f986fc8-b944-4501-b8d1-430e833ca756"]
}

When successful, the response returns HTTP 200 OK.


Next steps

This was the minimal flow: book → get a message → confirm receipt.