- Home
- API reference
- About
- Identifiers
Identifiers
The prefixes of Baiyar identifiers, and how to work with them.
Every object has an id that starts with a prefix for its type, then _, then 26 characters (lowercase letters and digits). For example pay_01k7q3m8x2v5t9n4b6c1d0e7fa.
ID prefixes
Section titled “ID prefixes”| Prefix | Object |
|---|---|
mer_ |
Merchant |
prj_ |
Project |
apk_ |
API key |
pay_ |
Payment |
lnk_ |
Payment link |
att_ |
Payment attempt |
inv_ |
Invoice |
whk_ |
Webhook endpoint |
wev_ |
Webhook event |
wdl_ |
Webhook delivery |
Work with identifiers
Section titled “Work with identifiers”Treat an id as an opaque string: store and compare the full value. Do not parse its length or the characters after the prefix. The prefix identifies the object type, and an ID is accepted only where that type is expected.
Create objects
Section titled “Create objects”You do not choose ids: they are in the answer of the request that makes the object, in data. Keep the id of a payment with your order.
{ "data": { "id": "pay_01k7q3m8x2v5t9n4b6c1d0e7fa", "status": "pending", "merchant_reference": "order-1001" }, "meta": { "request_id": "req_…" } }Get objects
Section titled “Get objects”Put the id in the path: GET /v1/payments/pay_01k7q3m8x2v5t9n4b6c1d0e7fa. To find a payment by your own reference instead, list with the filter merchant_reference.
Relate objects
Section titled “Relate objects”An object names the objects it belongs to by their ids: a payment has project_id, and payment_link_id when it was made through a link, and an event can be found by payment_id or payment_link_id.
GET /v1/events?payment_id=pay_01k7q3m8x2v5t9n4b6c1d0e7faSort by id
Section titled “Sort by id”An id is also its place in time: ids sort in the order the objects were made. Lists come newest first, and you page with the id of the last item you have (see Pagination).
Environments
Section titled “Environments”Ids have the same form in the sandbox and in live, but an object belongs to one environment only: a sandbox payment id is not found with a live key.