API conventions used across the Paper.id Open API: authentication, request/response rules, pagination, idempotency and versioning.
Authentication
Send your client credentials on every request, over HTTPS only:
client_id: $PAPER_CLIENT_ID
client_secret: $PAPER_CLIENT_SECRET
Header names contain underscores (client_id, client_secret). Some API gateways drop headers with underscores by default — if calls fail with 401 behind a proxy, check the header names first.
Requests and responses
| Rule | Convention |
|---|---|
| Field names | snake_case everywhere: body, query, path and callbacks. |
| IDs | id is Paper.id's UUID for the returned object; <object>_id (e.g. partner_id, invoice_id) refers to another object. Your own references use *_number or reference_id/ref_id. |
| Dates | YYYY-MM-DD, for example 2026-11-14. |
| Timestamps | ISO 8601 with offset, for example 2026-11-14T08:20:00+07:00; fields end in _at. |
| Money | Number in IDR, for example 3000000 for Rp3.000.000. |
| Status values | Lowercase snake_case strings: partially_paid, never integers. |
| Booleans | true / false, named is_* for flags. Never 0 / 1. |
| Phone numbers | Digits only, country code 62 prefix, no +: 6281234567890. |
| Paths | Plural nouns, standard verbs: GET read, POST create or action, PUT replace, DELETE remove. |
| Success body | JSON body. The HTTP status carries the result; it is not repeated in the body. |
| Errors | Structured error body with message — see Errors. |
Pagination
List endpoints support limit (default 10, maximum 100) and offset. Sort with sort=<field> and order=asc|desc. Date-range filters use start_* / end_* query parameters, both inclusive.
Idempotency
Create requests accept an Idempotency-Key header. Use a new UUID per business action and reuse it when you retry after a timeout. Within 24 hours the same key returns the original response; the same key with a different body returns 409.
Versioning
The version is in the path (/api/v1, /api/v2). Adding optional fields, new endpoints or new enum values is not a breaking change, so ignore fields you don't know. Breaking changes ship in a new version, announced in the Changelog.