Skip to main content
The lite API returns structured errors that help you understand what failed, fix the request, and retry safely when the outcome is uncertain. Use the first sections to understand the error model. Use Errors by API to see the responses each operation returns. Payment states such as AUTHORIZED, CAPTURED, VOIDED, and REFUNDED describe the payment lifecycle and are documented separately.

Read an error

Errors raised by lite’s services return an errors array and a request_id. Errors raised by the API gateway in front of them, such as a missing API key or an unknown path, use other shapes: see Errors from the API gateway.
A validation response contains one item for each rule that failed, so the same field can appear more than once.
Fields such as documentation_url, routing_attempts, error_id, business_id, and entity_id are not currently returned. retry_after_seconds is returned with RATE_LIMIT_EXCEEDED on payouts: wait that many seconds before you retry.

Errors from the API gateway

lite’s API gateway checks every request before it reaches a service. Its errors don’t use the errors array, so read the status first: Quote the correlationId from the body, or the X-Correlation-Id response header, when you contact lite support.

Validation errors

Field-level validation returns MISSING_REQUIRED_FIELD or INVALID_FIELD_VALUE. MISSING_REQUIRED_FIELD is used only for fields that must be present, such as device. Every other failed rule, including most missing fields, returns INVALID_FIELD_VALUE. For example, a POST /payments without amount and with currency: "USD" returns:
field is the property path in camelCase, such as captureOptions.captureMode for capture_options.capture_mode. Branch on code and field, never on message. Fix every field listed before you resubmit the request.

HTTP status codes

The HTTP status identifies the general class of failure. Use the error code for application logic.

Error categories

Every error belongs to a category. Use it as a fallback when your integration receives a code it does not recognize.

Error codes

These are the error codes the payment, checkout session, payment link and instrument services return. Settlement and payout codes are in the Account Settlement API reference.

Declines

A declined card isn’t an API error. POST /payments returns 202, and the payment then moves to FAILED. The issuer’s answer is on the authorize operation: call GET /payments/{payment_id}?include=operations and read its response code and message, or take it from the payment.failed webhook. Only a void returns a decline as an error (422 DECLINED). connector_response_code is the gateway’s result code: for MPGS, its gatewayCode, such as DECLINED, INSUFFICIENT_FUNDS or EXPIRED_CARD. lite doesn’t mark a decline as temporary or permanent: reason is Authorization declined for a decline and another message for a technical failure. To tell a decline from a failed 3D Secure, see Why a payment failed.

Retry failed requests

Branch on code. For an unknown code, use category to identify the type of problem and retriable to determine whether a retry may succeed. Never branch on message. A retriable: true response permits a controlled retry. It does not confirm that the original payment operation failed. For payment operations, retrieve the payment status before retrying or creating another payment attempt. This prevents duplicate authorizations, captures, voids, or refunds. Use exponential backoff and cap the number of attempts. Stop retrying when the operation reaches a final state or when the retry limit is reached. A retriable: false response requires a change before another attempt, such as correcting the request, using another payment instrument, or waiting for a valid workflow state. Log the request_id for every failed request and include it when contacting lite support. Retries and idempotency. A retry of POST /payments with the same x-idempotency-key within 120 seconds gets the first response again, even if that was an error. After 120 seconds the key is forgotten. After a 5xx or a timeout on POST /payments, call GET /payments?order_id=<reference>: if a payment is there, follow it, and if not, retry with a new x-idempotency-key. Always send order.reference: while a payment for that reference exists and isn’t FAILED, EXPIRED, VOIDED or AUTHORIZATION_REVERSED, lite returns it instead of charging again. To check a payment before retrying, call GET /payments/{payment_id}, or GET /payments?order_id=<reference> when you don’t have its id. See Retries and duplicate requests.

Errors by API

Find the errors each lite API can return. Open an example to see the response body. The message text can vary, so branch on code. Values such as <request-id> and <status> are generated at runtime.

Common errors

