このページはまだ翻訳されていないため、英語版を表示しています。
Negotiation
Ask the hotel for private offers for your guest's stay, counter, and book the agreed one: inside the hotel's own limits.
Hotels that bargain let Ana, ChatBeds' AI receptionist, make private offers inside limits the owner sets. Your app can take part for its guests: ask for offers for a stay, counter with what the guest would pay, and book the offer they accept. It is the same negotiation the hotel runs on its booking page, WhatsApp and the phone, with the same rules:
- Trades, not discounts. Each kind of offer unlocks part of the allowance:
base(the guest's dates),pay_now(the whole stay paid when booking),longer(one more night) anddates(a quieter date, when the guest can move). - Never under the floor. No night is priced under the hotel's lowest price for its room type, and how much comes off depends on how full the hotel is.
- Private. Offers are prices for one stay, with an expiry. They are never a public rate, and the hotel's limits are never shown to you.
The hotel turns it on
Negotiation is off for partner apps until the hotel turns on Partner apps in Revenue → Negotiation. Until then, starting one answers 409. negotiation.terms tells you whether it is open.
The negotiation object
| Field | Type | Meaning |
|---|---|---|
id | uuid | |
status | string | OPEN, BOOKED, DECLINED or EXPIRED |
currency | string | |
arrival, departure | date | The stay asked for |
adults, children | integer | |
room_type_id | uuid or null | The room type asked for; null: the offers choose |
offers | array | The offers standing now (empty once it isn't OPEN). Each {id, kind, label, room_type_id, room_type, rate_plan_id, arrival, departure, nights, room_total, total, pay_now, gift?}. total is the whole stay with tax |
said | array | What was said, in order: {by: "guest" or "ana", said} |
expires_in, expires_at | integer, datetime | Seconds left, and when the offers end |
reservation_id | uuid or null | The booking, once booked |
token | string | The negotiation's handle (you use id) |
Get the terms
/properties/{property_id}/negotiationnegotiation:readOperation negotiation.terms{ "open": true, "max_rounds": 3, "expiry_minutes": 30, "max_nights": 30, "room_type_ids": [], "kinds": ["base", "pay_now", "longer", "dates"] }room_type_ids lists the room types the hotel bargains on; empty means every one. Counter-offers past max_rounds get the hotel's last word.
Ask for offers
/properties/{property_id}/negotiationsnegotiation:writeOperation negotiation.startarrival.1.{first_name?, last_name?, email?, phone?}. A returning guest may get a little more.curl -X POST "https://app.chatbeds.app/partner/v1/properties/19306340-c7cf-465a-93d3-0b7873a7e85d/negotiations" \
-H "Authorization: Bearer cbk_••••" -H "Content-Type: application/json" \
-d '{"arrival": "2026-12-10", "departure": "2026-12-12", "adults": 2, "budget": 180,
"guest": {"first_name": "Sara", "email": "sara@example.com"}}'{
"negotiation": {
"id": "c41f7e2a-9b3d-4e6a-8f15-2d7c9a0b3e58",
"status": "OPEN",
"currency": "USD",
"arrival": "2026-12-10",
"departure": "2026-12-12",
"adults": 2,
"children": 0,
"room_type_id": null,
"offers": [
{ "id": "o1", "kind": "base", "label": "Your dates", "room_type": "Deluxe", "nights": 2, "room_total": 190.0, "total": 190.0, "pay_now": false },
{ "id": "o2", "kind": "pay_now", "label": "Pay now", "room_type": "Deluxe", "nights": 2, "room_total": 180.0, "total": 180.0, "pay_now": true }
],
"said": [{ "by": "ana", "said": "Here's what I can do..." }],
"expires_in": 1800,
"expires_at": "2026-11-05T12:30:00+00:00",
"reservation_id": null
}
}Errors
| Status | When |
|---|---|
409 | The hotel isn't taking offers from partner apps, or the room type asked for has a fixed price |
400 | Dates in the past, departure not after arrival, more than 30 nights, too many guests |
Counter
/negotiations/{negotiation_id}/counternegotiation:writeOperation negotiation.counterSay what the guest would pay for the whole stay (with tax). Ana accepts it, meets the guest part of the way, or shows the trade that comes closest, never under what the hotel's limits allow. The answer is the negotiation with its new offers.
409 once it is booked, declined or expired: ask again.
Book the agreed offer
/negotiations/{negotiation_id}/booknegotiation:writeOperation negotiation.bookBooks the offer for the guest at its price: a normal partner booking (source PARTNER:<partner>, your external_ref), on the tape chart, with the hotel told. The answer has the reservation and the negotiation, now BOOKED.
{first_name, last_name, email?, phone?}.pay_now offer: the whole total, which your app took from the guest. Required for those.CARD (default), CASH or BANK_TRANSFER.r = requests.post(f"{BASE}/negotiations/{negotiation_id}/book", headers={**HEADERS, "Idempotency-Key": "OTA-778-book"},
json={"offer_id": "o2", "guest": {"first_name": "Sara", "last_name": "Khan", "email": "sara@example.com"},
"external_ref": "OTA-778", "paid_amount": 180, "payment_method": "CARD"})
reservation = r.json()["reservation"] # 201 CreatedErrors
| Status | When |
|---|---|
409 | The offers expired or changed, the negotiation isn't open, the room was taken meanwhile, or the guest can't be booked at this hotel |
400 | A pay-now offer without its whole total in paid_amount, or the guest's names missing |
Decline
/negotiations/{negotiation_id}/declinenegotiation:writeOperation negotiation.declineThe guest said no: the negotiation is closed (DECLINED) and its offers end. Declining one already closed changes nothing.
Get and list
/negotiations/{negotiation_id}negotiation:readOperation negotiation.get/properties/{property_id}/negotiationsnegotiation:readOperation negotiation.listYour app sees only the negotiations it started. The list is newest first; filter with status (OPEN, BOOKED, DECLINED, EXPIRED) and limit (1 to 200, default 50).
何か作っていますか?