Quickstart
Issue your first invoice on the sandbox in about ten minutes, with an API key and curl.
Before you start
- Sign in to the Yona app at app.useyona.com and open API keys.
- Create a sandbox key with the invoicing preset. It starts with
sk_test_and is shown once; copy it now. - Every request below goes to
https://gp.useyona.comwith the key as a Bearer token. The key decides the environment:sk_test_keys use the sandbox,sk_live_keys the live service. The URL never changes.
Sandbox submissions go to the authority’s test system under Yona’s own test taxpayer, so you can submit before you connect your business. Live submissions need your own connection and crypto key; see Tax connection.
Step 1: Add a buyer
The response is 201 with the buyer in data. Keep data.id. For an individual, leave out taxId and send "partyType": "individual".
Step 2: Create an invoice
The response is 201 with a draft invoice. Keep data.id. Notes on the fields:
invoiceKindis required:B2B,B2C,B2GorG2B.- Amounts are in major units, as decimal strings or numbers. Totals and tax are computed for you.
taxCategorytakesstandard,zeroorexempt, or a tax-category code from Reference data.- Goods carry an
hsnCode; services carry anisicCodeinstead. invoiceNumberis allocated when you leave it out.
Step 3: Submit it
finalise=true finalises the draft and submits it in one step. The response is 202 Accepted: the submission is queued, signed and handed to the authority. Reporting an invoice uses credits; if the balance is short the answer is 402 with BIZ001, and nothing is sent.
Step 4: Watch it get registered
Poll every few seconds. On the sandbox the authority’s test system usually answers within seconds. The fields to watch, abbreviated:
{
"data": {
"id": "INVOICE_ID",
"status": "finalised",
"simpleStatus": "reported",
"reportedToNrs": true,
"irn": "INV00042-94ND90NR-20261001"
}
}simpleStatus moves from issued to reported when the authority registers the invoice, and to delivered when the buyer’s access point confirms receipt. The full response shape is in Invoices.
To download the signed PDF: GET /i/v1/invoices/INVOICE_ID/download.
Next steps
- Webhooks: be told when an invoice is registered, delivered or rejected, instead of polling.
- Tax connection: connect your business to the authority before going live.
- Going live: what changes with a live key.
- API Reference: every endpoint, generated from the API itself.