These responses are shared by several APIs. Each endpoint section identifies the shared responses that apply.
Returned by: Every APIHTTP 403 Forbidden · FORBIDDEN · Retriable: No
Returned by: The API gateway, for every APIHTTP 401 Unauthorized · gateway body, not the errors array
See Authentication errors for each reason.
Returned by: Payment and payment link APIs. Instrument create returns a generic INVALID_REQUEST instead. camelCase keys are accepted.HTTP 400 Bad Request · INVALID_FIELD_VALUE · Retriable: No
Returned by: Endpoints with request validationHTTP 400 Bad Request · MISSING_REQUIRED_FIELD · Retriable: No
Returned by: Endpoints with request validationHTTP 400 Bad Request · INVALID_FIELD_VALUE · Retriable: No
Returned by: Payment and instrument APIsHTTP 500 Internal Server Error · INTERNAL_ERROR · Retriable: Yes

Payments

Authorize a payment

POST /payments Also returned: the common errors, such as a missing permission, an unknown field, field validation, and internal errors.
HTTP 400 Bad Request · INVALID_AMOUNT · Retriable: No
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 404 Not Found · TOKEN_NOT_FOUND · Retriable: No
HTTP 422 Unprocessable Entity · EXPIRED_TOKEN · Retriable: No
HTTP 422 Unprocessable Entity · INVALID_TOKEN · Retriable: No
HTTP 422 Unprocessable Entity · INVALID_TOKEN · Retriable: No
HTTP 409 Conflict · DUPLICATE_REQUEST · Retriable: after 60 secondsYou sent the same order.reference less than 60 seconds after an earlier attempt that left no live payment, for example one that failed. retriable is false because an immediate retry gets the same error: lite holds each order.reference for 60 seconds after an attempt. After that, retry with the same reference.
HTTP 504 Gateway Timeout · PROVIDER_TIMEOUT · Retriable: Yes
HTTP 502 Bad Gateway · PROVIDER_CONNECTION_ERROR · Retriable: Yes
HTTP 503 Service Unavailable · WORKFLOW_SUBMISSION_FAILED · Retriable: Yes
HTTP 500 Internal Server Error · INTERNAL_ERROR · Retriable: Yes
HTTP 500 Internal Server Error · INTERNAL_ERROR · Retriable: Yes
If an earlier request with the same idempotency key already failed, lite replays the original HTTP status and error body.

Capture a payment

POST /payments/:paymentId/capture Also returned: the common errors, such as a missing permission, an unknown field, field validation, and internal errors. Every capture 400 uses INVALID_REQUEST, so check what’s left before you send. An unknown payment ID returns 404 PAYMENT_NOT_FOUND instead.
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
An unknown payment ID, or one that belongs to another account.HTTP 404 Not Found · PAYMENT_NOT_FOUND · Retriable: No
HTTP 409 Conflict · INVALID_STATE · Retriable: No
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 503 Service Unavailable · WORKFLOW_SUBMISSION_FAILED · Retriable: Yes

Void a payment

POST /payments/:paymentId/void Also returned: the common errors, such as a missing permission, an unknown field, field validation, and internal errors.
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 403 Forbidden · FORBIDDEN · Retriable: No
An unknown payment ID, or one that belongs to another account.HTTP 404 Not Found · PAYMENT_NOT_FOUND · Retriable: No
HTTP 409 Conflict · INVALID_STATE · Retriable: No
HTTP 422 Unprocessable Entity · DECLINED · Retriable: No
HTTP 422 Unprocessable Entity · FRAUD_DETECTED · Retriable: No
HTTP 422 Unprocessable Entity · RISK_DECLINED · Retriable: No
HTTP 422 Unprocessable Entity · AUTHENTICATION_FAILED · Retriable: No
HTTP 422 Unprocessable Entity · AUTHENTICATION_UNAVAILABLE · Retriable: Yes
HTTP 502 Bad Gateway · PROVIDER_CONNECTION_ERROR · Retriable: Yes
HTTP 500 Internal Server Error · INTERNAL_ERROR · Retriable: Yes
HTTP 503 Service Unavailable · WORKFLOW_SUBMISSION_FAILED · Retriable: Yes

Refund a payment

