Skip to Content

Invoices

List invoices

GET /i/v1/invoices

Requires invoice.read. The organization’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 organization’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. A TIN may be typed with its hyphen, without it, or in groups. At most 100 characters.
simpleStatusquerystringNoOnly documents with this simple status (simpleStatus). One of draft | issued | reported | transmitted | 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; held = issued while the connection to the tax authority was in progress, reported once it completes). One of draft | not_reported | in_progress | reported | needs_attention | held.
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.
attentionquerystringNoOnly documents that need attention, as one list: rejected or on hold at the tax authority (reporting=needs_attention), or overdue (overdue=true). ANDed with the other filters. 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.

Errors: 400, 401, 403, 429, 500, 503


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.

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringNo8–128 characters of A–Z, a–z, 0–9, _ or -. The same key with the same body answers the first result (nothing is done or charged again); with another body it is 409 BIZ107.

Request body

FieldTypeRequiredDescription
sellerIdstring (uuid)NoOnly the organization’s own seller id.
buyerIdstring (uuid)NoOne of the organization’s buyers, not archived (404 RES001 otherwise). Without it the document has no buyer.
invoiceKindstringYesA kind of the jurisdiction (Nigeria: B2B, B2C, B2G, G2B).
invoiceNumberstringNoAllocated when absent. When sent, it must be a document number of this organization, mode and issue year: channel (3 letters), seller code (3 to 5 letters), the issue year’s two digits, then 6 or more digits.
invoiceTypestringNoOnly standard: credit and debit notes are issued against an invoice (cancel, credit-notes, debit-notes). One of standard.
invoiceDatestringYesThe issue date.
issueTimestringNoThe issue time, HH:MM or HH:MM:SS (24-hour).
dueDatestringNo≥ the issue date.
currencystringYesThe document currency (ISO 4217), one of the jurisdiction’s once its list is stored. Tax is stated in it too.
lineItemsarray of InvoiceLineItemYesThe lines, in order (numbered from 1). Each is priced at its tax category’s rate on the issue date. 1 to 500 items.
allowanceAmountstring or numberNoDocument allowance, major units, ≤ 2 decimals.
chargeAmountstring or numberNoDocument charge, major units, ≤ 2 decimals.
paymentTermsstringNoPayment terms, printed on the document. At most 500 characters.
notesstringNoFree text, printed on the document and sent to the tax authority as its note. At most 2000 characters.
purchaseOrderReferencestringNoThe buyer’s purchase order reference, printed on the document. At most 100 characters.
buyerReferencestringNoThe buyer’s own reference for this document, kept with it. At most 100 characters.
accountingCoststringNoThe buyer’s accounting cost code for this document, kept with it. At most 100 characters.

lineItems[]

FieldTypeRequiredDescription
itemIdstring (uuid)NoA saved item of the organization: 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.
itemNamestringNoThe item’s name, sent to the tax authority as the line item’s name (the description is sent when absent). At 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 '{
    "sellerId": "3b241101-e2bb-4255-8caf-4136c566a962",
    "buyerId": "9b2f4e1a-6c3d-4f8a-b5e7-2d1c0a9f8e76",
    "invoiceKind": "B2B",
    "invoiceNumber": "YPLEKA26000042",
    "invoiceType": "standard",
    "invoiceDate": "2026-09-30",
    "issueTime": "14:30:00",
    "dueDate": "2026-10-30",
    "currency": "NGN",
    "lineItems": [
      {
        "itemId": "c56a4180-65aa-42ec-a945-5fd21dec0538",
        "description": "Consulting services",
        "itemName": "Long grain parboiled rice, 50 kg",
        "hsnCode": "1006.30",
        "productCategory": "Semi-milled or wholly milled rice",
        "isicCode": "0112",
        "serviceCategory": "Growing of rice",
        "quantity": "2.5",
        "unitCode": "EA",
        "unitPrice": "50000.00",
        "discountAmount": "0",
        "feeAmount": "0",
        "taxCategory": "STANDARD_VAT"
      }
    ],
    "allowanceAmount": "0",
    "chargeAmount": "0",
    "paymentTerms": "Payment due within 30 days by bank transfer.",
    "notes": "Thank you for your business.",
    "purchaseOrderReference": "PO-2026-0187",
    "buyerReference": "IKF-AP-55102",
    "accountingCost": "OPEX-ADMIN-2026"
  }'

Responses

The draft.

Errors: 400, 401, 402, 403, 404, 409, 413, 415, 422, 429, 500, 503


Get an invoice

GET /i/v1/invoices/{id}

