Skip to Content

Invoices

List invoices

GET /i/v1/invoices

Requires invoice.read. The organisation’s invoices, credit notes and debit notes in the token’s mode, filtered and sorted by the query; newest first by default. List items carry no lineItems.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
statusquerystringNoOne of draft | finalised | queued | signed | transmitted | accepted | rejected | failed | cancellation_pending | cancelled.
invoiceTypequerystringNoOne of standard | credit_note | debit_note.
paymentStatusquerystringNoOne of unpaid | partially_paid | paid | payment_failed.
currencyquerystringNo
buyerIdquerystring (uuid)No
sellerIdquerystring (uuid)NoOnly the organisation’s own seller id.
createdByquerystring (uuid)NoOnly documents created by this actor id (createdBy.id): an auth user id, or an API-key id with createdByType=api_key.
createdByTypequerystringNoOnly documents created by this kind of actor (createdBy.type). One of user | api_key | service | system.
invoiceDateFromquerystringNo
invoiceDateToquerystringNo
dueDateFromquerystringNo
dueDateToquerystringNo
createdAtFromquerystringNo
createdAtToquerystringNoExclusive.
searchquerystringNoMatches the document number, the number NRS holds or the IRN by prefix, and the buyer name or TIN anywhere in it. Case-insensitive; % and _ are plain characters. At most 100 characters.
simpleStatusquerystringNoOnly documents with this simple status (simpleStatus). One of draft | issued | reported | delivered | paid | part_paid | cancelled.
reportingquerystringNoOnly documents at this reporting stage, as the summary cards count them (needs_attention = rejected or on hold, not cancelled). One of draft | not_reported | in_progress | reported | needs_attention.
deliveryquerystringNoOnly documents with this delivery channel (reporting.delivery). One of nrs | deliver_to_buyer | sent_email | shared_link | none.
creditedquerystringNotrue: documents credited by a credit note that counts against them; false: invoices no credit note credits. One of true | false.
refundOwedquerystringNotrue: documents on which a refund is still owed to the buyer; false: documents on which none is. One of true | false.
overduequerystringNoOnly issued invoices still owing (net of credit notes) past their due date today. One of true.
amountFromMinorquerynumberNoPayable amount at least this (minor units). At least 0.
amountToMinorquerynumberNoPayable amount at most this (minor units). At least 0.
pagequerynumberNoDefault: 1. At least 1.
limitquerynumberNoDefault: 20. Between 1 and 100.
sortByquerystringNoOne of createdAt | invoiceDate | invoiceNumber | payableMinor | dueDate | taxMinor. Default: createdAt.
sortOrderquerystringNoOne of ASC | DESC. Default: DESC.

Example request

bash
curl https://gp.useyona.com/i/v1/invoices \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

One page of documents (without lineItems), meta.pagination set.


Create a draft invoice

POST /i/v1/invoices

Requires invoice.create; charged as one invoice creation. Creates a draft (status: draft); the number is allocated from the series when invoiceNumber is omitted. Send an Idempotency-Key to make a retry safe: a repeated key answers the first result with Idempotent-Replayed: true. The ETag header carries the invoice version.

Who can call it: API key or signed-in user.

Request body

FieldTypeRequiredDescription
sellerIdstring (uuid)NoOnly the organisation’s own seller id.
buyerIdstring (uuid)No
invoiceKindstringYesA kind of the jurisdiction (Nigeria: B2B, B2C, B2G, G2B).
invoiceNumberstringNoAlphanumeric, 1–50; allocated when absent.
invoiceTypestringNoOnly standard: credit and debit notes are issued against an invoice (cancel, credit-notes, debit-notes). One of standard.
invoiceDatestringYesThe issue date.
issueTimestringNo
dueDatestringNo≥ the issue date.
currencystringYes
lineItemsarray of InvoiceLineItemYes1 to 500 items.
allowanceAmountstring or numberNoDocument allowance, major units, ≤ 2 decimals.
chargeAmountstring or numberNoDocument charge, major units, ≤ 2 decimals.
paymentTermsstringNoAt most 500 characters.
notesstringNoAt most 2000 characters.
purchaseOrderReferencestringNoAt most 100 characters.
buyerReferencestringNoAt most 100 characters.
accountingCoststringNoAt most 100 characters.