POST /payments/:paymentId/refund Also returned: the common errors, such as a missing permission, an unknown field, field validation, and internal errors. Every refund 400 uses INVALID_REQUEST, so check what’s left before you send. An unknown payment ID returns 404 PAYMENT_NOT_FOUND instead.
HTTP 503 Service Unavailable · WORKFLOW_SUBMISSION_FAILED · Retriable: Yes
An unknown payment ID, or one that belongs to another account.HTTP 404 Not Found · PAYMENT_NOT_FOUND · Retriable: No
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 409 Conflict · INVALID_STATE · Retriable: No
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 503 Service Unavailable · WORKFLOW_SUBMISSION_FAILED · Retriable: Yes

Retrieve a payment

GET /payments/:paymentId This endpoint can also return the shared missing-merchant and internal errors.
HTTP 404 Not Found · PAYMENT_NOT_FOUND · Retriable: No

List payments

GET /payments This endpoint can also return the shared missing-merchant and internal errors. All query validation failures return 400 INVALID_FIELD_VALUE with retriable: false.
HTTP 400 Bad Request · INVALID_FIELD_VALUE · Retriable: No
HTTP 400 Bad Request · INVALID_FIELD_VALUE · Retriable: No
HTTP 400 Bad Request · INVALID_FIELD_VALUE · Retriable: No
HTTP 400 Bad Request · INVALID_FIELD_VALUE · Retriable: No
HTTP 400 Bad Request · INVALID_FIELD_VALUE · Retriable: No
HTTP 400 Bad Request · INVALID_FIELD_VALUE · Retriable: No
HTTP 400 Bad Request · INVALID_FIELD_VALUE · Retriable: No
/payment-links Also returned: missing authentication context, field validation, and internal errors.
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 409 Conflict · DUPLICATE_REQUEST · Retriable: No
GET /pay/:token This is a customer-facing route. When a payment-link status URL is configured, errors redirect to that page with one of these query values:
No JSON body is returned in this channel. Without a status URL, the route returns JSON errors:
HTTP 502 Bad Gateway · PROVIDER_CONNECTION_ERROR · Retriable: Yes
HTTP 500 Internal Server Error · INTERNAL_ERROR · Retriable: Yes

Instruments

/instruments Also returned: missing authentication context, malformed request, field validation, and internal errors.

Create an instrument

POST /instruments Field-level validation can return several errors in one response. Missing fields use MISSING_REQUIRED_FIELD; other constraints use INVALID_FIELD_VALUE.
HTTP 400 Bad Request · MISSING_REQUIRED_FIELD or INVALID_FIELD_VALUE · Retriable: No
Other create errors:
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 500 Internal Server Error · INTERNAL_ERROR · Retriable: Yes
HTTP 500 Internal Server Error · INTERNAL_ERROR · Retriable: Yes
A duplicate fingerprint with future_usage returns the existing instrument with HTTP 201. It is not returned as an error.

List instruments

GET /instruments
Response: 400 MISSING_REQUIRED_FIELD or 400 INVALID_FIELD_VALUE
Retriable: No
Field validation can return one error per invalid field:
HTTP 500 Internal Server Error · INTERNAL_ERROR · Retriable: Yes

Retrieve an instrument

GET /instruments/:id
HTTP 404 Not Found · ENTITY_NOT_FOUND · Retriable: No
HTTP 403 Forbidden · ENTITY_ACCESS_DENIED · Retriable: No
HTTP 500 Internal Server Error · INTERNAL_ERROR · Retriable: Yes

Update an instrument

PUT /instruments/action
Response: 400 MISSING_REQUIRED_FIELD or 400 INVALID_FIELD_VALUE
Retriable: No
Field validation can return one error per invalid field:
HTTP 404 Not Found · ENTITY_NOT_FOUND · Retriable: No
HTTP 400 Bad Request · INVALID_REQUEST · Retriable: No
HTTP 409 Conflict · INVALID_STATE · Retriable: No
HTTP 500 Internal Server Error · INTERNAL_ERROR · Retriable: Yes
An action that leaves the instrument in its existing state returns success rather than an error.