ChatBedsนักพัฒนา
เอกสารอ้างอิง API

หน้านี้ยังไม่ได้แปล คุณจึงกำลังอ่านฉบับภาษาอังกฤษ

Rates and restrictions

Read each room type's price and restrictions by date, and set them: per date, or over a range of dates at once.

These operations work on the hotel's rate grid, the same grid its revenue page shows: a price per room type and date (and its rate plans'), and restrictions: closed, minimum and maximum stay, closed to arrival and closed to departure. A booking made anywhere (the booking page, the front desk, a channel, your app) is priced and checked by it. Each change is kept on the hotel's rate history as your app's, and can be undone there.

Read the grid

GET/properties/{property_id}/rates
Scope rates:readOperation rates.grid
start date (query)
The first date. Default: today at the hotel.
days integer (query)
1 to 62. Default 14.
room_type_id uuid (query)
Only this room type.
Request
curl "https://app.chatbeds.app/partner/v1/properties/19306340-c7cf-465a-93d3-0b7873a7e85d/rates?start=2026-12-20&days=7" \
  -H "Authorization: Bearer cbk_••••"

The answer has the dates, and for each room type its price per date with where it came from (the base price, a season, a rule, a price set by hand), its restrictions per date, and its rate plans' prices. Prices are in the property's currency.

Set prices and restrictions

POST/properties/{property_id}/rates
Scope rates:writeOperation rates.set

Up to 2,000 cells at once, recorded as one change. Each cell names a room type and a date, and optionally a rate plan (a plan's own cell holds restrictions only; its price follows the plan).

edits arrayrequired
Each {room_type_id, date, rate_plan_id?, price?, closed?, min_stay?, max_stay?, cta?, ctd?}.
FieldMeaning
priceThe night's price. null clears it: back to the hotel's usual rate
closedtrue: nothing can be booked that night
min_stay, max_stayNights, 1 to 365. null clears
ctaClosed to arrival: no stay may start that night
ctdClosed to departure: no stay may end that morning

A field left out is left as it is.

Request
curl -X POST "https://app.chatbeds.app/partner/v1/properties/19306340-c7cf-465a-93d3-0b7873a7e85d/rates" \
  -H "Authorization: Bearer cbk_••••" -H "Content-Type: application/json" \
  -H "Idempotency-Key: rm-sync-2026-11-05T10:00" \
  -d '{"edits": [
        {"room_type_id": "511024bc-2687-47dc-b0e3-cd03c31522e1", "date": "2026-12-31", "price": 240, "min_stay": 2},
        {"room_type_id": "511024bc-2687-47dc-b0e3-cd03c31522e1", "date": "2027-01-01", "cta": true}
      ]}'
200 OK
{
  "change": {
    "id": "3b2e9d71-5c0a-4f8e-a1d6-7e4c9b2f0a35",
    "kind": "partner",
    "summary": "Rates from RevenueMaster",
    "channel": "PARTNER",
    "actor_name": "RevenueMaster (partner API)",
    "created_at": "2026-11-05T10:00:03.118207+00:00",
    "reverted_at": null,
    "reverts_change_id": null
  }
}

change is null when nothing was different.

Set a range of dates

POST/properties/{property_id}/rates/range
Scope rates:writeOperation rates.setRange

One change over a range of dates (and, if you like, only some weekdays) and room types: a price, a change by a percent or an amount, restrictions, or clearing them.

room_type_ids array of uuidrequired
1 to 50 room types.
start daterequired
The first night.
end daterequired
The last night, included. At most 500 days after start.
weekdays array of integer
Only these weekdays, 0 (Monday) to 6 (Sunday).
rate_plan_id uuid
Restrictions for this plan only.
price number
Set this price.
adjust_percent number
Or change the current price by a percent, -90 to 500.
adjust_amount number
Or by an amount (negative lowers it).
clear_price boolean
Back to the usual rate.
closed boolean
min_stay integer
max_stay integer
clear_min_stay boolean
clear_max_stay boolean
Request: weekends in December 15% up, closed on the 24th
requests.post(f"{BASE}/properties/{pid}/rates/range", headers=HEADERS, json={
    "room_type_ids": [deluxe, suite], "start": "2026-12-01", "end": "2026-12-31", "weekdays": [4, 5],
    "adjust_percent": 15})
requests.post(f"{BASE}/properties/{pid}/rates/range", headers=HEADERS, json={
    "room_type_ids": [deluxe, suite], "start": "2026-12-24", "end": "2026-12-24", "closed": True})

end before start answers 422.

Channels follow

When the hotel uses ChatBeds' channel manager, the new prices and restrictions are sent on to the booking sites it is connected to, as when the hotel changes them itself.

กำลังสร้างอะไรอยู่หรือเปล่า?

ในหน้านี้