Requires invoice.read. One document with its lines. A document of another organization 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

Errors: 400, 401, 403, 404, 429, 500, 503


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)NoOnly the draft’s own seller id (the organization’s); another answers 404 RES001.
buyerIdstring (uuid) or nullNoOne of the organization’s buyers, not archived (404 RES001 otherwise); null removes the buyer.
invoiceKindstringNoA kind of the jurisdiction (Nigeria: B2B, B2C, B2G, G2B).
invoiceNumberstringNoA document number of this organization, mode and issue year (channel, seller code, two-digit year, 6 or more digits).
invoiceDatestringNoThe issue date. Moved to another year, an allocated number is drawn again from that year’s series.
issueTimestring or nullNoThe issue time, HH:MM or HH:MM:SS (24-hour); null clears it.
dueDatestring or nullNoThe due date, not before the issue date; null clears it.
currencystringNoThe document currency (ISO 4217), one of the jurisdiction’s once its list is stored. Tax is stated in it too.
lineItemsarray of InvoiceLineItemNoWhen sent, replaces every line of the draft. 1 to 500 items.
allowanceAmountstring or number or nullNoDocument allowance, major units, ≤ 2 decimals.
chargeAmountstring or number or nullNoDocument charge, major units, ≤ 2 decimals.
paymentTermsstring or nullNoPayment terms, printed on the document; null clears them. At most 500 characters.
notesstring or nullNoFree text, printed on the document and sent to the tax authority as its note; null clears it. At most 2000 characters.
purchaseOrderReferencestring or nullNoThe buyer’s purchase order reference, printed on the document; null clears it. At most 100 characters.
buyerReferencestring or nullNoThe buyer’s own reference for this document, kept with it; null clears it. At most 100 characters.
accountingCoststring or nullNoThe buyer’s accounting cost code for this document, kept with it; null clears it. At most 100 characters.

lineItems[]

FieldTypeRequiredDescription
itemIdstring (uuid)NoA saved item of the organization: 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.
itemNamestringNoThe item’s name, sent to the tax authority as the line item’s name (the description is sent when absent). At 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 '{
    "sellerId": "3b241101-e2bb-4255-8caf-4136c566a962",
    "buyerId": "9b2f4e1a-6c3d-4f8a-b5e7-2d1c0a9f8e76",
    "invoiceKind": "B2C",
    "invoiceNumber": "YPLEKA26000042",
    "invoiceDate": "2026-09-30",
    "issueTime": "14:30:00",
    "dueDate": "2026-10-30",
    "currency": "NGN",
    "paymentTerms": "Payment due within 30 days by bank transfer.",
    "notes": "Thank you for your business.",
    "purchaseOrderReference": "PO-2026-0187",
    "buyerReference": "IKF-AP-55102",
    "accountingCost": "OPEX-ADMIN-2026"
  }'

Responses

The updated draft.

Errors: 400, 401, 403, 404, 409, 413, 415, 422, 429, 500, 503


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

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


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)YesThe invoices to submit: 1 to 100 distinct ids of the organization’s invoices in this mode. A draft is finalised and submitted in one step. 1 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": [
      "5b0e7c4a-2f1d-4e8b-9a36-c1d2e3f4a5b6",
      "0d9f8e7c-6b5a-4c3d-8e2f-1a0b9c8d7e6f"
    ]
  }'

Responses

Errors: 400, 401, 403, 413, 415, 429, 500, 503


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 organization’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, 500, 503


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.

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringNo8–128 characters of A–Z, a–z, 0–9, _ or -. The same key with the same body answers the first result (nothing is done or charged again); with another body it is 409 BIZ107.

Request body

FieldTypeRequiredDescription
sellerIdstring (uuid)NoOnly the organization’s own seller id.
buyerIdstring (uuid)NoOne of the organization’s buyers, not archived (404 RES001 otherwise). Without it the document has no buyer.
invoiceKindstringYesA kind of the jurisdiction (Nigeria: B2B, B2C, B2G, G2B).
invoiceNumberstringNoAllocated when absent. When sent, it must be a document number of this organization, mode and issue year: channel (3 letters), seller code (3 to 5 letters), the issue year’s two digits, then 6 or more digits.
invoiceTypestringNoOnly standard: credit and debit notes are issued against an invoice (cancel, credit-notes, debit-notes). One of standard.
invoiceDatestringYesThe issue date.
issueTimestringNoThe issue time, HH:MM or HH:MM:SS (24-hour).
dueDatestringNo≥ the issue date.
currencystringYesThe document currency (ISO 4217), one of the jurisdiction’s once its list is stored. Tax is stated in it too.
lineItemsarray of InvoiceLineItemYesThe lines, in order (numbered from 1). Each is priced at its tax category’s rate on the issue date. 1 to 500 items.
allowanceAmountstring or numberNoDocument allowance, major units, ≤ 2 decimals.
chargeAmountstring or numberNoDocument charge, major units, ≤ 2 decimals.
paymentTermsstringNoPayment terms, printed on the document. At most 500 characters.
notesstringNoFree text, printed on the document and sent to the tax authority as its note. At most 2000 characters.
purchaseOrderReferencestringNoThe buyer’s purchase order reference, printed on the document. At most 100 characters.
buyerReferencestringNoThe buyer’s own reference for this document, kept with it. At most 100 characters.
accountingCoststringNoThe buyer’s accounting cost code for this document, kept with it. At most 100 characters.

