Skip to Content
API Reference

API Reference

The Yona API is a REST API with JSON bodies. These pages are generated from the API’s own OpenAPI document, so they describe what the API serves. You can download the document at /openapi.json.

Base URL

https://gp.useyona.com

Sandbox and live use the same host. The API key chooses: sk_test_ keys reach the sandbox, sk_live_ keys the live service.

Authentication

Send your API key as a Bearer token:

Authorization: Bearer sk_test_your_key_here

The x-api-key header is refused (401, AUTH040). Keys are created in the Yona app under API keys, with one of five presets (read_only, invoicing, full_integration, payments_read, full_integration_payments) or an explicit list of capabilities; Authentication lists what each preset holds. A request that needs a capability the key lacks is answered 403 with AUTH019.

Some operations are for signed-in users only, such as creating API keys, connecting to the tax authority and registering webhook endpoints. Each page says so next to the operation; a key gets 403 with AUTH018 there.

Services and prefixes

PrefixWhat lives there
/i/v1Invoices, buyers, items, tax connection, received invoices, reference data
/b/v1Billing: plans, balance, transactions, payments, sandbox credits
/a/v1Organization, members, invitations, roles, API keys
/n/v1Webhooks: endpoints, deliveries, events

Response envelope

Every response carries meta and data. meta.requestId identifies the request in our logs; quote it when you contact support.

{ "meta": { "statusCode": 200, "success": true, "message": "Success", "errors": [], "timestamp": "2026-10-01T10:00:00.000Z", "requestId": "01K6P3Z0X7Q4N2M8R9V1T5B3Y7" }, "data": { } }

A list adds meta.pagination with total, page, pageSize, totalPages, hasNext and hasPrevious; see Pagination.

An error puts the code in meta.errorCode and the detail in meta.errors. For a validation failure, errors is a list of { "field": "message" } pairs:

{ "meta": { "statusCode": 400, "success": false, "message": "Validation failed", "errorCode": "VAL001", "errors": [{ "invoiceKind": "must be one of B2B, B2C, B2G, G2B" }], "timestamp": "2026-10-01T10:00:00.000Z", "requestId": "01K6P3Z0X7Q4N2M8R9V1T5B3Y7" }, "data": null }

A resource that belongs to another organization is answered exactly like one that does not exist: 404 with RES001.

Error codes you will meet

CodeStatusMeaning
AUTH004401No usable token on the request
AUTH003401The value after Bearer is not a well-formed key or token
AUTH040401The key was not sent as Authorization: Bearer: an x-api-key header (refused on every operation), or another scheme
AUTH021401The API key is not valid
AUTH022401The API key has expired
AUTH041401The API key was revoked
VAL023400Two Authorization headers, or one longer than 8,192 bytes
AUTH018403This operation is for signed-in users, not API keys
AUTH019403The key lacks a capability the operation needs
AUTH005403Forbidden
BIZ006403The organization is not approved for live access
BIZ005403Live mode is switched off
BIZ108403The request names a mode the key cannot act in, such as a sk_live_ key reading the sandbox ledger
VAL001400Validation failed; see meta.errors
VAL002400A required field is missing
VAL021413The body is too large
BIZ001402Not enough credits; nothing was done
RES001404Not found, or not yours
RES002409It already exists
RES003409If-Match did not match the current version
BIZ004409The resource is not in a state that allows this
BIZ201409The invoice is not in a state that allows this
BIZ205409Additional sellers are not available; the organization is the seller
BIZ107409The same Idempotency-Key was reused with a different request
SYS005429Too many requests; wait for Retry-After
SYS001500, 502, 503, 504Something failed on our side; quote meta.requestId

Server errors

Every 5xx answers SYS001, whatever failed: the code never says more, and no detail of the failure is in the body. Branch on the status. A 502, 503 or 504 is temporary: retry after a pause, honouring Retry-After when it is sent. If a 500 repeats, contact support with meta.requestId.

The one addition a 5xx may carry is a { "reason": "…" } entry after the SYS001 entry in meta.errors, from a short fixed list, for a fault that retrying soon will not fix. Treat a reason you do not recognise like any other 5xx.

Rate limits

Limits are per API key: 150 requests per second in bursts and 1,800 per minute sustained, plus per-operation limits on the heavier calls, such as 360 invoice writes and 60 submissions per minute; Rate limits lists them. A refused request is 429 with SYS005, a Retry-After header in seconds, and X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset.

Idempotency

Where an operation lists an Idempotency-Key header, send a value of your own, 8 to 128 characters of letters, digits, _ or -, unique per logical request, and send the same value on every retry of that request. The same key with the same request answers the first result: nothing is done or charged again, and the operations that say so mark the answer replayed: true. The same key with a different request is refused with 409 and BIZ107, and a malformed key with 400 and VAL001. Each operation’s page says what its key covers.