Skip to Content
API ReferenceReceived invoices

Received invoices

List received invoices

GET /i/v1/inbound-invoices

invoice.inbound.read; free. The invoices other businesses issued to the organization, served from the organization’s mirror of the authority gateway’s feed in the token’s mode, narrowed to its own tax ids (taxpayer.taxIds). tier: forward (default), the Received tab: the invoices that reached the organization on or after it connected its tax id in this mode (sync.since); history, the History tab: invoices retrieved from the tax authority on request (POST /i/v1/inbound-invoices/history-runs), whose sync is the newest retrieval’s. Filters: seller, accessPoint, transmissionStatus, paymentStatus (paid|unpaid|partial|rejected|overdue), issueDateFrom/To, receivedFrom/To, amountMin/Max (major units), currency, q, taxId; sort -receivedAt (default; -issueDate with tier=history) | receivedAt | issueDate | -issueDate | amount | -amount; page, limit ≤ 100 with meta.pagination. On the Received tab a first view reads the feed’s head before answering and the rest in the background (sync.syncing); a gateway outage serves the mirror with sync.error, never an error. The History tab never reads the gateway.

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

Parameters

NameInTypeRequiredDescription
sellerquerystringNoThe seller: a name (substring, any case) or a TIN (prefix). A TIN may be typed with its hyphen, without it, or in groups. At most 100 characters.
accessPointquerystringNoThe seller’s access point (supplier.app_reference), exact. At most 256 characters.
transmissionStatusquerystringNoAs the gateway reports it, exact. At most 64 characters.
paymentStatusquerystringNooverdue: a due date before today and not paid. One of paid | unpaid | partial | rejected | overdue.
issueDateFromquerystringNoInclusive.
issueDateToquerystringNoInclusive.
receivedFromquerystringNoInclusive (an instant or a day).
receivedToquerystringNoExclusive for an instant; a calendar day includes that whole day.
amountMinquerystringNoPayable amount, MAJOR units, inclusive.
amountMaxquerystringNoPayable amount, MAJOR units, inclusive.
currencyquerystringNo
qquerystringNoSeller name or TIN, IRN, or the seller’s invoice number (substring, any case). A TIN may be typed with its hyphen, without it, or in groups. At most 100 characters.
taxIdquerystringNoOne of taxpayer.taxIds (the organization’s own tax ids in this mode); any other is 400. At most 32 characters.
sortquerystringNoDefault -receivedAt; with tier=history, -issueDate (a history row’s receivedAt is when the access point imported it). One of -receivedAt | receivedAt | issueDate | -issueDate | amount | -amount.
pagequerynumberNoDefault: 1. At least 1.
limitquerynumberNoDefault: 25. Between 1 and 100.
tierquerystringNoforward (default): invoices received since the organization connected its tax id. history: invoices retrieved from the tax authority on request. One of forward | history. Default: forward.

Example request

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

Responses

One page: data holds the items with the taxpayer and sync context; meta.pagination the page.

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


Get a received invoice

GET /i/v1/inbound-invoices/{id}

invoice.inbound.read. From the mirror; document (the decrypted authority copy) is read from the gateway once, on the first view, when the mirror does not hold it. An invoice of the History tab (tier history) is served while retrieving history is available: its document is read and charged once, the first time it is opened (opening it again is free), and without the credit it is answered without its document. 503 only for a row the mirror never held while the gateway is down.

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

Parameters

NameInTypeRequiredDescription
idpathstringYesAt most 128 characters.

Example request

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

Responses

The received invoice.

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


Get analytics over received invoices

GET /i/v1/inbound-invoices/analytics

invoice.inbound.read; free. The list’s filters and tier (no sort or page); from the mirror. Amounts are MINOR units in reportingCurrency (the currency filter, else the most common); byCurrency gives each currency’s own.

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

Parameters

NameInTypeRequiredDescription
sellerquerystringNoThe seller: a name (substring, any case) or a TIN (prefix). A TIN may be typed with its hyphen, without it, or in groups. At most 100 characters.
accessPointquerystringNoThe seller’s access point (supplier.app_reference), exact. At most 256 characters.
transmissionStatusquerystringNoAs the gateway reports it, exact. At most 64 characters.
paymentStatusquerystringNooverdue: a due date before today and not paid. One of paid | unpaid | partial | rejected | overdue.
issueDateFromquerystringNoInclusive.
issueDateToquerystringNoInclusive.
receivedFromquerystringNoInclusive (an instant or a day).
receivedToquerystringNoExclusive for an instant; a calendar day includes that whole day.
amountMinquerystringNoPayable amount, MAJOR units, inclusive.
amountMaxquerystringNoPayable amount, MAJOR units, inclusive.
currencyquerystringNo
qquerystringNoSeller name or TIN, IRN, or the seller’s invoice number (substring, any case). A TIN may be typed with its hyphen, without it, or in groups. At most 100 characters.
taxIdquerystringNoOne of taxpayer.taxIds (the organization’s own tax ids in this mode); any other is 400. At most 32 characters.
tierquerystringNoforward (default): invoices received since the organization connected its tax id. history: invoices retrieved from the tax authority on request. One of forward | history. Default: forward.

Example request

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

Responses

The figures.

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


List the history retrievals

GET /i/v1/inbound-invoices/history-runs

invoice.inbound.read; free. The organization’s retrievals in the token’s mode, newest first, and the one queued or running now (active). page, limit ≤ 50 with meta.pagination.

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

Parameters

NameInTypeRequiredDescription
pagequerynumberNoDefault: 1. At least 1.
limitquerynumberNoDefault: 10. Between 1 and 50.

Example request

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

Responses

One page: data holds the runs and the active one; meta.pagination the page.

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


Retrieve invoice history from the tax authority

POST /i/v1/inbound-invoices/history-runs

invoice.inbound.retrieve (owners and admins); users only. “Retrieve history” and “Check for more”: starts a retrieval of the organization’s older invoices in the token’s mode — received invoices into the History tab (GET /i/v1/inbound-invoices?tier=history) and issued ones into Issued history. One at a time. It runs in the background: poll GET /i/v1/inbound-invoices/history-runs/{runId}. Charged only when it finds invoices the organization did not have (charged). No body. Emits invoice.inbound.history_requested.

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

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringNo8–128 characters of A–Z, a–z, 0–9, _ or -. A retry with the same key answers the same run and is not charged twice.

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/inbound-invoices/history-runs \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

Responses

The run, queued (or the run this key already started).

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


Get a history retrieval

GET /i/v1/inbound-invoices/history-runs/{runId}

invoice.inbound.read; free. One retrieval, for polling: its progress, what it added, and whether more may be available (moreAvailable).

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

Parameters

NameInTypeRequiredDescription
runIdpathstring (uuid)YesThe run’s id, as starting the retrieval answered it.

Example request

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

Responses

The run.

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


Load older received invoices from the tax authority

POST /i/v1/inbound-invoices/load-older

invoice.inbound.read; free. Kept for clients built before the History tab: it reads nothing, charges nothing and answers that nothing older belongs in the Received tab, which starts when the organization connected its tax id (sync.since). Older invoices are retrieved by owners and admins with POST /i/v1/inbound-invoices/history-runs and listed with tier=history. An Idempotency-Key is ignored.

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

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/inbound-invoices/load-older \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

Nothing loaded: fetched and added are 0, hasMore false.

Errors: 401, 403, 429, 500, 503