lineItems[]

FieldTypeRequiredDescription
itemIdstring (uuid)NoA saved item of the organisation: every field of the line left out is filled from the item, and a field sent wins.
descriptionstringNoRequired without an itemId. 1 to 500 characters.
itemNamestringNoAt most 255 characters.
hsnCodestringNoHS code (goods).
productCategorystringNoThe HS description (goods). At most 500 characters.
isicCodestringNoISIC code (services); stored as the service code.
serviceCategorystringNoThe ISIC description (services). Stored as the line’s product category; send it or productCategory, not both. At most 500 characters.
quantitystring or numberYesDecimal string (≤ 6 decimals) or number; > 0.
unitCodestringNoA unit code of the jurisdiction’s list. Required without an itemId.
unitPricestring or numberNoMajor units, decimal string (≤ 4 decimals) or number; ≥ 0. Required without an itemId.
discountAmountstring or numberNoMajor units, ≤ 2 decimals.
feeAmountstring or numberNoMajor units, ≤ 2 decimals.
taxCategorystringNoA tax-category code-list id, or a short alias (standard | zero | exempt). Required without an itemId.

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/invoices \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "invoiceKind": "B2B",
    "invoiceNumber": "INV00042",
    "invoiceDate": "2026-09-30",
    "issueTime": "14:30:00",
    "dueDate": "2026-10-30",
    "currency": "NGN",
    "lineItems": [
      {
        "description": "Consulting services",
        "hsnCode": "1006.30",
        "isicCode": "0112",
        "quantity": "2.5",
        "unitCode": "EA",
        "unitPrice": "50000.00",
        "discountAmount": "0",
        "feeAmount": "0",
        "taxCategory": "STANDARD_VAT"
      }
    ],
    "allowanceAmount": "0",
    "chargeAmount": "0"
  }'

Responses

The draft.


Get an invoice

GET /i/v1/invoices/{id}

Requires invoice.read. One document with its lines. A document of another organisation or of the other mode answers 404 RES001, like a missing one. The ETag header carries the invoice version.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Example request

bash
curl https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210 \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses


Update a draft invoice

PATCH /i/v1/invoices/{id}

Requires invoice.update_draft. Drafts only (409 BIZ201 otherwise). An absent field is unchanged; null clears an optional one; lineItems replaces every line. If-Match: "<version>" is optional; a stale version answers 409 RES003. The ETag header carries the invoice version.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Request body

FieldTypeRequiredDescription
sellerIdstring (uuid)No
buyerIdstring (uuid) or nullNonull removes the buyer.
invoiceKindstringNo
invoiceNumberstringNo
invoiceDatestringNo
issueTimestring or nullNo
dueDatestring or nullNo
currencystringNo
lineItemsarray of InvoiceLineItemNo
allowanceAmountstring or number or nullNoDocument allowance, major units, ≤ 2 decimals.
chargeAmountstring or number or nullNoDocument charge, major units, ≤ 2 decimals.
paymentTermsstring or nullNoAt most 500 characters.
notesstring or nullNoAt most 2000 characters.
purchaseOrderReferencestring or nullNoAt most 100 characters.
buyerReferencestring or nullNoAt most 100 characters.
accountingCoststring or nullNoAt most 100 characters.

lineItems[]

