Dates, money, pagination and idempotency
Nights and date ranges, amounts in minor units per currency, cursors, and repeating a write safely with Idempotency-Key.
Dates and nights
- Dates are
YYYY-MM-DD, in the property's time zone. Times are ISO 8601 in UTC. - A range of nights (
from,to) includes both ends. A booking'sdepartureDateis the morning the guest leaves: it is not a night of the stay. A block'slastNightis included. - Weekdays you send are
1(Monday) to7(Sunday), as in the CLI and the MCP tools;0is still read as Sunday. In answers, a season'sweekdayscount0(Sunday) to6(Saturday);checkInWeekdays/checkOutWeekdaysare seven switches, Monday first.
Money in minor units
Every amount ending in Minor is an integer in the smallest unit of its currency (ISO 4217), and the currency is on the same record or its property. Send amounts the same way, as integers.
| Currency | Decimals | Example |
|---|---|---|
| EUR | 2 | 12345 = €123.45 |
| HUF | 2 | 4500000 = 45,000 Ft |
| JPY | 0 | 15000 = ¥15,000 |
| KWD | 3 | 10500 = KWD 10.500 |
The decimals per currency are ISO 4217's; the server's table and every copy in the apps are held to each other by a test. The MCP host tools are the exception: they take { amount: "123.45", currency: "EUR" }.
Pagination
A list that pages takes take (the page size; the maximum, 100 or 200, is in the OpenAPI document) and cursor, and answers the next cursor, which is null on the last page. Lists that are small by nature (properties, listings) do not page.
curl -s "$API/threads?take=50" -H "Authorization: $HOSTEMI_KEY" # { "threads": [ … ], "cursor": "…" }
curl -s "$API/threads?take=50&cursor=…" -H "Authorization: $HOSTEMI_KEY"Idempotency
Writes accept an Idempotency-Key header (any unique string you choose). Repeating the same call with the same key within 24 hours returns the first answer instead of writing twice.
| Case | Answer |
|---|---|
| Same key, same request, done | The first answer, again. |
| Same key, first call still running | 409 "… still being processed. Wait, then retry the same key." |
| Same key, different request | 409 "This Idempotency-Key was already used for a different request. Use a new key; keys last 24 hours." |
A change stored for the host keeps its key, so the approved replay does not run twice either.
Ids
Ids are opaque strings (cmwhux6y60026somfhixjmcm8); never parse them. A listing is a unit in the API, a booking a reservation, a connected platform a connection, a conversation a thread.