---
title: "Dates, money, pagination and idempotency | Hostemi"
description: "Nights and date ranges, amounts in minor units per currency, cursors, and repeating a write safely with Idempotency-Key."
canonical: https://hostemi.com/docs/api/conventions
source: https://hostemi.com/docs/api/conventions.md
---

# Dates, money, pagination and idempotency

Nights and date ranges, amounts in minor units per currency, cursors, and repeating a write safely with Idempotency-Key.

#### On this page

1. [Dates and nights](#dates-and-nights)
2. [Money in minor units](#money-in-minor-units)
3. [Pagination](#pagination)
4. [Idempotency](#idempotency)
5. [Ids](#ids)

## 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's `departureDate` is the morning the guest leaves: it is not a night of the stay. A block's `lastNight` is included.
- Weekdays you send are `1` (Monday) to `7` (Sunday), as in the CLI and the MCP tools; `0` is still read as Sunday. In answers, a season's `weekdays` count `0` (Sunday) to `6` (Saturday); `checkInWeekdays` / `checkOutWeekdays` are 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.

```bash
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`.

Documentation pages

Something missing from this page? Write to [hello@hostemi.com](mailto:hello@hostemi.com), or use the form on the [Help](https://hostemi.com/help) page.
