Books by finzkoDevelopers

Errors

Stable string codes you can branch on. HTTP status carries the severity; code carries the contract.

Error envelope

{
  "code": "validation.invalid_value",
  "message": "place_of_supply must be a valid GST state code.",
  "field": "place_of_supply",
  "details": { "received": "INKA" }
}

Errors are flat — no nested error wrapper. Branch on code, show message to humans, use field + details for form validation.

Errors raised by a route also carry a request_id (the same value as the X-Request-Id response header), which support asks for. The two middleware layers that run before a route, idempotency and rate limiting, answer with just code and message: those bodies have no request_id, so for them log the response headers and the time of the call instead.

Auth errors

CodeHTTPMeaning
auth.missing_token401No Authorization header.
auth.invalid_token401Token unknown or malformed.
auth.revoked_token401Token was explicitly revoked.
auth.expired_token401Token past its expires_at.
auth.insufficient_scope403Token lacks the required scope.
auth.org_mismatch403?organization_id disagrees with single-org token.
auth.missing_organization_id400Multi-org token needs ?organization_id.
auth.no_membership403User has no active membership in that org.

Validation errors

CodeHTTPMeaning
validation.required_field400A required field is missing.
validation.invalid_value400Wrong type or out of range. Also returned when an allocation exceeds the payment's unapplied balance or the target's outstanding balance — see Allocating payments. details carries the numbers to retry with.
validation.failed422Body or query parameters failed schema.
validation.duplicate_resource409The anti-duplicate guard refused a create (invoice or payment with the same contact, date, amount and reference). details names the existing record. Change the reference, or retry with the same Idempotency-Key to get the original response.

Resource errors

CodeHTTPMeaning
not_found.resource404Resource doesn't exist in this org.
conflict.idempotency_key_reused409The fallback code for a 409 raised with a plain text message and no code of its own. Despite the name it does not prove a key was reused: read message for the actual conflict. A reused Idempotency-Key with a different body replays the original response instead.
period.locked409The document date falls in a closed accounting period, so nothing was written. A soft-closed period also refuses API tokens: only an Owner or Admin signed in to the app can post into it. details carries the period (id, short_code, name, status), the date and soft_closed. Reopen the period in the app, or date the entry in an open period.
bill.delete_refused409The bill cannot be deleted. details.reason is posted, has_payments, asset_linked, stock_consumed (with details.blockers[]) or cancelled: a cancelled bill is kept on record and cannot be deleted. See Bills.
rate_limit.exceeded429Per-token rate limit hit. Retry-After header set. No request_id in the body.

Idempotency errors

See Idempotency. The first is raised by the route; the other two by the idempotency middleware, so their bodies carry no request_id.

CodeHTTPMeaning
idempotency.key_required400The endpoint moves money or creates a document and needs an Idempotency-Key header. Send a unique key per logical operation and the same key on every retry.
idempotency.invalid_key400The key is longer than 200 characters or has characters other than letters, digits, -, _ and :.
idempotency.in_flight409Another request with this key is still running. Wait for Retry-After (2 seconds) and retry with the same key.

Period and credit/debit note void errors

A void posts a reversal and never deletes the original entry, so these refusals leave the books exactly as they were.

CodeHTTPMeaning
period.locked409Also returned when the void's reversal date falls in a closed period. Pass a void_date in an open period.
note.gst_period_filed409The note's GSTR-1 (GSTR-3B, for its period or a later one, for a vendor-side note) is recorded as filed, so it was reported and cannot be voided, whatever you send. Customer side, issue the counter-document instead: a debit note against the original invoice for a credit note (s.34(3)), a credit note for a debit note (s.34(1)), or amend it in Table 9C of a later GSTR-1. Vendor side, record the supplier's counter-note in the current period and adjust ITC in GSTR-3B Table 4. details.reason_code is GSTR1_FILED or GSTR3B_FILED.
note.gst_lock_override_required409The return is past its due date (GSTR-1: the 11th, QRMP the 13th; GSTR-3B for a vendor-side note: the 20th, QRMP the 22nd) but not recorded as filed. Retry with unlock: true, unlock_reason (10 or more characters) and confirm_not_reported: true. Only a token whose user is an Owner or Admin may do this; the override is audited. Without it, issue the counter-document.
note.invoice_balance_insufficient409Debit note void: a receipt has already consumed the invoice balance the note added. details carries invoice_balance, note_total and shortfall. Unallocate the receipt from the invoice, or issue a credit note.
note.stock_consumed409Credit note void: the goods it took back into stock have already been sold or adjusted. details.blockers[] lists each item with item_id, location, returned, on_hand and shortfall. Reverse those movements first, or issue a debit note.
validation.invalid_value422 / 409On a note void: void_date earlier than the note's own date is a 422 with field: void_date; a note that has been applied is a 409.

Server errors

CodeHTTPMeaning
server.internal_error500Unexpected failure. Retry; if it persists, send support the X-Request-Id (the body carries the same request_id). A sandbox token (aibk_pat_test_) also gets the exception class and the tail of the traceback in details.