Staff endpoints
All routes below live under /api/poolinventory and need a staff user's API key. See the chapter overview for conventions — especially that writes are dry runs unless you send dryRun: false.
Endpoint overview
| Method & path | Permission | Purpose |
|---|---|---|
GET grid | read | Resort allocations by night. |
GET trips | read | Liveaboard allocations by trip and cabin type. |
PUT units | update | Write counts, prices, release days, pins. |
GET overbooked | read | Drill-down of an overbooked cell. |
POST restore | update | Restore and pin the allocation before the last lowering. |
POST ask-supplier | update | Mail the supplier a request for more units. |
GET search | read | Cross-asset availability search (staff view). |
POST import | create | Upload a file (multipart file). |
GET definitions, GET definitions/:id | read | Feed definitions. |
POST definitions / PUT definitions/:id / DELETE definitions/:id | create / update / delete | Manage definitions. |
POST definitions/sample | create | Read a sample file's columns and suggested mapping. |
POST definitions/:id/run | create | Fetch and run a URL definition now. |
GET runs, GET runs/:id | read | Run history and full reports. |
GET review, POST review/activate | read / update | Drafts created by feeds; activate them. |
POST mode/:type/:id | update | Switch an asset between rooms and pool. |
PATCH booking/:id/supplier, POST booking/:id/supplier/resend | bookings.update | Supplier confirmation and mails on a booking. |
Reading allocations
GET /api/poolinventory/grid — query from, days (1–62, default 14), q, country, city, definition, status (active | draft | all), page (default 1), size (resorts per page, default 50, max 100; a larger value is clamped). The response carries total (all matching resorts) and size (the page size used); page n starts at (n − 1) × size.
country takes a 2- or 3-letter ISO code (ID or IDN) or the English country name. It finds resorts stored with either code, in any letter case. A value that names no country matches nothing.
curl -H "Authorization: UserKey <userId>.guk_…" \
"https://YOUR-DOMAIN/api/poolinventory/grid?from=2027-03-12&days=14&q=Coral"Each asset carries its room types; each cell is one night:
{
"night": "2027-03-12",
"units": 5, "sold": 2, "free": 3,
"price": { "price": 145, "currency": "EUR" },
"pinned": false, "inRelease": false, "prevUnits": null
}totals.free[] and totals.alloc[] sum all filtered assets, not just the page.
GET /api/poolinventory/trips — query from, months (1–3), q, vessel, port, definition, status, page (default 1), size (vessels per page, default 50, max 100; a larger value is clamped). It pages by vessel: a vessel’s trips always come on one page. The response is { vessels, ports, total, size } — total counts the matching vessels after the port filter; ports lists the departure ports of all pages. With vessel set, page 1 holds that vessel. A trip cell has units, soldCabins, freeUnits, spots {male, female, any}, freeMale, freeFemale, lastSpot ("male" | "female" | null), price (per person), pinned, overbooked, and — when a supplier discount applies — specialPrice and specialName. soloPrice (the full single price for sole use of the cabin) is present only when the rate sheet has one.
Writing allocations
PUT /api/poolinventory/units takes up to 5,000 items and 50,000 cells (a resort item counts one cell per night). A resort item covers nights [from, to); a trip item one departure.
curl -X PUT -H "Authorization: UserKey <userId>.guk_…" -H "Content-Type: application/json" \
"https://YOUR-DOMAIN/api/poolinventory/units" \
-d '{
"dryRun": false,
"items": [
{ "asset": "<resortId>", "roomType": "<roomTypeId>", "from": "2027-03-12", "to": "2027-03-16",
"units": 7, "price": { "price": 145, "currency": "EUR" }, "pinned": true },
{ "schedule": "<scheduleId>", "roomType": "<cabinTypeId>", "units": 2, "spots": { "female": 1 } }
]
}'Response: { "changed": 5, "unchanged": 0, "overbooked": 0, "pinned": 4, "warnings": [], "dryRun": false }.
- Omit a field to keep it.
releaseDays: nullreturns to the asset default. - Pins only stop feeds; this endpoint writes pinned cells too.
- Lowering
unitsstores the old value forPOST restore. pricemust be positive; there is no "price 0". It writes the asset's feed-managed price list. A failed price write returns the warningPRICE_NOT_WRITTEN; units are still written.- Any bad item refuses the whole request:
400 POOL_UNITS_INVALIDwithindexandfield.
Searching
GET /api/poolinventory/search — type (Resort | Vessel), from, to, pax, flex (0–3), share, gender (male | female), country (2- or 3-letter ISO code or English name, as for the grid), city, port, priceMax.
Every line has sellable and, when not, a reason: NOT_SHAREABLE, FULL, PRICE_MISSING or RELEASE_PERIOD. Lines are ordered sellable first, then by reason (RELEASE_PERIOD, PRICE_MISSING, NOT_SHAREABLE, FULL), then cheapest first (specialPrice when present; no price last), then by name. Resort lines carry priceBasis: "night", price (the cheapest night's room price for min(pax, maxPax) guests), stayTotal (one unit) and, optionally, singlePrice: the cheapest night's room price for one guest. singlePrice is present only when maxPax > 1, the rate sheet has an explicit 1-pax tier on every night of the stay (no nearest-tier fallback, one currency), and it differs from the price at the room type's default occupancy (min(maxPax, defaultNoOfPax) — the grid cell's price), whatever pax was asked. Like price it is the rate-sheet amount: supplier discounts (specialPrice) apply to trips only. The public search line is the same shape, so it carries singlePrice too. When nothing is sellable, alternatives[] lists up to five nearby dates. Only active assets are searched. The public variant is described in Public search and booking.
Importing
POST /api/poolinventory/import?definition=<id>&dryRun=false with a multipart file (CSV, XLSX or JSON, max 10 MB, 50,000 rows, 200 columns). Without definition, Scubadates CSV and LiveaboardHub exports are recognised; the report then carries detected: { preset, assetType }.
curl -H "Authorization: UserKey <userId>.guk_…" \
-F "file=@laut-senja.csv" \
"https://YOUR-DOMAIN/api/poolinventory/import"The report:
{
"runNo": "RUN-0419", "status": "dry", "dryRun": true,
"window": { "from": "2027-03-01", "to": "2027-06-30" },
"counts": { "rows": 171, "assetsToCreate": 4, "typesToCreate": 21, "tripsToCreate": 171,
"changed": 668, "unchanged": 0, "pinnedSkipped": 0, "errors": 0, "warnings": 12,
"specialsCreated": 4, "specialsUpdated": 0, "specialsDeleted": 0, "portsToCreate": 0 },
"errors": [],
"warnings": [ { "code": "UNKNOWN_PORT", "message": "…", "value": "Labuan Bajo" } ],
"changes": [ { "label": "…", "dates": "…", "field": "units", "from": 0, "to": 2, "result": "change" } ]
}changeslistspricelines only for (room type, board) pairs whose rates changed. A feed price list whose content is unchanged is not rewritten, andupdated.rateSheetscounts only the sheets actually written.- An upload commit is all-or-nothing: any row error →
400 IMPORT_HAS_ERRORSwith the report inreport. POST definitions/:id/runapplies valid rows (status: "partial"). While another commit of the same definition runs →409 IMPORT_RUNNING.- Import errors put the reason in
detail, plusmissing[](MAPPING_INCOMPLETE),problems[](DEFINITION_INVALID,GROUP_PATTERN_INVALID),max(POOL_IMPORT_TOO_MANY_*) orrun(IMPORT_FAILED). Don't rely ondescription. GET runsreturns{ data, total }; list items carry counts and at most the first warning. Openruns/:idfor the full report.
Definitions
A definition's source.authHeader is write-only: responses show source.authSet and authSetAt. Omit it to keep it, send "" to clear it. A header needs an https:// URL, and changing the URL's host clears it. Repeating column groups go in groups:
{ "groups": { "cabins": { "roomType": "cabin{n}_name", "units": "cabin{n}_available_total",
"price": "cabin{n}_price" } } }Switching inventory mode
POST /api/poolinventory/mode/resort/<id> (or vessel) with { "mode": "pool", "dryRun": true } returns what blocks and what will happen:
{ "blocked": [ { "code": "FUTURE_BOOKINGS_ON_ROOMS", "count": 2 } ],
"after": [ "ROOMS_ARCHIVED", "ROOM_TYPES_TO_POOL", "SUPPLIER_PANEL" ] }Blocker codes: FUTURE_BOOKINGS_ON_ROOMS, ACTIVE_ROOM_LOCKS, CHANNEL_MAPPING_ACTIVE, ACTIVE_ALLOTMENTS, FUTURE_BOOKINGS_ON_POOL. Send "dryRun": false to switch; with blockers you get 400 INVENTORY_MODE_BLOCKED.
The asset's inventoryMode can't be changed through the resort or vessel endpoints (400 INVENTORY_MODE_CHANGE_VIA_ENDPOINT). The asset's pool object — releaseDays, supplier { name, emails[], phone, mailLanguage } — is saved with the asset as usual.
Pool bookings
Create pool bookings with the normal booking API (POST /api/bookings). Each room line points at the asset's pool room for the type (the poolRoom id from search); one line is one unit.
"room": [
{ "room": "<poolRoomId>", "date": { "from": "…", "to": "…" }, "locked": true, "customer": ["<id>", "<id>"] },
{ "room": "<poolRoomId>", "date": { "from": "…", "to": "…" }, "locked": false, "customer": ["<id>"], "gender": "female" }
]locked: truebooks a whole unit;locked: falsewith one guest books a shared bed (liveaboards). The guest's stored gender wins;genderis the fallback.- Inside the release period, a user with
poolinventory.overrideadds"poolOverride": { "reason": "Supplier agreed by phone", "supplierConfirmationPromised": true }. - Refusals:
QTY_EXCEEDS_FREE,PRICE_MISSING,RELEASE_PERIOD,GENDER_REQUIRED_FOR_SHARED,POOL_ASSET_NOT_ACTIVE(400),INVENTORY_BUSY(409, retry). Staff get details, e.g.{ "message": "QTY_EXCEEDS_FREE", "roomType": "…", "night": "2027-03-14", "free": 1, "requested": 2, "unit": "units" }.
Supplier fields on the booking (staff only; agency and customer responses never include them): supplierRef, supplierConfirmed, supplierConfirmedAt, supplierConfirmedBy, supplierNotifications[] (type, at, to[], status queued | sent | failed | opened), poolOverrides[]. Change them only through:
curl -X PATCH -H "Authorization: UserKey <userId>.guk_…" -H "Content-Type: application/json" \
"https://YOUR-DOMAIN/api/poolinventory/booking/<bookingId>/supplier" \
-d '{ "supplierRef": "CGL-55812", "supplierConfirmed": true }'POST booking/:id/supplier/resend sends the last supplier mail again.