FieldTypeRequiredDescription
itemIdstring (uuid)NoA saved item of the organisation: every field of the line left out is filled from the item, and a field sent wins.
descriptionstringNoRequired without an itemId. 1 to 500 characters.
itemNamestringNoAt most 255 characters.
hsnCodestringNoHS code (goods).
productCategorystringNoThe HS description (goods). At most 500 characters.
isicCodestringNoISIC code (services); stored as the service code.
serviceCategorystringNoThe ISIC description (services). Stored as the line’s product category; send it or productCategory, not both. At most 500 characters.
quantitystring or numberYesDecimal string (≤ 6 decimals) or number; > 0.
unitCodestringNoA unit code of the jurisdiction’s list. Required without an itemId.
unitPricestring or numberNoMajor units, decimal string (≤ 4 decimals) or number; ≥ 0. Required without an itemId.
discountAmountstring or numberNoMajor units, ≤ 2 decimals.
feeAmountstring or numberNoMajor units, ≤ 2 decimals.
taxCategorystringNoA tax-category code-list id, or a short alias (standard | zero | exempt). Required without an itemId.

Example request

bash
curl -X PATCH https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210 \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "invoiceKind": "B2C",
    "invoiceNumber": "INV00042",
    "invoiceDate": "2026-09-30",
    "issueTime": "14:30:00",
    "dueDate": "2026-10-30",
    "currency": "NGN"
  }'

Responses

The updated draft.


Delete a draft invoice

DELETE /i/v1/invoices/{id}

Requires invoice.delete_draft. Drafts only; the draft is deleted permanently and its number is never reused.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Example request

bash
curl -X DELETE https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210 \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses


Submit several invoices

POST /i/v1/invoices/batch-submit

Requires invoice.submit. Submits 1 to 100 invoices, each independently (its own charge and outcome); the batch counts once against the rate limit. Per-invoice results say which were queued and which failed.

Who can call it: API key or signed-in user.

Request body

FieldTypeRequiredDescription
invoiceIdsarray of string (uuid)Yes1 to 100 items.

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/invoices/batch-submit \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "invoiceIds": [
      "9f8e7d6c-5b4a-3210-fedc-ba9876543210"
    ]
  }'

Responses


List previously used HS or service codes

GET /i/v1/invoices/codes/used

item.read. type=goods reads the lines’ HS codes, type=service their service codes, over the organisation’s invoices in the token’s mode, every status (drafts and cancelled count). Most used first, then most recent; description is the most recent line’s product category for the code. This reads your own invoices, not the tax authority’s code lists.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
typequerystringYesgoods → HS codes; service → service codes. One of goods | service.
limitquerynumberNoDefault: 20. Between 1 and 100.

Example request

bash
curl "https://gp.useyona.com/i/v1/invoices/codes/used?type=goods" \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

The codes, at most limit (default 20).

Errors: 400, 401, 403, 429


Create an invoice and submit it

POST /i/v1/invoices/create-and-submit

Requires invoice.create and invoice.submit. Creates the invoice as POST /invoices does, then submits it. When the submit is refused the draft is kept and submitRefusal says why. Accepts an Idempotency-Key.

Who can call it: API key or signed-in user.

Request body

FieldTypeRequiredDescription
sellerIdstring (uuid)NoOnly the organisation’s own seller id.
buyerIdstring (uuid)No
invoiceKindstringYesA kind of the jurisdiction (Nigeria: B2B, B2C, B2G, G2B).
invoiceNumberstringNoAlphanumeric, 1–50; allocated when absent.
invoiceTypestringNoOnly standard: credit and debit notes are issued against an invoice (cancel, credit-notes, debit-notes). One of standard.
invoiceDatestringYesThe issue date.
issueTimestringNo
dueDatestringNo≥ the issue date.
currencystringYes
lineItemsarray of InvoiceLineItemYes1 to 500 items.
allowanceAmountstring or numberNoDocument allowance, major units, ≤ 2 decimals.
chargeAmountstring or numberNoDocument charge, major units, ≤ 2 decimals.
paymentTermsstringNoAt most 500 characters.
notesstringNoAt most 2000 characters.
purchaseOrderReferencestringNoAt most 100 characters.
buyerReferencestringNoAt most 100 characters.
accountingCoststringNoAt most 100 characters.

lineItems[]