lineItems[]

FieldTypeRequiredDescription
itemIdstring (uuid)NoA saved item of the organization: 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.
itemNamestringNoThe item’s name, sent to the tax authority as the line item’s name (the description is sent when absent). At 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 '{
    "sellerId": "3b241101-e2bb-4255-8caf-4136c566a962",
    "buyerId": "9b2f4e1a-6c3d-4f8a-b5e7-2d1c0a9f8e76",
    "invoiceKind": "B2B",
    "invoiceNumber": "YPLEKA26000042",
    "invoiceType": "standard",
    "invoiceDate": "2026-09-30",
    "issueTime": "14:30:00",
    "dueDate": "2026-10-30",
    "currency": "NGN",
    "lineItems": [
      {
        "itemId": "c56a4180-65aa-42ec-a945-5fd21dec0538",
        "description": "Consulting services",
        "itemName": "Long grain parboiled rice, 50 kg",
        "hsnCode": "1006.30",
        "productCategory": "Semi-milled or wholly milled rice",
        "isicCode": "0112",
        "serviceCategory": "Growing of rice",
        "quantity": "2.5",
        "unitCode": "EA",
        "unitPrice": "50000.00",
        "discountAmount": "0",
        "feeAmount": "0",
        "taxCategory": "STANDARD_VAT"
      }
    ],
    "allowanceAmount": "0",
    "chargeAmount": "0",
    "paymentTerms": "Payment due within 30 days by bank transfer.",
    "notes": "Thank you for your business.",
    "purchaseOrderReference": "PO-2026-0187",
    "buyerReference": "IKF-AP-55102",
    "accountingCost": "OPEX-ADMIN-2026"
  }'

Responses

Errors: 400, 401, 402, 403, 404, 409, 413, 415, 422, 429, 500, 503


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

Errors: 400, 401, 403, 429, 500, 503


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

Errors: 401, 403, 429, 500, 503


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

Errors: 400, 401, 403, 429, 500, 503


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 organization’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. A TIN may be typed with its hyphen, without it, or in groups. At most 100 characters.
simpleStatusquerystringNoOnly documents with this simple status (simpleStatus). One of draft | issued | reported | transmitted | 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; held = issued while the connection to the tax authority was in progress, reported once it completes). One of draft | not_reported | in_progress | reported | needs_attention | held.
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.
attentionquerystringNoOnly documents that need attention, as one list: rejected or on hold at the tax authority (reporting=needs_attention), or overdue (overdue=true). ANDed with the other filters. 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

Errors: 400, 401, 403, 429, 500, 503


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. An unsaved invoice body is checked by exactly the rules create checks it by, so a body this refuses, create refuses too.

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 organization’s own seller id; any other is 404.
buyerIdstring (uuid)NoA buyer of the organization, as it is now; another id is 404.
invoiceKindstringNoA kind of the jurisdiction (Nigeria: B2B, B2C, B2G, G2B). Required with an invoice body.
invoiceNumberstringNoAs on create: a document number of this organization, mode and issue year. Absent: the number create would most likely allocate is previewed.
invoiceTypestringNoOnly standard: credit notes are not validated here. One of standard.
invoiceDatestringNoThe issue date (required with an invoice body).
issueTimestringNoThe time of issue on the 24-hour clock, HH:MM:SS, as invoice create takes it.
dueDatestringNo≥ the issue date.
currencystringNoISO 4217 (required with an invoice body).
lineItemsarray of ValidateLineItemNoAs on create (required with an invoice body). 1 to 500 items.
allowanceAmountstring or numberNoDocument allowance, major units, ≤ 2 decimals.
chargeAmountstring or numberNoDocument charge, major units, ≤ 2 decimals.
paymentTermsstringNoAccepted as on invoice create; not part of the dry run (the document sent to the tax authority does not carry it). At most 500 characters.
notesstringNoFree-text notes on the document. At most 2000 characters.
purchaseOrderReferencestringNoAccepted as on invoice create; not part of the dry run (the document sent to the tax authority does not carry it). At most 100 characters.
buyerReferencestringNoAccepted as on invoice create; not part of the dry run (the document sent to the tax authority does not carry it). At most 100 characters.
accountingCoststringNoAccepted as on invoice create; not part of the dry run (the document sent to the tax authority does not carry it). At most 100 characters.

