# Ids

The API uses two kinds of ids. An integer id never appears in a URL, a
payload or an error.

| Object                                                                                             | Id                                                               | Example                      |
| -------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------- |
| Organizations, companies, files, users, API keys                                                   | A **sqid**: lowercase letters and digits, at least 10 characters | `k3x9m2p7qa`                 |
| The objects of the books: invoices, parties, bank transactions, entries, periods, document records | A **ULID**: 26 characters, as the books issue it                 | `01J9Z3Q4X5V6W7Y8Z9A0B1C2D3` |

- Treat every id as an opaque string. Do not parse it, and do not build one.
- Compare ids as they are. A ULID is upper case, a sqid is lower case.
- A path segment that is not a valid id of the right kind gets 404
  `not_found`, the same answer as an id that does not exist.
- An id in a query filter that the books do not have gets 400 on that
  parameter.

## Other values

- **Money** is an integer amount in minor units (cents), with its currency
  code. `12345` in `EUR` is 123.45 euro. A float never crosses the API.
- **Rates and quantities** are decimal strings, for example `"0.24"`.
- **Dates** are ISO `YYYY-MM-DD`.
- **Timestamps** are ISO 8601, in UTC.
