ChatBedsڈویلپرز
آغاز

اس صفحے کا ترجمہ ابھی نہیں ہوا، اس لیے آپ انگریزی ورژن پڑھ رہے ہیں۔

The Sandbox Hotel

What your free test hotel contains, how its keys work, and how to test on staging with reset, time travel and simulated guests and payments.

Every developer account gets one Sandbox Hotel. It is a working ChatBeds property filled with invented data, made through the same code as a real hotel, so prices, bills and housekeeping behave exactly as they do in production.

Build on staging

The best place for your sandbox is staging.chatbeds.app: every feature unlocked, up to 10 test hotels, card payments in Stripe's test mode, simulated WhatsApp guests, and test tools to reset the hotel, move its clock and replay webhooks. Sign up there and press Start building on the Developers page. See Environments.

What it contains

In the Sandbox Hotel
Location100 Test Street, Newark, DE, United States. Time zone America/New_York
CurrencyUSD, with no tax and no cleaning fee
Check-in and check-out14:00 and 12:00
Rooms12 rooms in 3 room types: Standard (6 rooms, sleeps 2, 90.00 a night), Deluxe (4 rooms, sleeps 3, 140.00), Suite (2 rooms, sleeps 4, 240.00)
Guests and bookings8 made-up stays around today's date. 2 guests are already checked in and have paid half
Staff6 made-up staff, for example Anna Weber (general manager) and Maria Lopez (housekeeper)
AlsoStock items, a few maintenance tickets and two expenses, so the dashboard looks lived in

The guests and staff have no phone numbers, so nothing you do in the sandbox sends a WhatsApp message to anyone. On staging, WhatsApp is a simulator in any case: write to the hotel as a guest and see its replies with their buttons.

Never billed

The Sandbox Hotel is free and never billed. It doesn't count towards the Free plan's room limit, and making keys for it needs no plan. You can connect your own apps to it at any time, before ChatBeds reviews them.

Keys

When you press Start building, ChatBeds makes one key called Sandbox key. Bookings made with it carry the source PARTNER:sandbox.

To make more keys, revoke one, or give a key a webhook address, open Settings → Partner API in the dashboard with the Sandbox Hotel selected.

  • A property can have up to 5 keys in use at once.
  • A key is shown once. If you lose it, revoke it and make another.
  • Revoking a key stops it at once.

Reset, scenarios and time travel (staging)

On staging, put the Sandbox Hotel back to a known state whenever a test needs one, from the Test tools page or from your test suite:

curl -X POST "https://staging.chatbeds.app/partner/v1/sandbox/reset" \
  -H "Authorization: Bearer cbk_test_••••" -H "Content-Type: application/json" \
  -d '{"scenario": "standard"}'

The hotel keeps its id, name, keys and connected apps; its bookings are made afresh. Scenarios: standard (as new), busy (every room taken tonight, 3 leaving, 6 arriving) and empty (no bookings). To test what happens tomorrow, move the hotel's clock.

In production there is no reset: bookings you make stay until you cancel them through the API or the dashboard.

Card payments

On staging, connect Stripe with a test secret key (sk_test_...) on the Sandbox Hotel's Finance page. payment_links becomes true in GET /capabilities, links open Stripe's test checkout, and you pay them with Stripe's test cards, or simulate the outcome without opening the page. Live keys are refused on staging.

What the sandbox can't do

Card payments in production

In production the Sandbox Hotel has no Stripe account connected, so payment_links is false in GET /capabilities and creating a payment link answers 400:

400 Bad Request
{
  "detail": "Card payments are not set up for this hotel. An owner connects Stripe on the Finance page."
}

You can still test bills: read a folio, add charges, and record payments taken elsewhere with the method CASH, CARD or BANK_TRANSFER. See Folios and payments.

Other properties

Every key and token acts for one property. Calls about anything outside the Sandbox Hotel answer 404, just as they would for a real hotel.

Moving to a real hotel

Your code doesn't change between the sandbox and a real hotel. Only the base URL (staging to production) and the credential do:

  • with a private key, the hotel makes the key on its own Settings → Partner API page;
  • with an app, the hotel connects it and you get tokens for its property. See OAuth 2.0.

کچھ بنا رہے ہیں؟

اس صفحے پر