lineItems[]

FieldTypeRequiredDescription
itemIdstring (uuid)NoA saved item of the organization: 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.
itemNamestringNoThe item’s name, sent to the tax authority as the line item’s name (the description is sent when absent). At 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/validate \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "sellerId": "2b7c9d1e-3f4a-4b5c-8d6e-7f8a9b0c1d2e",
    "buyerId": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
    "invoiceKind": "B2B",
    "invoiceNumber": "YPLEKA26000042",
    "invoiceType": "standard",
    "invoiceDate": "2026-09-30",
    "issueTime": "10:30:00",
    "dueDate": "2026-10-30",
    "currency": "NGN",
    "allowanceAmount": "0",
    "chargeAmount": "0",
    "paymentTerms": "Payment due within 30 days",
    "notes": "Thank you for your business.",
    "purchaseOrderReference": "PO-2026-0117",
    "buyerReference": "ADB-REF-88",
    "accountingCost": "4000-SALES"
  }'

Responses

The verdict.

Errors: 400, 401, 402, 403, 404, 409, 413, 415, 422, 429, 500, 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
idpathstring (uuid)YesThe invoice’s id.

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

Errors: 400, 401, 403, 404, 409, 422, 429, 500, 503


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
Idempotency-KeyheaderstringNo8–128 characters of A–Z, a–z, 0–9, _ or -. The same key with the same body answers the first result (nothing is done or charged again); with another body it is 409 BIZ107.

Request body

FieldTypeRequiredDescription
reasonstringYesWhy the invoice is cancelled. A registered invoice’s cancelling credit note carries it as its note, sent to the tax authority; a local void keeps it with the cancellation. 3 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.

Errors: 400, 401, 402, 403, 404, 409, 413, 415, 422, 429, 500, 503


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
Idempotency-KeyheaderstringNo8–128 characters of A–Z, a–z, 0–9, _ or -. The same key with the same body answers the first result (nothing is done or charged again); with another body it is 409 BIZ107.

Request body

FieldTypeRequiredDescription
reasonstringYesWhy the credit note is issued: kept on the credit note and sent to the tax authority as its note. 3 to 500 characters.
modestringYesfull: everything left of the invoice; lines: chosen lines at chosen quantities (lines); amount: a tax-inclusive amount on one line’s tax (amountMinor, lineNo). One 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": "lines",
    "amountMinor": 107500,
    "lineNo": 1,
    "preview": false
  }'

Responses

With preview: true: what would be issued.

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

Errors: 400, 401, 402, 403, 404, 409, 413, 415, 422, 429, 500, 503


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
Idempotency-KeyheaderstringNo8–128 characters of A–Z, a–z, 0–9, _ or -. The same key with the same body answers the first result (nothing is done or charged again); with another body it is 409 BIZ107.

Request body

FieldTypeRequiredDescription
reasonstringNoWhy the debit note is issued: kept on the debit note and sent to the tax authority as its note. At most 500 characters.
lineItemsarray of InvoiceLineItemYesThe lines the debit note adds, in the invoice line shape. 1 to 500 items.
previewbooleanNotrue: answer what would be issued; nothing is written or charged.

lineItems[]

FieldTypeRequiredDescription
itemIdstring (uuid)NoA saved item of the organization: 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.
itemNamestringNoThe item’s name, sent to the tax authority as the line item’s name (the description is sent when absent). At 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": [
      {
        "itemId": "c56a4180-65aa-42ec-a945-5fd21dec0538",
        "description": "Consulting services",
        "itemName": "Long grain parboiled rice, 50 kg",
        "hsnCode": "1006.30",
        "productCategory": "Semi-milled or wholly milled rice",
        "isicCode": "0112",
        "serviceCategory": "Growing of rice",
        "quantity": "2.5",
        "unitCode": "EA",
        "unitPrice": "50000.00",
        "discountAmount": "0",
        "feeAmount": "0",
        "taxCategory": "STANDARD_VAT"
      }
    ],
    "preview": false
  }'

Responses

