Switch theme
Outcomes and errors
Status codes
| Status | Meaning |
|---|---|
200 | a read — the existing document |
201 | the document is issued and fiscalized |
202 | the document is kept, but the tax authority did not accept it (see below) |
401 / 402 / 403 | key, subscription, module, IP address or scope |
404 | no such document or route |
409 | the account's state does not allow the request (setup, shift, conflict) |
422 | invalid request |
429 | too many requests |
502 | nothing was stored because of a tax-authority failure |
503 | the cash register is busy issuing other documents; no document was stored (see REGISTER_BUSY below) |
Error envelope
json
{ "error": { "code": "VALIDATION_ERROR", "message": "…", "details": { } }, "request_id": "…" }Branch on code, never on the text in message.
Check before sending
Before anything is sent to the tax authority, Konty checks the account's setup. If something is missing, the API answers 409 and stores nothing:
| Market | Code and details.reason | What is missing |
|---|---|---|
| Montenegro | FISCAL_SETUP_INCOMPLETE: certificate_missing / certificate_expired | the fiscal certificate |
| Montenegro | FISCAL_SETUP_INCOMPLETE: venue_identity_missing | the venue's tax id or business unit code |
| Montenegro | FISCAL_SETUP_INCOMPLETE: tcr_missing | the key's cash register is not registered with the tax authority |
| Montenegro | FISCAL_SETUP_INCOMPLETE: operator_code_missing | the key's user has no operator code |
| Montenegro | FISCAL_SETUP_INCOMPLETE: operator_code_refused | the tax authority refused the operator code of the key's user |
| Montenegro | FISCAL_SETUP_INCOMPLETE: day_deposit_missing | a regular register without today's opening deposit (cash or card payments) |
| Montenegro | FISCAL_SETUP_INCOMPLETE: fiscalization_disabled | fiscalization is switched off on this environment |
| Serbia | VSDC_CERTIFICATE_MISSING | no valid VSDC certificate (receipts) |
| Serbia | FISCAL_SETUP_INCOMPLETE: einvoice_api_key_missing | no SEF API key (e-invoices) |
The venue owner fixes it in the back office; then send the request again.
Document kept without fiscalization
If the tax authority refuses the document or does not answer, the document is kept and the API answers 202:
json
{ "data": { "external_reference": "WC-10045", "fiscalized": false, "register_status": "failed",
"fiscal_error": { "code": "FISCAL_STATUS_UNKNOWN", "message": "…", "details": { } } },
"request_id": "…" }fiscal_error.code | Meaning |
|---|---|
FISCAL_REJECTED | the tax authority refused it (details says why) |
FISCAL_SERVICE_UNAVAILABLE | the tax authority could not be reached |
FISCAL_STATUS_UNKNOWN | the answer was lost; the authority may already hold the document |
Caution
Do not send such a document again under a new reference, and do not change it. It is re-sent nightly with the same identifiers (in Montenegro as a subsequent delivery with the same number and IIC); GET /orders/{reference} then shows fiscalized: true. A request with the same reference answers 409 DUPLICATE_REFERENCE with the kept document and does not contact the tax authority.
502 is answered only when nothing was stored: the day's opening deposit of a Montenegrin shared register could not be registered (FISCAL_SERVICE_UNAVAILABLE, safe to retry), or a Serbian e-invoice storno failed — after FISCAL_STATUS_UNKNOWN SEF may have taken it, so check einvoice_status before retrying.
Common codes
| Code | What to do |
|---|---|
SHIFT_CLOSED | open a shift on the key's regular register (or bind the key to a shared register) |
REGISTER_UNAVAILABLE / USER_UNAVAILABLE | the key's register or user is inactive — edit the key |
VALIDATION_ERROR | details.errors names the fields |
PRODUCT_NOT_FOUND | details.item_index names the item |
PRODUCT_TAX_MISMATCH / TAX_RATE_AMBIGUOUS / TAX_RATE_NOT_FOUND | a described item's tax rate — see Products from your system |
PAYMENT_TOTAL_MISMATCH | the payments do not add up — use details.order_total |
COUNTRY_MISMATCH | the key belongs to another country's account (send expect_country) |
DUPLICATE_REFERENCE | the reference was already used; details.order is the existing document |
VOID_NOT_ALLOWED | the document cannot be voided (details.reason) |
MARKET_NOT_SUPPORTED | the account's market is not served (Bosnia and Herzegovina) |
REGISTER_BUSY | wait the seconds in the Retry-After header, then send the same request with the same external_reference |
Busy cash register
Konty issues one document at a time on a cash register. A request that arrives while other documents are being issued waits for its turn for up to 10 seconds. If the turn does not come, the API answers 503 REGISTER_BUSY with a Retry-After header and stores no document.
Send the same request again after that many seconds, with the same external_reference. Do not send several documents for one cash register at the same moment: send them one after another.
Any other 503 (code HTTP_ERROR, or an answer without the API envelope) means the service is temporarily unavailable, for example during maintenance. Nothing was stored then either: send the same request again later, after the Retry-After header when the answer has one.
The full list of codes is in the Reference.