# Identifiers

Every object is identified by its `token`. Use it wherever you refer
to the object: in a URL, in a request field, as a pagination cursor.
Fields that refer to another object carry that object's token too: a
refund's `reference_transaction_id` is the original transaction's
token, and an order's `customer` is the customer's token. Dime's
database ids are never returned and are not accepted: a request field
sent an id is rejected with `400`, and an id in a URL matches nothing
and returns `404`.
Every token starts with a three-letter code for the kind of object,
then `_`. Orders, invoices and transactions have a 20-character token
that carries the day the object was created (in Jamaica), then seven
random characters, for example `ord_20261112_V1StGXR`,
`inv_20261112_x9-qLm3` or `txn_20261112_Bx87TxQ`.
Every other object has a 38-character token: the code, then 31 random
characters in groups of 8, 8, 8 and 7, every part separated by `_`, for
example `cus_V1StGXR8_Z5jdHi6B_myT2x9Kq_Lm3P-Rt`. Random characters are
letters, digits and `-`; `_` only ever separates parts.
Tokens issued earlier keep their shape and stay valid, for example
orders with five random characters (`ord_20261112_V1StG`) and
38-character transaction tokens. Store tokens as opaque strings; do not
parse them or assume a length.
| Code | Object |
|  --- | --- |
| `ord` | Order |
| `txn` | Transaction |
| `sub` | Subscription |
| `cus` | Customer |
| `inv` | Invoice |
| `prd` | Product |
| `cat` | Category |
| `lnk` | Payment link |
| `crq` | Tokenization request |
| `crd` | Card |
| `chb` | Chargeback |
| `bac` | Bank account |
| `btf` | Bank transfer |
| `wal` | Wallet |
| `hep` | Webhook endpoint |
| `whe` | Webhook event |
| `brq` | Bridge request |
| `brm` | Linked merchant (Dime Bridge) |
| `btr` | Bridge transfer |

Objects created before this format keep the token they were given,
which is shorter and shaped differently (`ob9gWGGx5ACvn6KU`,
`INVUx6KQoFDuY`, `c_3f8a1e029c4d4b71a5e36`). Those tokens stay valid.
Keep tokens as opaque strings of up to 64 characters, and do not
work out an object's kind or age from the shape of its token.
Your merchant is named by its merchant token, for example
`m82yalYupLIdpAz`.
A Bridge link has no token: its only identifier is the secret in its
one-time `url`.
Some requests take an identifier of your own, such as the `id` you
send when creating an order. Those are yours, not Dime's: they are
stored and returned exactly as you sent them (an order's `reference`,
the `origin_id` filter).

