ChatBedsEntwickler
API-Referenz

Diese Seite ist noch nicht übersetzt. Sie lesen die englische Fassung.

Test tools (staging)

Reset the test hotel, move its clock, send yourself webhook events and replay them, read the API log, and simulate card payments and guests' WhatsApp messages. Staging only.

These endpoints exist on staging only, at https://staging.chatbeds.app/partner/v1/sandbox/.... In production they answer 404. They act on the property of the key or token that calls them, and they need no scope, except where noted. Hotels have the same tools on the Test tools page of the staging dashboard.

Reset the test hotel

GET/sandbox/scenarios
Operation sandbox.scenarios
POST/sandbox/reset
Operation sandbox.reset

Empties the hotel and fills it again from a scenario: its rooms, prices, team and bookings. Its id, name, API keys and connected apps stay, so your configuration keeps working. Everything else made there goes: bookings, guests who stayed only there, bills, policies you created, the guest phone's conversations, and the logs below. The clock goes back to now.

scenario string
standard (the default): 12 rooms, 8 stays around today, 2 guests in house who paid half. busy: 3 guests leaving today, 6 arriving and 3 staying on, every room taken tonight. empty: the rooms, prices and team, with no bookings.

Only the hotel's own keys can reset it. An app's access token answers 403.

Request
curl -X POST "https://staging.chatbeds.app/partner/v1/sandbox/reset" \
  -H "Authorization: Bearer cbk_test_••••" \
  -H "Content-Type: application/json" \
  -d '{"scenario": "busy"}'
200 OK
{
  "property_id": "19306340-c7cf-465a-93d3-0b7873a7e85d",
  "name": "Sandbox Hotel",
  "scenario": "busy",
  "reservations": 12,
  "rooms": 12,
  "kept": { "keys": 1, "apps": 0 }
}

Booking ids change with every reset: read them again afterwards.

Time travel

GET/sandbox/clock
Operation sandbox.clock
POST/sandbox/clock
Operation sandbox.moveClock

Moves the test hotel's own clock forward. Tomorrow's arrivals become today's, check-outs fall overdue, and the night audit and guest reminders come due at their next run. Nothing else's clock moves, and what is recorded keeps the real time it happened.

hours integer
Hours to move on (negative to move back).
days integer
Days to move on (negative to move back).
back_to_now boolean
Put the clock back to now.

The clock can be at most 400 days ahead, and never behind now (400).

200 OK
{
  "offset_minutes": 3060,
  "hotel_now": "2026-11-09T08:12-05:00",
  "hotel_today": "2026-11-09",
  "real_now": "2026-11-07T13:12+00:00",
  "moved": true
}

Webhooks

Send an event

POST/sandbox/events
Operation sandbox.fireEvent

Sends a webhook event about one of the hotel's bookings to this key's webhook address now, with the real payload, signed as usual. It is sent whether or not the key turned that event on, and its body has "test": true. The key still needs the scope the event needs (an app needs reservations:read for booking events, folios:read or payments:write for payment events).

event stringrequired
reservation.created, reservation.modified, reservation.cancelled, reservation.checked_in, reservation.checked_out, reservation.no_show, folio.updated, or payment.completed, payment.failed, payment.expired, payment.voided, payment.refunded.
reservation_id uuidrequired
The booking it is about.
payment_id uuid
For a payment event: the payment. Default: the booking's latest.
202 Accepted
{ "queued": ["a6f1c2d4-5e8b-4c3a-9f71-2b0d8e6a4c19"] }

400 when the key has no webhook address, the event is unknown, or the booking has no payment for a payment event.

The webhook log

GET/sandbox/webhooks
Operation sandbox.webhookLog

This key's deliveries, newest first, with their bodies: status (PENDING, SENT or FAILED), attempts, last_error, delivered_at, test, replay_of and body. limit: 1 to 200, default 50.

Replay a delivery

POST/sandbox/webhooks/{webhook_id}/replay
Operation sandbox.replayWebhook

Sends a delivery again as a new one: the same body under a new id, with replay_of naming the first. Answers 202 with {"queued": [...], "replay_of": "..."}.

The API log

GET/sandbox/requests
Operation sandbox.apiLog

The last 1,000 calls made with this key or token, newest first: request_id, method, path, status, ms, and the request_body (up to 8 KB) and response_body (up to 16 KB). Secrets in bodies (fields named like secret, token, password, card_number, cvc) are masked.

request_id string
Only the call with this X-Request-Id.
limit integer
1 to 200, default 50.

Every answer, in both environments, carries an X-Request-Id header. Send your own and it comes back, so you can match the call in your logs and here.

Simulate a card payment

POST/sandbox/simulate/payment
Operation sandbox.simulatePayment

What Stripe would tell ChatBeds about a card payment link, run through the same code as Stripe's own notice: the bill, the booking, the hotel's messages and your webhooks all follow, exactly as for a real payment.

payment_id uuidrequired
A PENDING card link, from Create a payment link.
outcome stringrequired
paid, failed or expired.
200 OK
{
  "result": "paid",
  "payment": {
    "id": "d302aa4b-90a4-44f4-b510-501da4c65bb3",
    "reservation_id": "fd3f935f-7ff2-4493-bc69-b132fdd38609",
    "kind": "PAYMENT",
    "amount": 50.0,
    "currency": "USD",
    "method": "STRIPE",
    "status": "COMPLETED",
    "paid_at": "2026-11-07T13:20:41+00:00"
  }
}

Making the link needs Stripe connected with a test key on the hotel's Finance page. You can also pay it for real with Stripe's test cards.

Guests on WhatsApp

Write as a guest

POST/sandbox/simulate/guest-message
Operation sandbox.guestMessage

A guest's WhatsApp message to the hotel, or a tap on one of its buttons, taken through the same path as a real one. The answer holds every message the hotel sent back, as WhatsApp's Cloud API would have received it: its text, buttons, list and Pay now link.

phone stringrequired
The guest's number, with its country code. Use the fiction ranges, for example +44 7700 900123.
text string
What the guest writes (or, with button, the words on the button).
button string
The id of a button or list row the guest taps, from an earlier reply.
name string
The guest's WhatsApp name.
200 OK
{
  "status": "inbox",
  "phone": "+447700900123",
  "replies": [
    {
      "id": "wamid.sim.6541cc10992849229918b9930c7b27d5",
      "at": "2026-11-07T13:30:09.032622+00:00",
      "message": {
        "to": "+447700900123",
        "type": "interactive",
        "interactive": {
          "type": "list",
          "body": { "text": "Happy to book you a room 🛏️ Which day would you arrive? Pick a day, or type a date like 25/10." },
          "action": {
            "button": "Pick a day",
            "sections": [{ "title": "Pick a day", "rows": [
              { "id": "g:bk:d:0", "title": "📅 Today", "description": "Sat 7 Nov" },
              { "id": "g:bk:d:1", "title": "📅 Tomorrow", "description": "Sun 8 Nov" }
            ] }]
          }
        }
      }
    }
  ]
}

To tap Tomorrow: {"phone": "+447700900123", "button": "g:bk:d:1", "text": "📅 Tomorrow"}.

The hotel answers guests when its Guest services are on. When they are off, replies is empty and note says so: the message waits in the hotel's inbox for a person, as it would in production.

The guest phone

GET/sandbox/guest-phone
Operation sandbox.guestPhone

One number's conversation with the hotel, oldest first: the guest's messages ("from": "guest") and the hotel's ("from": "hotel"), including messages the hotel sent on its own, such as booking confirmations and reminders. Query: phone, and limit (1 to 500, default 100).

Sie bauen etwas?

Auf dieser Seite