FieldTypeRequiredDescription
itemIdstring (uuid)NoA saved item of the organisation: every field of the line left out is filled from the item, and a field sent wins.
descriptionstringNoRequired without an itemId. 1 to 500 characters.
itemNamestringNoAt most 255 characters.
hsnCodestringNoHS code (goods).
productCategorystringNoThe HS description (goods). At most 500 characters.
isicCodestringNoISIC code (services); stored as the service code.
serviceCategorystringNoThe ISIC description (services). Stored as the line’s product category; send it or productCategory, not both. At most 500 characters.
quantitystring or numberYesDecimal string (≤ 6 decimals) or number; > 0.
unitCodestringNoA unit code of the jurisdiction’s list. Required without an itemId.
unitPricestring or numberNoMajor units, decimal string (≤ 4 decimals) or number; ≥ 0. Required without an itemId.
discountAmountstring or numberNoMajor units, ≤ 2 decimals.
feeAmountstring or numberNoMajor units, ≤ 2 decimals.
taxCategorystringNoA tax-category code-list id, or a short alias (standard | zero | exempt). Required without an itemId.

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/invoices/create-and-submit \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "invoiceKind": "B2B",
    "invoiceNumber": "INV00042",
    "invoiceDate": "2026-09-30",
    "issueTime": "14:30:00",
    "dueDate": "2026-10-30",
    "currency": "NGN",
    "lineItems": [
      {
        "description": "Consulting services",
        "hsnCode": "1006.30",
        "isicCode": "0112",
        "quantity": "2.5",
        "unitCode": "EA",
        "unitPrice": "50000.00",
        "discountAmount": "0",
        "feeAmount": "0",
        "taxCategory": "STANDARD_VAT"
      }
    ],
    "allowanceAmount": "0",
    "chargeAmount": "0"
  }'

Responses


Get the invoicing dashboard overview

GET /i/v1/invoices/overview

Requires invoice.stats.read. Key figures over the last windowDays compared with the window before, the daily trend, status and payment distribution, collections, alerts, readiness and the most recent documents.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
windowDaysquerynumberNoDefault: 7. Between 1 and 90.

Example request

bash
curl https://gp.useyona.com/i/v1/invoices/overview \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses


Get the reference data for the invoice form

GET /i/v1/invoices/setup

Requires invoice.read. Currencies, invoice kinds, tax categories with their current rates, unit codes, the tax connection state, and the next invoice number (a preview, not reserved).

Who can call it: API key or signed-in user.

Example request

bash
curl https://gp.useyona.com/i/v1/invoices/setup \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses


Get invoice statistics

GET /i/v1/invoices/statistics

Requires invoice.stats.read. Over documents created in the window (default the last 30 days, at most 366): counts by status and by payment status, the success rate, totals by currency, and output tax.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
fromquerystringNo
toquerystringNoExclusive.

Example request

bash
curl https://gp.useyona.com/i/v1/invoices/statistics \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses


Summarise the documents a list filter selects

GET /i/v1/invoices/summary

Requires invoice.stats.read. Takes the list’s filters (no paging or sorting) and counts the documents they select by reporting stage, with the money still owed (net of credit notes) and its overdue part per currency.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
statusquerystringNoOne of draft | finalised | queued | signed | transmitted | accepted | rejected | failed | cancellation_pending | cancelled.
invoiceTypequerystringNoOne of standard | credit_note | debit_note.
paymentStatusquerystringNoOne of unpaid | partially_paid | paid | payment_failed.
currencyquerystringNo
buyerIdquerystring (uuid)No
sellerIdquerystring (uuid)NoOnly the organisation’s own seller id.
createdByquerystring (uuid)NoOnly documents created by this actor id (createdBy.id): an auth user id, or an API-key id with createdByType=api_key.
createdByTypequerystringNoOnly documents created by this kind of actor (createdBy.type). One of user | api_key | service | system.
invoiceDateFromquerystringNo
invoiceDateToquerystringNo
dueDateFromquerystringNo
dueDateToquerystringNo
createdAtFromquerystringNo
createdAtToquerystringNoExclusive.
searchquerystringNoMatches the document number, the number NRS holds or the IRN by prefix, and the buyer name or TIN anywhere in it. Case-insensitive; % and _ are plain characters. At most 100 characters.
simpleStatusquerystringNoOnly documents with this simple status (simpleStatus). One of draft | issued | reported | delivered | paid | part_paid | cancelled.
reportingquerystringNoOnly documents at this reporting stage, as the summary cards count them (needs_attention = rejected or on hold, not cancelled). One of draft | not_reported | in_progress | reported | needs_attention.
deliveryquerystringNoOnly documents with this delivery channel (reporting.delivery). One of nrs | deliver_to_buyer | sent_email | shared_link | none.
creditedquerystringNotrue: documents credited by a credit note that counts against them; false: invoices no credit note credits. One of true | false.
refundOwedquerystringNotrue: documents on which a refund is still owed to the buyer; false: documents on which none is. One of true | false.
overduequerystringNoOnly issued invoices still owing (net of credit notes) past their due date today. One of true.
amountFromMinorquerynumberNoPayable amount at least this (minor units). At least 0.
amountToMinorquerynumberNoPayable amount at most this (minor units). At least 0.

