Lunch
Guides

Errors

All errors return the same JSON format, including validation, authentication, not-found, upstream and unknown-path errors.

JSONCode
{ "error": "The request does not match the published schema", "code": "invalid_request" }
FieldDescription
codeStable error code. Branch on this field.
errorHuman-readable message for logs. May change.

Each operation in the reference lists its codes. New codes may be added. Existing codes are never removed or redefined. Handle unknown codes with a default branch.

Common Codes

Any operation can return these codes.

CodeStatusDescription
invalid_request400Body or path does not match the schema.
unreadable_request400Body does not match its declared media type.
unauthorized401Key missing, malformed or revoked.
payload_too_large413Body exceeds the size limit.
upstream_failed502Failure at Lunch or an upstream provider.
unknown_endpoint404Path not supported.

unknown_endpoint is not listed under any operation. It is returned as JSON, not plain text.

Codes to Handle by Name

CodeDescription
business_not_found, invoice_not_found, import_not_found, subscription_not_foundUsually an identifier that has not been synced.
invoice_not_financeable409. The invoice is not eligible for an advance. See Requesting an Advance.
business_not_eligible409. Onboarding is incomplete. See Requesting an Advance.
concentration_exceeded409. The vendor's limit would be exceeded. See Requesting an Advance.
already_subscribedThe endpoint is already subscribed.
already_importedThe import identifier was already used for a different file.
invalid_routing_numberInvalid routing number.
invalid_inviteeInvalid invitee.
self_dealingAn organization attempted to take an advance on its own invoice.
unsupported_media_type, unreadable_fileInvoice import errors.
too_many_rowsImport exceeds 1000 rows.
destination_refusedWebhook URL not allowed.

Retrying

Retry 502 with backoff. 4xx errors repeat until the request or the underlying state changes. For timeouts, see Idempotent Requests.

What's Next

Last modified on