Amounts and limits
Amounts and rounding
Send amounts in naira, as a number or a decimal string. The decimal places each field takes:
| Field | Decimal places |
|---|---|
quantity | Up to 6 |
unitPrice | Up to 4 |
| Discounts, fees, allowances and charges | Up to 2 |
A value with more decimal places is refused, never rounded for you.
Yona works out every figure:
- Each line: quantity × unit price, rounded half up to the kobo. The line’s tax is worked out on its net amount and rounded half up to the kobo.
- The invoice totals are the sums of the rounded lines. They are never rounded again.
- Tax rates come from Yona’s tax categories. A rate or total sent in the request is refused.
Responses give money in kobo, in fields that end in Minor. Yona sends the tax authority the same figures, in naira with 2 decimal places.
Limits
| Limit | Value |
|---|---|
| Request body | 1,048,576 bytes (1 MiB), counted on the whole body. A larger request is answered 413 with errorCode VAL021. |
| Lines on one invoice | 1 to 500 |
| A quantity, unit price or amount | At most 1,000,000,000,000 (one trillion naira). A larger value, or totals past the supported range, is a 400. |
Requests per second and per minute are on Rate limits.
Repeating a request safely
Send an Idempotency-Key header on a write you may need to repeat, such as creating, submitting or cancelling an invoice:
- The key: 8 to 128 characters: letters, digits,
_or-. A key applies to one organization and one operation. - The same key and the same body answer the first result, with the header
Idempotent-Replayed: true. Nothing is done or charged again. - The same key with a different body is refused with
409anderrorCodeBIZ107. - A key is remembered for 7 days. After that the same key counts as new.
- A request Yona refuses keeps no key, so you can correct it and send it again with the same key.
To send a corrected invoice after it was accepted, use a new key.
Fields
- Only the fields the API reference lists are accepted. Any other field is refused with
400anderrorCodeVAL001, naming the field. The API has no field for your own data. notes(up to 2,000 characters) is printed on the invoice and sent to the tax authority as its note.
Invoice type and IRN
You never send an invoice type code or an IRN. Yona sets the code for each document (381 for an invoice, 380 for a credit note, 384 for a debit note) and creates the IRN when the invoice is submitted. The tax authority’s code lists are at GET /i/v1/invoices/resources.