Example request

bash
curl https://gp.useyona.com/i/v1/invoices/summary \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses


Validate an invoice with the tax authority (dry run)

POST /i/v1/invoices/validate

invoice.validate; charged per call before the tax authority gateway is asked, refunded when it could not answer. Answers 200 whether the document is valid or not: the verdict is the answer. Nothing is stored.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringNo8–128 of [A-Za-z0-9_-].

Request body

FieldTypeRequiredDescription
invoiceIdstring (uuid)NoValidate a stored invoice (alone).
sellerIdstring (uuid)NoOnly the organisation’s own seller id.
buyerIdstring (uuid)No
invoiceKindstringNo
invoiceNumberstringNo
invoiceTypestringNoOnly standard: credit notes are not validated here. One of standard.
invoiceDatestringNoThe issue date (required with an invoice body).
issueTimestringNo
dueDatestringNo
currencystringNoISO 4217 (required with an invoice body).
lineItemsarray of ValidateLineItemNo1 to 500 items.
allowanceAmountstring or numberNo
chargeAmountstring or numberNo
paymentTermsstringNoAt most 500 characters.
notesstringNoAt most 2000 characters.
purchaseOrderReferencestringNoAt most 100 characters.
buyerReferencestringNoAt most 100 characters.
accountingCoststringNoAt most 100 characters.

lineItems[]

FieldTypeRequiredDescription
itemIdstring (uuid)NoA saved item of the organisation: every omitted field below is filled from it.
descriptionstringNoRequired without an itemId. 1 to 500 characters.
itemNamestringNoAt most 255 characters.
hsnCodestringNoAt most 32 characters.
productCategorystringNoAt most 100 characters.
isicCodestringNoThe service code. At most 32 characters.
serviceCategorystringNoAt most 100 characters.
quantitystring or numberYes> 0, ≤ 6 decimals.
unitCodestringNoRequired without an itemId.
unitPricestring or numberNo≥ 0, ≤ 4 decimals, major units. Required without an itemId.
discountAmountstring or numberNomajor units, ≤ 2 decimals.
feeAmountstring or numberNomajor units, ≤ 2 decimals.
taxCategorystringNoRequired without an itemId.

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/invoices/validate \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "invoiceKind": "B2B",
    "invoiceDate": "2026-09-30",
    "issueTime": "10:30:00",
    "dueDate": "2026-10-30",
    "currency": "NGN"
  }'

Responses

The verdict.

Errors: 400, 402, 403, 404, 409, 422, 503


Get the tax authority’s copy of an invoice

GET /i/v1/invoices/{id}/authority-download

Requires invoice.download_authority_copy. The tax authority’s own decrypted copy of a registered document, as JSON. Not charged.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Example request

bash
curl https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/authority-download \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses


Cancel an invoice

POST /i/v1/invoices/{id}/cancel

