ChatBedsDevelopers
Getting started

Quickstart

Get a free developer account, copy your sandbox key, make your first call, search offers and book a stay in the Sandbox Hotel.

This guide takes you from sign-up to a confirmed booking in the Sandbox Hotel. Every response below is a real one, recorded against the sandbox.

Create a free developer account

Open app.chatbeds.app/signup?developer=1. The page says Create your free developer account. Fill in your details and press Sign Up. No card is needed.

Get your Sandbox Hotel and key

After sign-up you land on the Developers page (app.chatbeds.app/developers) and your Sandbox Hotel is set up for you. If you signed up another way, press Start building on that page.

ChatBeds then shows Your sandbox API key, a value that starts with cbk_. Copy it now: it is shown once.

Lost the key?

Make another one on Settings → Partner API for the Sandbox Hotel. Revoke the old one there too.

The Your sandbox panel also shows the API address. In production it is:

https://api.chatbeds.app/partner/v1

Save the key in an environment variable so the samples below work as they are:

export CHATBEDS_KEY="cbk_..."

Make your first call

GET /me tells you which key you are using and which property it acts for. It needs no scope.

Request
curl https://api.chatbeds.app/partner/v1/me \
  -H "Authorization: Bearer $CHATBEDS_KEY"
200 OK
{
  "api_version": "1",
  "key": {
    "id": "465f3661-c8f0-4a15-8ad6-9bdc1cce118d",
    "name": "Sandbox key",
    "partner": "sandbox",
    "prefix": "cbk_8iT8Ct0S"
  },
  "property": {
    "id": "19306340-c7cf-465a-93d3-0b7873a7e85d",
    "name": "Sandbox Hotel"
  }
}

Keep property.id. Every property-level path uses it. Save it too:

export PROPERTY_ID="19306340-c7cf-465a-93d3-0b7873a7e85d"

Search offers

Ask what can be sold for two adults, arriving 31 October and leaving 2 November. Dates are the hotel's own dates, written YYYY-MM-DD.

Request
curl "https://api.chatbeds.app/partner/v1/properties/$PROPERTY_ID/offers?arrival=2026-10-31&departure=2026-11-02&adults=2" \
  -H "Authorization: Bearer $CHATBEDS_KEY"
200 OK
{
  "property_id": "19306340-c7cf-465a-93d3-0b7873a7e85d",
  "arrival": "2026-10-31",
  "departure": "2026-11-02",
  "nights": 2,
  "adults": 2,
  "children": 0,
  "offers": [
    {
      "room_type": {
        "id": "da3b4c87-c1ca-4f13-8c90-066900f16d48",
        "name": "Standard",
        "max_occupancy": 2
      },
      "rate_plan": null,
      "available": 6,
      "currency": "USD",
      "nights": [
        { "date": "2026-10-31", "price": 90.0 },
        { "date": "2026-11-01", "price": 90.0 }
      ],
      "room_total": 180.0,
      "fees": [],
      "tax": { "rate": 0.0, "included": false, "amount": 0.0 },
      "total": 180.0
    }
    // ... Deluxe (280.0) and Suite (480.0)
  ]
}

Note the Standard room's room_type.id and its total of 180.0. You send both back when you book.

Create a booking

Book the Standard room for Daniel Moore. Send the offer's total as expected_total: if the price has changed since you searched, nothing is booked and you get a 409 with the new total. Send an Idempotency-Key so a retry after a network error can't book twice.

Request
curl -X POST "https://api.chatbeds.app/partner/v1/properties/$PROPERTY_ID/reservations" \
  -H "Authorization: Bearer $CHATBEDS_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: b2f1c9e4-booking-BK-104233" \
  -d '{
    "room_type_id": "da3b4c87-c1ca-4f13-8c90-066900f16d48",
    "arrival": "2026-10-31",
    "departure": "2026-11-02",
    "adults": 2,
    "children": 0,
    "guest": {
      "first_name": "Daniel",
      "last_name": "Moore",
      "email": "daniel.moore@example.com",
      "phone": "+14155550123"
    },
    "external_ref": "BK-104233",
    "notes": "Late arrival, around 23:00",
    "expected_total": 180.0
  }'
201 Created
{
  "reservation": {
    "id": "a589df05-30ad-4ee5-9832-16ff6c2c1d0e",
    "ref": "A589DF",
    "property_id": "19306340-c7cf-465a-93d3-0b7873a7e85d",
    "status": "confirmed",
    "source": "PARTNER:sandbox",
    "external_ref": "BK-104233",
    "arrival": "2026-10-31",
    "departure": "2026-11-02",
    "nights": 2,
    "adults": 2,
    "children": 0,
    "guest": {
      "first_name": "Daniel",
      "last_name": "Moore",
      "email": "daniel.moore@example.com",
      "phone": "+14155550123"
    },
    "room_type": {
      "id": "da3b4c87-c1ca-4f13-8c90-066900f16d48",
      "name": "Standard"
    },
    "unit": null,
    "rate_plan": null,
    "currency": "USD",
    "total": 180.0,
    "paid": 0.0,
    "balance": 180.0,
    "cancellation": null,
    "created_at": "2026-10-10T05:09:47.271659+00:00",
    "updated_at": "2026-10-10T05:09:47+00:00"
  }
}

If the price had moved, you would get this instead, and nothing would be booked:

409 Conflict
{
  "detail": "The price has changed: the total is now USD 180.00."
}

See it in the dashboard

Open app.chatbeds.app and look at Reservations or the Calendar for the Sandbox Hotel. Daniel Moore's stay is there with the source PARTNER:sandbox, and the hotel is alerted to it like any other booking.

Next steps

Building something?

On this page