Skip to Content

Errors

Inferio splits errors across two surfaces:

  1. Transport layer — HTTP 4xx / 5xx for auth, network, and Inferio-side incidents. Your client retry logic handles these.
  2. Application layer — HTTP 200 with a JSON body containing error_code. These mean the request was understood but business logic said no (session expired, file too large, etc.). Your application logic handles these.

Transport-layer errors

HTTP codeMeaningRetry?
400Malformed request — bad JSON, missing required fieldNo (fix the call)
401Missing / malformed / revoked Authorization headerNo (rotate token)
403Token valid but X-Merchant-ID mismatchNo (fix header)
404Resource not found (request_id, document_id, session_id) — could be soft-deletedNo (verify ID)
409Idempotency-Key collision with a different payloadNo (use new key)
413File too large at the transport layer (before per-merchant limits)No (split file)
429Rate-limitedYes (exponential backoff)
5xxInferio-side incidentYes (3 attempts, exp. backoff)

Application-layer errors (HTTP 200 + error_code)

Returned with shape:

{ "error_code": "UPLOAD_SESSION_EXPIRED", "message": "Upload session expired at 2026-04-30T03:18:02Z", "details": { "session_id": "f47ac10b-…", "expired_at": "..." }, "trace_id": "trace_3fa1c4e2b9d1" }

Upload-session codes

error_codeMeaning
UPLOAD_SESSION_NOT_FOUNDBad session_id — typo or expired
UPLOAD_SESSION_EXPIREDTTL elapsed (default 24h)
UPLOAD_SESSION_MISMATCHSession belongs to a different merchant
FILE_TOO_LARGEOver per-file limit_size_mb
FILE_COUNT_EXCEEDEDPast limit_file in this session
UNSUPPORTED_FILE_TYPENot PDF / PNG / JPG / TIFF

Request codes

error_codeMeaning
INVALID_DOCUMENT_TYPEdocument_type not in the built-in template list or custom-schema set
WEBHOOK_URL_INVALIDwebhook_url not HTTPS or unreachable
MERCHANT_CREDITS_EXHAUSTEDTrial credits gone + no billing on file

Document / extraction codes

error_codeMeaning
LLM_REJECTEDLLM declined to extract — wrong doc type, unreadable, etc. Not billed.
EXTRACTION_TIMEOUTLLM took longer than request_timeout_ms (default 60s)
VALIDATION_FAILEDDomain-validator caught a bad value (e.g. invalid T-number format)

T-number-specific codes

error_codeMeaning
T_NUMBER_INVALID_FORMATExtracted T-number doesn’t match the 13-digit shape T\d{13}
T_NUMBER_NOT_REGISTEREDNTA API returns “not found” for the number
T_NUMBER_REVOKEDNTA API returns “revoked” — invoice is no longer tax-deductible
T_NUMBER_API_UNAVAILABLENTA public API is down — document marked as “needs review” and you can re-validate later

Always log trace_id

Every error response carries a trace_id. Surface it in your logs and quote it when contacting support — we can pull the full request + extraction trail from a single trace_id, often skipping the back-and-forth.