Requires invoice.cancel. A finalised invoice the tax authority does not hold (never submitted, rejected, or still queued) is voided locally, free of charge. A registered one is cancelled with a credit note for everything left, charged as one cancellation; it becomes cancelled once the credit note registers. A draft is 409 BIZ201 (delete it instead); a document in flight to the tax authority, a credit note, or one already cancelled is 409 BIZ004. Accepts an Idempotency-Key. Answers the original as it now stands. The ETag header carries the invoice version.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Request body

FieldTypeRequiredDescription
reasonstringYes3 to 500 characters.

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/cancel \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "Issued to the wrong buyer"
  }'

Responses

The original invoice, cancelled or being cancelled.


Issue a credit note against a registered invoice

POST /i/v1/invoices/{id}/credit-notes

Requires invoice.cancel. Credits everything left (full), chosen lines and quantities (lines), or a tax-inclusive amount; several credit notes may be issued as long as their total stays within the payable amount plus any debit notes. Each credit note is charged as one cancellation. Accepts an Idempotency-Key. With preview: true nothing is written or charged and the answer is 200 with the preview.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Request body

FieldTypeRequiredDescription
reasonstringYes3 to 500 characters.
modestringYesOne of full | lines | amount.
linesarray of CreditNoteLineNomode ‘lines’ only (required there)
amountMinornumberNomode ‘amount’ only (required there): the TAX-INCLUSIVE amount, minor units.
lineNonumberNomode ‘amount’ only: the original line whose text, codes and VAT the credit line takes (default 1)
previewbooleanNotrue: answer what would be issued; nothing is written or charged.

lines[]

FieldTypeRequiredDescription
lineNonumberYesthe ORIGINAL invoice’s line number.
quantitystring or numberYesdecimal > 0, at most 6 decimals, ≤ what is left of the line.

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/credit-notes \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "Two units returned",
    "mode": "full",
    "amountMinor": 107500,
    "lineNo": 1
  }'

Responses

With preview: true: what would be issued.

The original invoice as it now stands and the credit note just issued.


Issue a debit note against a registered invoice

POST /i/v1/invoices/{id}/debit-notes

Requires invoice.create and invoice.submit. Adds lines to a registered invoice as a debit note and submits it; the charge is held and captured when it registers (released if the tax authority rejects it). Accepts an Idempotency-Key. With preview: true nothing is written or charged and the answer is 200 with the preview.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Request body

FieldTypeRequiredDescription
reasonstringNoAt most 500 characters.
lineItemsarray of InvoiceLineItemYes
previewbooleanNotrue: answer what would be issued; nothing is written or charged.

lineItems[]

FieldTypeRequiredDescription
itemIdstring (uuid)NoA saved item of the organisation: every field of the line left out is filled from the item, and a field sent wins.
descriptionstringNoRequired without an itemId. 1 to 500 characters.
itemNamestringNoAt most 255 characters.
hsnCodestringNoHS code (goods).
productCategorystringNoThe HS description (goods). At most 500 characters.
isicCodestringNoISIC code (services); stored as the service code.
serviceCategorystringNoThe ISIC description (services). Stored as the line’s product category; send it or productCategory, not both. At most 500 characters.
quantitystring or numberYesDecimal string (≤ 6 decimals) or number; > 0.
unitCodestringNoA unit code of the jurisdiction’s list. Required without an itemId.
unitPricestring or numberNoMajor units, decimal string (≤ 4 decimals) or number; ≥ 0. Required without an itemId.
discountAmountstring or numberNoMajor units, ≤ 2 decimals.
feeAmountstring or numberNoMajor units, ≤ 2 decimals.
taxCategorystringNoA tax-category code-list id, or a short alias (standard | zero | exempt). Required without an itemId.

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/debit-notes \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "Delivery charge omitted",
    "lineItems": [
      {
        "description": "Consulting services",
        "hsnCode": "1006.30",
        "isicCode": "0112",
        "quantity": "2.5",
        "unitCode": "EA",
        "unitPrice": "50000.00",
        "discountAmount": "0",
        "feeAmount": "0",
        "taxCategory": "STANDARD_VAT"
      }
    ]
  }'

