Hotel Allotments
Read and change how many rooms a hotel sells each night, to whom, and whether a night is open at all: allotments, free sale, on request and stop sales.
These endpoints are for DMC keys. A tour operator key gets 404: it sees the availability it is sold, never the DMC's stock sheet.
For the full request and response schemas, see the complete API Reference.
| What | Endpoint |
|---|---|
| Read a date range | GET /api/v3/hotels/{id}/allotments |
| Change a date range | PATCH /api/v3/hotels/{id}/allotments |
What a row is
One row is one room, for one organization, in one pool, on one night, under one rate:
- organization: the DMC itself, or a tour operator the DMC sells the contract period to (a dedicated allocation).
- shared:
truefor the DMC's shared pool, which only the DMC's rows have. - mealPlan and contractId: the rate. Most nights have one rate per room. A night sold under two (two meal plans, or an old and a new contract) gives two rows that differ only there.
- state:
allotment(countrooms left),free_sale,on_requestorstop_sale.countis0on any state butallotment. - releaseDays comes from the contract period and is read-only here.
You never send a row id: you name the room, the organization, the pool and the dates, and Koob finds the contract period.
Read a date range
GET /api/v3/hotels/{id}/allotments?startAt=2026-12-01&endAt=2026-12-02&rooms=5521
startAt and endAt are required and inclusive, at most 366 days apart counting both ends; otherwise 400 INVALID_STAY_DATES. Filter with rooms, organizations (repeat the parameter) and shared. Rows sort by date, room, organization, dedicated before shared, then contract.
{
"data": [
{
"date": "2026-12-01",
"state": "allotment",
"shared": false,
"count": 4,
"releaseDays": 14,
"room": { "id": "5521", "name": "Deluxe Garden View" },
"mealPlan": { "id": "3", "name": "Breakfast" },
"contractId": "1874",
"organization": { "id": "212", "name": "Lotus DMC" }
},
{
"date": "2026-12-01",
"state": "stop_sale",
"shared": false,
"count": 0,
"releaseDays": 14,
"room": { "id": "5521", "name": "Deluxe Garden View" },
"mealPlan": { "id": "3", "name": "Breakfast" },
"contractId": "1874",
"organization": { "id": "19", "name": "Wanderlust Tours" }
}
]
}Change a date range
PATCH /api/v3/hotels/{id}/allotments takes a list of range changes. Each one sets state — and with allotment, count — on every matching room-night:
{
"changes": [
{
"startAt": "2026-12-01",
"endAt": "2026-12-15",
"state": "stop_sale",
"weekdays": [6, 7],
"roomIds": ["5521", "5523"],
"organizationId": "19"
},
{
"startAt": "2027-01-01",
"endAt": "2027-01-31",
"state": "allotment",
"shared": true,
"count": 5,
"roomIds": ["5521"],
"organizationId": "212"
}
]
}The first change closes two rooms to one tour operator on December weekends (weekdays: 1 = Monday … 7 = Sunday; empty or absent = every day). The second puts 5 rooms in the DMC's shared pool for January. The answer is 200 with the days written, in the read shape.
state is always required. count is required with allotment and refused with any other state, and runs from 0 to 10,000.
Changes apply in order. Where two changes of one request cover the same room, organization, pool and night, the later one wins, without a warning. That lets you set a range, then carve exceptions out of it:
{
"changes": [
{
"startAt": "2027-02-01",
"endAt": "2027-02-28",
"state": "allotment",
"count": 4,
"roomIds": ["5521"],
"organizationId": "212"
},
{
"startAt": "2027-02-01",
"endAt": "2027-02-28",
"state": "stop_sale",
"weekdays": [7],
"roomIds": ["5521"],
"organizationId": "212"
}
]
}Every night of February sells 4 rooms, except Sundays, which are closed. Put the broad range first: in the other order the range would overwrite the Sundays.
All or nothing. Every change is checked before anything is written; one refused change writes nothing. A request may change at most 1,000 ranges and 50,000 room-nights in all.
Nights under two rates
A count is stock on one rate, so a count on a night two rates cover is refused with 409 ALLOTMENT_PERIOD_AMBIGUOUS until you name one with contractId or mealPlanId:
{
"name": "ConflictError",
"message": "Several contract periods cover these dates; send contractId or mealPlanId.",
"code": "ALLOTMENT_PERIOD_AMBIGUOUS",
"details": {
"roomId": "5521",
"dates": ["2027-01-10"],
"periods": [
{ "contractId": "1874", "mealPlan": { "id": "3", "name": "Breakfast" } },
{ "contractId": "1874", "mealPlan": { "id": "4", "name": "Half board" } }
]
},
"requestId": "5d0e2b77-91c4-4a3f-b0e8-3e6a1f2c9d10"
}A state change with no rate named (stop_sale, on_request, free_sale) goes to every rate covering the night: closing room 12 on 24 December closes it under every meal plan.
Errors
| Status | Code | When |
|---|---|---|
| 400 | ALLOTMENT_NO_PERIOD | No published contract period covers some nights of a room; details lists them. |
| 400 | INVALID_FILTER_VALUE | A room that is not the hotel's, an organization the period is not sold to, shared: true for a tour operator, or a count that does not match the state. |
| 400 | INVALID_STAY_DATES | A date that is not a real YYYY-MM-DD day (2026-02-30 included), an end before the start, or a range over 366 days. |
| 409 | ALLOTMENT_PERIOD_AMBIGUOUS | A count on a night two rates cover. |
| 409 | CONTRACT_PUBLISHING | A contract of the hotel is being published; retry once it is done. |