With preview: true: what would be issued.

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

Errors: 400, 401, 402, 403, 404, 409, 413, 415, 422, 429, 500, 503


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). Charged INVOICE_DOWNLOAD per download (either form) before the PDF is rendered; refunded when the render fails.

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

Parameters

NameInTypeRequiredDescription
idpathstringYes
formatquerystringNoOnly pdf exists. One of pdf.
Idempotency-KeyheaderstringNo8–128 characters of A–Z, a–z, 0–9, _ or -. A retry with the same key is not charged twice (the work is done again); the key is bound to its first request, so another request with it is 409 BIZ107.

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, 401, 402, 403, 404, 409, 429, 500, 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.

Errors: 400, 401, 403, 404, 409, 422, 429, 500, 503


Issue a draft invoice

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

Requires invoice.finalise and invoice.submit. When the organization 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). While the connection to NRS is in progress and the organization reports automatically, the invoice is held (reporting: held) and reported once the connection completes. Accepts an Idempotency-Key.

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

Parameters

NameInTypeRequiredDescription
idpathstringYes
Idempotency-KeyheaderstringNo8–128 characters of A–Z, a–z, 0–9, _ or -. The same key with the same body answers the first result (nothing is done or charged again); with another body it is 409 BIZ107.

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 (or held: reported once connected).

Finalised and queued for reporting.

Errors: 400, 401, 402, 403, 404, 409, 422, 429, 500, 503


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. Charged PAYMENT_STATUS_REPORT per report relayed; a change that reports nothing is free. 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.
referencestringNoThe payment’s own reference (a transfer or receipt number), 1 to 100 characters: kept on the payment entry (payments[].reference) and sent to the tax authority with the report. At most 100 characters.
notestringNoA free note, 1 to 500 characters, kept with the recorded report; it is not sent to the tax authority. At 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": "partially_paid",
    "amountMinor": 50000000,
    "reference": "TRF-20261114-0042",
    "note": "First installment, received by bank transfer"
  }'

Responses

The invoice.

Errors: 400, 401, 402, 403, 404, 409, 413, 415, 429, 500, 503


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) or answers a status this service does not recognise yet (409 BIZ219, nothing changed). The answer only ever moves the status forward. A submission the tax authority registered but will not send through its network (the buyer is not on e-invoicing, or B2C) is complete: it reads registered, with its reference and verification code, and offNetworkReason says why. 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
Idempotency-KeyheaderstringNo8–128 characters of A–Z, a–z, 0–9, _ or -. A retry with the same key is not charged twice (the work is done again); the key is bound to its first request, so another request with it is 409 BIZ107.

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

Errors: 400, 401, 402, 403, 404, 409, 422, 429, 500, 503


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
Idempotency-KeyheaderstringNo8–128 characters of A–Z, a–z, 0–9, _ or -. The same key with the same body answers the first result (nothing is done or charged again); with another body it is 409 BIZ107.

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.

Errors: 400, 401, 402, 403, 404, 409, 422, 429, 500, 503


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.

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


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

Errors: 400, 401, 403, 404, 409, 422, 429, 500, 503


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.

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


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). An optional message is accepted and checked, but the email does not carry it today. 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
Idempotency-KeyheaderstringNo8–128 characters of A–Z, a–z, 0–9, _ or -. The same key with the same body answers the first result (nothing is done or charged again); with another body it is 409 BIZ107.

Request body

FieldTypeRequiredDescription
messagestringNoA note to the buyer, at most 1000 characters (trimmed; line breaks kept). In live mode the buyer’s email shows it as a note from you, not reviewed by Yona. In sandbox no email leaves. At 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": "Thank you for your business. Payment details are on the invoice."
  }'

Responses

The send was queued.

Errors: 400, 401, 402, 403, 404, 409, 413, 415, 429, 500, 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, 500, 503


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

invoice.share; charged per link before it is saved (refunded if the save fails). 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, 402, 403, 404, 409, 413, 415, 429, 500, 503


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, 500, 503


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

Errors: 400, 401, 403, 404, 429, 500, 503


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.
Idempotency-KeyheaderstringNo8–128 characters of A–Z, a–z, 0–9, _ or -. The same key with the same body answers the first result (nothing is done or charged again); with another body it is 409 BIZ107.

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.

Errors: 400, 401, 402, 403, 404, 409, 422, 429, 500, 503


Get the invoice settings

GET /i/v1/invoice-settings

Requires invoice.read. The organization’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

Errors: 401, 403, 429, 500, 503


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 organization 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

Errors: 400, 401, 403, 409, 413, 415, 429, 500, 503