Responses

With preview: true: what would be issued.

The original invoice as it now stands and the debit note just issued.


Download an invoice as a PDF

GET /i/v1/invoices/{id}/download

Content negotiation on Accept: application/pdf answers the PDF itself as an attachment; anything else (or no Accept) answers a short-lived download link in the JSON envelope. Never cached (Cache-Control: private, no-store, Vary: Accept).

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes
formatquerystringNoOnly pdf exists. One of pdf.

Example request

bash
curl https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/download \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

The PDF (application/pdf), or a download link (application/json).

Errors: 400, 402, 404, 503


Finalise a draft invoice

POST /i/v1/invoices/{id}/finalise

Requires invoice.finalise. Freezes the seller and buyer onto the document; 422 VAL001 when the jurisdiction’s checks refuse it. The ETag header carries the invoice version.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/finalise \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

The finalised invoice.


Issue a draft invoice

POST /i/v1/invoices/{id}/issue

Requires invoice.finalise and invoice.submit. When the organisation is connected to NRS and reports automatically, the draft is finalised and submitted (202). Otherwise it is finalised and sent to the buyer without being reported (200, notReportedReason says why). Accepts an Idempotency-Key.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/issue \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

Finalised and sent to the buyer, not reported.

Finalised and queued for reporting.


Record an invoice’s payment status

PATCH /i/v1/invoices/{id}/payment-status

Requires invoice.record_payment. Only for a document registered with the tax authority; the latest report is relayed to it. Not charged. amountPaidMinor moves only once the tax authority accepts the report (see payments).

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Request body

FieldTypeRequiredDescription
statusstringYesunpaid is local only (refused once anything was reported); payment_failed follows an accepted part or full payment. One of unpaid | partially_paid | paid | payment_failed.
amountMinorintegerNoInteger minor units; required for partially_paid: the TOTAL received to date (cumulative), not the installment.
referencestringNoAt most 100 characters.
notestringNoAt most 500 characters.

Example request

bash
curl -X PATCH https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/payment-status \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "unpaid"
  }'

Responses

The invoice.


Refresh an invoice’s status from the tax authority

POST /i/v1/invoices/{id}/query-status

Requires invoice.query_status; charged as one status query before the call and refunded when the tax authority is unavailable (503 SYS202, nothing changed). The answer only ever moves the status forward. An Idempotency-Key is bound to this invoice; reusing it for another invoice is 409 BIZ107.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/query-status \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses


Renumber an invoice and resubmit it

POST /i/v1/invoices/{id}/renumber

Requires invoice.submit. Only when the current submission is on hold because the tax authority already holds the invoice number: the invoice takes the next number of its series (the old one is kept on the withdrawn submission) and a new submission is queued with a new charge hold. Otherwise 409 BIZ004 says why. Accepts an Idempotency-Key; a repeated key answers 200 with replayed: true.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/renumber \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

A replay of an earlier request with the same key.

Renumbered and queued.


Reopen a finalised invoice as a draft

POST /i/v1/invoices/{id}/reopen

Requires invoice.reopen. Allowed while the current submission was rejected by the tax authority, or when the invoice was never submitted (then it is revised: same number, next version). If-Match is optional. The ETag header carries the invoice version.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/reopen \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

The draft.


Retry an invoice submission on hold

POST /i/v1/invoices/{id}/retry

Requires invoice.retry. Resumes the same submission that is on hold, with its existing charge hold.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/retry \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses


Revise an issued invoice that was never reported

POST /i/v1/invoices/{id}/revise

Requires invoice.reopen. An issued invoice never reported to the tax authority and unpaid goes back to a draft with the same number and the next version; otherwise 409 BIZ201 says what to do instead. If-Match is optional. The ETag header carries the invoice version.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/revise \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

The draft.


Send an invoice to its buyer

POST /i/v1/invoices/{id}/send

invoice.send_to_buyer; charged per send (refunded if it cannot be recorded). Queues an email of a finalised invoice to the buyer email on the issued document (never an address from the request), with an optional message. 202 means accepted and queued, not delivered. In sandbox no email leaves: shareUrl links to the PDF for preview. A replayed Idempotency-Key answers the first result with replayed: true.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Request body

FieldTypeRequiredDescription
messagestringNoAt most 1000 characters.

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/send \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Please find our invoice attached."
  }'

Responses

The send was queued.

Errors: 400, 402, 404, 409, 503


GET /i/v1/invoices/{id}/share-links

invoice.share. Every link of the invoice, newest first, revoked and expired included (kept 90 days); url is always null here.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Yes

Example request

bash
curl https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/share-links \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

The links, newest first.

Errors: 400, 401, 403, 404, 429


POST /i/v1/invoices/{id}/share-links

invoice.share. A random, stored, revocable token; url is answered ONCE (only its sha256 is kept). expiresInSeconds 3600–2592000 (default 604800), maxViews 1–10000 (absent = unlimited). At most 20 live links per invoice. Emits the invoice.share_link.created event.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Yes

Request body

FieldTypeRequiredDescription
expiresInSecondsnumberNoLifetime in seconds: 3600 (1 hour) to 2592000 (30 days); default 604800 (7 days). Between 3600 and 2592000.
maxViewsnumberNoHow many times the link may be opened (1 = open once); absent = unlimited. Between 1 and 10000.

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/share-links \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "expiresInSeconds": 604800,
    "maxViews": 1
  }'

Responses

The link, with its url — the one time the token is shown.

Errors: 400, 401, 403, 404, 409, 429


DELETE /i/v1/invoices/{id}/share-links/{linkId}

invoice.share. Immediate: the next resolve is 404. Idempotent (a revoked link answers 200 with its view). Emits the invoice.share_link.revoked event.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Yes
linkIdpathstring (uuid)Yes

Example request

bash
curl -X DELETE https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/share-links/d8b2e4f6-9a3c-5b7d-0e1f-2a3b4c5d6e7f \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

The link, revoked.

Errors: 400, 401, 403, 404, 429


Get an invoice’s submission status

GET /i/v1/invoices/{id}/status

Requires invoice.read. The status as last recorded, with every submission; the tax authority is not called and nothing is charged.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Example request

bash
curl https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/status \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses


Submit an invoice to the tax authority

POST /i/v1/invoices/{id}/submit

Requires invoice.submit. Queues a submission of a finalised invoice; with finalise=true a draft is finalised and submitted in one step. Idempotent per invoice: while a submission is in flight the same one is answered with 200 and replayed: true. Accepts an Idempotency-Key.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstringYes
finalisequerystringNoFinalise a draft and submit it in one step. One of true | false.

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/invoices/9f8e7d6c-5b4a-3210-fedc-ba9876543210/submit \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

A submission already in flight (replayed: true).

Queued.


Get the invoice settings

GET /i/v1/invoice-settings

Requires invoice.read. The organisation’s invoice settings in the token’s mode; the defaults (version 0) when they were never changed. The ETag header carries the version.

Who can call it: API key or signed-in user.

Example request

bash
curl https://gp.useyona.com/i/v1/invoice-settings \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses


Update the invoice settings

PATCH /i/v1/invoice-settings

Users only, with tax_connection.connect. Turning reportAutomatically off needs a recent second-factor step-up (403 AUTH033 with a WWW-Authenticate challenge otherwise); turning it on does not. If-Match: "<version>" is optional ("0" while never changed); a stale version answers 409 RES003. The ETag header carries the new version.

Who can call it: Signed-in user only: do this in the Yona app.

Request body

FieldTypeRequiredDescription
reportAutomaticallybooleanYesOn (the default): an organisation connected to NRS reports every invoice it issues. Off: issuing finalises the invoice and sends it to the buyer without reporting it; it can be submitted to NRS later.

Example request

bash
curl -X PATCH https://gp.useyona.com/i/v1/invoice-settings \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "reportAutomatically": true
  }'

Responses