> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lite.sa/llms.txt
> Use this file to discover all available pages before exploring further.

# API errors

> Understand lite error responses and find the errors returned by each API.

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](#errors-from-the-api-gateway).

```json theme={null}
{
  "errors": [
    {
      "category": "CONNECTION",
      "code": "PROVIDER_CONNECTION_ERROR",
      "message": "A connection error occurred with the payment provider. Retry after a short delay.",
      "retriable": true
    }
  ],
  "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
```

A validation response contains one item for each rule that failed, so the same field can appear more than once.

| Field | Type | Presence | Description |
| - | - | - | - |
| `errors` | array | Always | One or more errors returned for the request. |
| `errors[].category` | string | Always | The broad source of the error. |
| `errors[].code` | string | Always | The machine-readable code your integration should handle. |
| `errors[].message` | string | Always | A human-readable explanation. Do not use it for program logic. |
| `errors[].retriable` | boolean | Always | Whether retrying may succeed without correcting the underlying request data. |
| `errors[].field` | string | Conditional | The request field that failed validation. |
| `request_id` | string | Always | The request identifier. If you send your own `x-correlation-id` header, lite returns that value here. Include it when contacting lite support. |

> [!NOTE]
>
> 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:

| Status | When | Body |
| - | - | - |
| 401 | The API key is missing, malformed, unknown or revoked, or the request sent an `Authorization` header | `{ "error": "unauthorized", "reason": "<reason>", "message": "...", "correlationId": "..." }`. See [Authentication errors](https://docs.lite.sa/guides/authentication.md#authentication-errors) for each `reason`. |
| 403 | The request filter matched markup or code-like text in the body, query or headers | `{ "error": { "code": 403, "message": "Forbidden", "details": "...", "timestamp": "...", "correlationId": "..." } }`, with an `X-Security-Block` header |
| 404 | The path doesn't exist | `{ "error": { "code": 404, "message": "Resource not found" } }` |
| 413 | The body is over 50 KB | Same shape as the 403 |
| 429 | Too many requests from one IP address in a short time | No JSON body to rely on |
| 503 | The authentication service is briefly unavailable | `{ "error": "service_unavailable", "message": "..." }`, with `Retry-After: 5` |

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:

```json theme={null}
{
  "errors": [
    {
      "category": "VALIDATION",
      "code": "INVALID_FIELD_VALUE",
      "message": "amount must not be less than 1",
      "field": "amount",
      "retriable": false
    },
    {
      "category": "VALIDATION",
      "code": "INVALID_FIELD_VALUE",
      "message": "amount must be an integer number",
      "field": "amount",
      "retriable": false
    },
    {
      "category": "VALIDATION",
      "code": "INVALID_FIELD_VALUE",
      "message": "currency must be one of the following values: SAR",
      "field": "currency",
      "retriable": false
    }
  ],
  "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
```

`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.

| Status | Summary | Meaning |
| - | - | - |
| 400 | Bad Request | The request is malformed, incomplete, or invalid. |
| 401 | Unauthorized | The API gateway couldn't authenticate the API key. See [Errors from the API gateway](#errors-from-the-api-gateway). |
| 403 | Forbidden | The API key lacks the permission for the operation, `x-business-account-id` names an account the key can't act on, or the gateway's request filter blocked the request. |
| 404 | Not Found | The requested payment, instrument, token, or other entity was not found. |
| 405 | Method Not Allowed | The endpoint doesn't accept this HTTP method. |
| 409 | Conflict | The request conflicts with an existing request or the resource's current state. |
| 413 | Content Too Large | The request body is over 50 KB. |
| 422 | Unprocessable Entity | The request was understood, but the payment instrument, issuer, authentication, or risk outcome prevented completion. |
| 429 | Too Many Requests | Too many requests from one IP address, or a service rate limit (payouts). |
| 500 | Internal Server Error | An unexpected error occurred inside lite. |
| 501 | Not Implemented | The operation isn't supported. |
| 502 | Bad Gateway | lite could not communicate successfully with an upstream provider. |
| 503 | Service Unavailable | A provider or payment workflow is temporarily unavailable. |
| 504 | Gateway Timeout | A provider did not respond before the timeout. |

## Error categories

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

| Category | Meaning | First action |
| - | - | - |
| `SETUP` | Authentication, permissions, merchant context, or access control. | Check credentials, context, permissions, and resource ownership. |
| `VALIDATION` | Invalid request data, duplicate requests, or missing resources. | Correct the request or verify the referenced identifier. |
| `INSTRUMENT` | The payment token or instrument is missing, expired, or invalid. | Obtain or create a valid payment instrument. |
| `ISSUER` | The issuer declined the transaction. | Ask the customer to use another card or payment method. |
| `FRAUD` | Risk controls or 3D Secure authentication prevented the operation. | Follow the code-specific action and avoid blind retries. |
| `WORKFLOW` | The operation is not allowed in the resource's current state. | Retrieve the current status before deciding the next operation. |
| `CONNECTION` | A provider or payment workflow could not be reached or completed. | Check the payment status, then retry safely when allowed. |
| `SYSTEM` | An unexpected failure occurred inside lite. | Check the payment status and retry with backoff when safe. |

## 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.

| Code | HTTP | Category | Retriable | Meaning | How to handle |
| - | - | - | - | - | - |
| `UNAUTHORIZED` | 401 | `SETUP` | No | Authentication context is missing. With an API key on `api.lite.sa`, you get the gateway's 401 instead. | Send a valid API key. |
| `FORBIDDEN` | 403 | `SETUP` | No | The API key lacks the permission for this operation, or can't act on the account in `x-business-account-id`. | Use a key with the permission, or leave out `x-business-account-id`. |
| `ENTITY_ACCESS_DENIED` | 403 | `SETUP` | No | The requested resource is not accessible to the current merchant. | Verify that the resource belongs to the authenticated merchant. |
| `INVALID_REQUEST` | 400 | `VALIDATION` | No | The request is malformed or fails a request-level business validation. | Correct the request using the endpoint documentation and resubmit it. |
| `MISSING_REQUIRED_FIELD` | 400 | `VALIDATION` | No | A required field is missing. | Add the field identified by `field`, then resubmit the request. |
| `INVALID_FIELD_VALUE` | 400 | `VALIDATION` | No | A field has an invalid value or format. | Correct the field identified by `field`, then resubmit the request. |
| `INVALID_AMOUNT` | 400 | `VALIDATION` | No | The order total does not match the authorize amount. | Correct the amount or order totals before resubmitting. |
| `TOKEN_NOT_FOUND` | 404 | `VALIDATION` | No | The referenced payment token was not found. | Verify the token ID or tokenize the payment method again. |
| `DUPLICATE_ENTITY` | 409 | `VALIDATION` | No | An entity with the same details already exists. | Retrieve and use the existing entity instead of creating another one. |
| `DUPLICATE_REQUEST` | 409 | `VALIDATION` | No | A conflicting request or resource already exists. | Reuse the original result when appropriate, or send a new unique reference. |
| `PAYMENT_NOT_FOUND` | 404 | `VALIDATION` | No | The requested payment was not found. | Verify the payment ID. |
| `ENTITY_NOT_FOUND` | 404 | `VALIDATION` | No | The requested entity was not found. | Verify the entity ID. |
| `EXPIRED_TOKEN` | 422 | `INSTRUMENT` | No | The payment token has expired. | Tokenize the card again and submit a new payment attempt. |
| `INVALID_TOKEN` | 422 | `INSTRUMENT` | No | The payment token is invalid or is not active. | Obtain a valid active token before retrying. |
| `DECLINED` | 422 | `ISSUER` | No | The issuer declined a void. A declined payment isn't an API error: see [Declines](#declines). | Retrieve the payment and decide the next operation. |
| `PAYMENT_METHOD_NOT_SUPPORTED` | 422 | `SETUP` | No | The payment method isn't enabled or supported. | Enable it on your online terminal, or use a supported method. |
| `MERCHANT_NOT_CONFIGURED` | 422 | `SETUP` | No | Your account's payment setup is incomplete. | Contact lite to complete your configuration. |
| `METHOD_NOT_ALLOWED` | 405 | `VALIDATION` | No | The endpoint doesn't accept this HTTP method. | Use the method in the API reference. |
| `RATE_LIMIT_EXCEEDED` | 429 | `VALIDATION` | Yes | Too many requests. | Wait for `retry_after_seconds` when present, then retry. |
| `NOT_IMPLEMENTED` | 501 | `SYSTEM` | No | The operation isn't supported. | Don't retry. |
| `FRAUD_DETECTED` | 422 | `FRAUD` | No | The transaction was declined for security reasons. | Do not retry the same transaction. Follow your risk-review process where applicable. |
| `RISK_DECLINED` | 422 | `FRAUD` | No | lite risk controls declined the transaction. | Review the transaction in the dashboard. Do not retry blindly. |
| `AUTHENTICATION_FAILED` | 422 | `FRAUD` | No | 3D Secure authentication failed. | Ask the customer to try again or use a different card. |
| `AUTHENTICATION_UNAVAILABLE` | 422 | `FRAUD` | Yes | The authentication service is temporarily unavailable. | Retry after a short delay. Create a new customer attempt only when required by your flow. |
| `INVALID_STATE` | 409 | `WORKFLOW` | No | The operation is not allowed in the resource's current state. | Retrieve the current status and perform an operation valid for that state. |
| `PROVIDER_TIMEOUT` | 504 | `CONNECTION` | Yes | An upstream service timed out. | Check the payment status first, then retry with backoff if the operation was not completed. |
| `PROVIDER_CONNECTION_ERROR` | 502 | `CONNECTION` | Yes | lite could not communicate successfully with an upstream provider. | Check the payment status first, then retry after a short delay. |
| `WORKFLOW_SUBMISSION_FAILED` | 503 | `CONNECTION` | Yes | The payment workflow is temporarily unavailable or could not accept the operation. | Check the payment status, then retry with backoff. |
| `PROVIDER_UNAVAILABLE` | 503 | `CONNECTION` | Yes | The payment provider is temporarily unavailable. | Retry with backoff or use an available fallback payment method. |
| `GATEWAY_TIMEOUT` | 504 | `CONNECTION` | Yes | The payment provider timed out. | Check the payment status first, then retry after a short delay. |
| `INTERNAL_ERROR` | 500 | `SYSTEM` | Yes | An unexpected error occurred inside lite. | Check the payment status before retrying. Retry with backoff and contact support if the error persists. |

## 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](https://docs.lite.sa/guides/payments-api.md#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](https://docs.lite.sa/guides/authentication.md#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.

> [accordion] The API key lacks the permission for this operation
>
> **Returned by:** Every API
>
> **HTTP 403 Forbidden** · `FORBIDDEN` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "SETUP",
>       "code": "FORBIDDEN",
>       "message": "You do not have permission to perform this action.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The API key is missing or invalid
>
> **Returned by:** The API gateway, for every API
>
> **HTTP 401 Unauthorized** · gateway body, not the `errors` array
>
> ```json theme={null}
> {
>   "error": "unauthorized",
>   "reason": "NO_CREDENTIALS",
>   "message": "Authentication failed - invalid or missing credentials",
>   "correlationId": "<correlation-id>"
> }
> ```
>
> See [Authentication errors](https://docs.lite.sa/guides/authentication.md#authentication-errors) for each `reason`.

> [accordion] The request contains an unknown field
>
> **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**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_FIELD_VALUE",
>       "message": "property foo should not exist",
>       "field": "foo",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] A required request field is missing
>
> **Returned by:** Endpoints with request validation
>
> **HTTP 400 Bad Request** · `MISSING_REQUIRED_FIELD` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "MISSING_REQUIRED_FIELD",
>       "message": "<field> should not be empty",
>       "field": "<field>",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] A request field fails validation
>
> **Returned by:** Endpoints with request validation
>
> **HTTP 400 Bad Request** · `INVALID_FIELD_VALUE` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_FIELD_VALUE",
>       "message": "<validation message>",
>       "field": "<field>",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] An unhandled failure occurs
>
> **Returned by:** Payment and instrument APIs
>
> **HTTP 500 Internal Server Error** · `INTERNAL_ERROR` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "SYSTEM",
>       "code": "INTERNAL_ERROR",
>       "message": "An unexpected error occurred. Retry with backoff. lite.sa has been alerted.",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

### Payments

#### Authorize a payment

`POST /payments`

Also returned: the [common errors](#common-errors), such as a missing permission, an unknown field, field validation, and internal errors.

> [accordion] The line items, VAT, and shipping total do not match the authorization amount
>
> **HTTP 400 Bad Request** · `INVALID_AMOUNT` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_AMOUNT",
>       "message": "Order total price does not match authorize amount",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The instrument ID is empty or is not a valid UUID
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "Payment instrument id is invalid or malformed",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The amount or currency is invalid
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "Invalid payment amount or currency",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The terminal ID is missing for a merchant-initiated POS payment
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "Terminal ID is required for merchant-initiated payments",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The payment token does not exist or was deleted
>
> **HTTP 404 Not Found** · `TOKEN_NOT_FOUND` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "TOKEN_NOT_FOUND",
>       "message": "The token was not found. Verify the token ID or re-tokenize.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The payment token has expired
>
> **HTTP 422 Unprocessable Entity** · `EXPIRED_TOKEN` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "INSTRUMENT",
>       "code": "EXPIRED_TOKEN",
>       "message": "The payment token has expired. Re-tokenize the card.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The payment token is not active
>
> **HTTP 422 Unprocessable Entity** · `INVALID_TOKEN` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "INSTRUMENT",
>       "code": "INVALID_TOKEN",
>       "message": "The payment token is invalid. Re-tokenize the card.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] lite cannot resolve the payment instrument
>
> **HTTP 422 Unprocessable Entity** · `INVALID_TOKEN` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "INSTRUMENT",
>       "code": "INVALID_TOKEN",
>       "message": "Invalid payment instrument",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] A request with the same order reference is already being processed
>
> **HTTP 409 Conflict** · `DUPLICATE_REQUEST` · Retriable: **after 60 seconds**
>
> You 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.
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "DUPLICATE_REQUEST",
>       "message": "A payment for this order reference is already being processed",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The payment instrument lookup times out
>
> **HTTP 504 Gateway Timeout** · `PROVIDER_TIMEOUT` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "CONNECTION",
>       "code": "PROVIDER_TIMEOUT",
>       "message": "The provider response timed out. Retry — check payment status first to avoid duplicates.",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The payment instrument lookup fails because of a connection error
>
> **HTTP 502 Bad Gateway** · `PROVIDER_CONNECTION_ERROR` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "CONNECTION",
>       "code": "PROVIDER_CONNECTION_ERROR",
>       "message": "A connection error occurred with the payment provider. Retry after a short delay.",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] lite cannot start the payment operation
>
> **HTTP 503 Service Unavailable** · `WORKFLOW_SUBMISSION_FAILED` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "CONNECTION",
>       "code": "WORKFLOW_SUBMISSION_FAILED",
>       "message": "Payment orchestrator is temporarily unavailable",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The original idempotent request is still processing when the wait period ends
>
> **HTTP 500 Internal Server Error** · `INTERNAL_ERROR` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "SYSTEM",
>       "code": "INTERNAL_ERROR",
>       "message": "An unexpected error occurred. Retry with backoff. lite.sa has been alerted.",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] An unexpected error occurs while resolving the payment instrument
>
> **HTTP 500 Internal Server Error** · `INTERNAL_ERROR` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "SYSTEM",
>       "code": "INTERNAL_ERROR",
>       "message": "An unexpected error occurred. Retry with backoff. lite.sa has been alerted.",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

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](#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.

> [accordion] The capture amount is zero or negative while building the request
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "Capture amount must be greater than zero",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The payment is not found
>
> An unknown payment ID, or one that belongs to another account.
>
> **HTTP 404 Not Found** · `PAYMENT_NOT_FOUND` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "PAYMENT_NOT_FOUND",
>       "message": "Payment not found",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The payment is not in a capturable state
>
> **HTTP 409 Conflict** · `INVALID_STATE` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "WORKFLOW",
>       "code": "INVALID_STATE",
>       "message": "Payment is not in a capturable state (current: <status>)",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] No amount remains available for capture
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "No remaining amount available for capture",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The resolved capture amount is zero or negative
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "Capture amount must be greater than zero",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The requested amount exceeds the remaining capturable amount
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "Capture amount (<X> minor) exceeds remaining capturable amount (<Y> minor)",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] lite cannot start the payment operation
>
> **HTTP 503 Service Unavailable** · `WORKFLOW_SUBMISSION_FAILED` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "CONNECTION",
>       "code": "WORKFLOW_SUBMISSION_FAILED",
>       "message": "Payment orchestrator is temporarily unavailable",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

#### Void a payment

`POST /payments/:paymentId/void`

Also returned: the [common errors](#common-errors), such as a missing permission, an unknown field, field validation, and internal errors.

> [accordion] The void request fails validation
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "The request is malformed. Fix the JSON structure and resubmit.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The merchant is not allowed to void the payment
>
> **HTTP 403 Forbidden** · `FORBIDDEN` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "SETUP",
>       "code": "FORBIDDEN",
>       "message": "You do not have permission to perform this action.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The payment is not found
>
> An unknown payment ID, or one that belongs to another account.
>
> **HTTP 404 Not Found** · `PAYMENT_NOT_FOUND` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "PAYMENT_NOT_FOUND",
>       "message": "Payment not found",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The payment has already been voided, captured, or is otherwise in the wrong state
>
> **HTTP 409 Conflict** · `INVALID_STATE` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "WORKFLOW",
>       "code": "INVALID_STATE",
>       "message": "This operation is not allowed in the current state. Check the current status first.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The void or authorization is declined
>
> **HTTP 422 Unprocessable Entity** · `DECLINED` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "ISSUER",
>       "code": "DECLINED",
>       "message": "The transaction was declined. Ask the customer to try a different card.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The transaction is rejected for fraud
>
> **HTTP 422 Unprocessable Entity** · `FRAUD_DETECTED` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "FRAUD",
>       "code": "FRAUD_DETECTED",
>       "message": "The transaction was declined for security reasons. Do not retry.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The transaction is rejected by risk controls
>
> **HTTP 422 Unprocessable Entity** · `RISK_DECLINED` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "FRAUD",
>       "code": "RISK_DECLINED",
>       "message": "The transaction was declined by risk controls. Review in the dashboard.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] 3D Secure authentication fails
>
> **HTTP 422 Unprocessable Entity** · `AUTHENTICATION_FAILED` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "FRAUD",
>       "code": "AUTHENTICATION_FAILED",
>       "message": "3D Secure authentication failed. Ask the customer to try again or use a different card.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The 3D Secure service times out
>
> **HTTP 422 Unprocessable Entity** · `AUTHENTICATION_UNAVAILABLE` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "FRAUD",
>       "code": "AUTHENTICATION_UNAVAILABLE",
>       "message": "Authentication service is temporarily unavailable. Retry after a short delay.",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] An upstream service cannot be reached
>
> **HTTP 502 Bad Gateway** · `PROVIDER_CONNECTION_ERROR` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "CONNECTION",
>       "code": "PROVIDER_CONNECTION_ERROR",
>       "message": "A connection error occurred with the payment provider. Retry after a short delay.",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] An unexpected error occurs while voiding the payment
>
> **HTTP 500 Internal Server Error** · `INTERNAL_ERROR` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "SYSTEM",
>       "code": "INTERNAL_ERROR",
>       "message": "An unexpected error occurred. Retry with backoff. lite.sa has been alerted.",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] lite cannot submit or process the void request
>
> **HTTP 503 Service Unavailable** · `WORKFLOW_SUBMISSION_FAILED` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "CONNECTION",
>       "code": "WORKFLOW_SUBMISSION_FAILED",
>       "message": "Payment orchestrator is temporarily unavailable",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

#### Refund a payment

`POST /payments/:paymentId/refund`

Also returned: the [common errors](#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.

> [accordion] lite cannot load the payment state
>
> **HTTP 503 Service Unavailable** · `WORKFLOW_SUBMISSION_FAILED` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "CONNECTION",
>       "code": "WORKFLOW_SUBMISSION_FAILED",
>       "message": "Failed to load payment orchestration state",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The payment is not found
>
> An unknown payment ID, or one that belongs to another account.
>
> **HTTP 404 Not Found** · `PAYMENT_NOT_FOUND` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "PAYMENT_NOT_FOUND",
>       "message": "Payment not found",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The payment does not exist or has not been captured
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "Payment not found or not yet captured",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The payment state does not contain the card brand required for the balance check
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "Card brand is required for refund balance check",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The payment is not in a refundable state
>
> **HTTP 409 Conflict** · `INVALID_STATE` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "WORKFLOW",
>       "code": "INVALID_STATE",
>       "message": "This payment is not in a state that allows for refunds (current: <status>)",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] No amount remains available for refund
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "No remaining amount available for refund",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The refund amount is zero or negative
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "Refund amount must be greater than zero",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The refund amount exceeds the remaining refundable amount
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "Refund amount (<X>) exceeds remaining refundable amount (<Y>)",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] lite cannot start the payment operation
>
> **HTTP 503 Service Unavailable** · `WORKFLOW_SUBMISSION_FAILED` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "CONNECTION",
>       "code": "WORKFLOW_SUBMISSION_FAILED",
>       "message": "Payment orchestrator is temporarily unavailable",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

#### Retrieve a payment

`GET /payments/:paymentId`

This endpoint can also return the shared missing-merchant and internal errors.

> [accordion] The payment is not found
>
> **HTTP 404 Not Found** · `PAYMENT_NOT_FOUND` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "PAYMENT_NOT_FOUND",
>       "message": "The payment was not found. Verify the payment ID.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

#### 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`.

> [accordion] `page` or `page_size` is not a positive integer
>
> **HTTP 400 Bad Request** · `INVALID_FIELD_VALUE` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_FIELD_VALUE",
>       "message": "page_size must be a positive integer",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] `page_size` is greater than 100
>
> **HTTP 400 Bad Request** · `INVALID_FIELD_VALUE` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_FIELD_VALUE",
>       "message": "page_size must not exceed 100",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] `status` is unsupported
>
> **HTTP 400 Bad Request** · `INVALID_FIELD_VALUE` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_FIELD_VALUE",
>       "message": "status must be one of: CREATED, PENDING, AUTHORIZED, FAILED, EXPIRED, AUTHORIZATION_REVERSED, VOIDED, PARTIALLY_CAPTURED, CAPTURED, REFUNDED, DISPUTED, DISPUTE_CHALLENGED, ARBITRATION_INITIATED, ARBITRATION_LOST, CHARGEDBACK, REQUIRES_ACTION",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] `payment_method` is unsupported
>
> **HTTP 400 Bad Request** · `INVALID_FIELD_VALUE` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_FIELD_VALUE",
>       "message": "payment_method must be one of: <the accepted values>",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] `from_date` is invalid
>
> **HTTP 400 Bad Request** · `INVALID_FIELD_VALUE` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_FIELD_VALUE",
>       "message": "from_date must be a valid ISO date string",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] `to_date` is invalid
>
> **HTTP 400 Bad Request** · `INVALID_FIELD_VALUE` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_FIELD_VALUE",
>       "message": "to_date must be a valid ISO date string",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] `from_date` is later than `to_date`
>
> **HTTP 400 Bad Request** · `INVALID_FIELD_VALUE` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_FIELD_VALUE",
>       "message": "from_date must be earlier than to_date",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

### Payment Links

#### Manage Payment Links

`/payment-links`

Also returned: missing authentication context, field validation, and internal errors.

> [accordion] `POST /`: `mode` and `max_uses` are inconsistent
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "The request is malformed. Fix the JSON structure and resubmit.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] `PATCH /:id`: the requested status transition is not allowed
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "Status transition ACTIVE → PAID is not allowed; only ACTIVE ↔ DISABLED is permitted",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] `PATCH /:id`: the link has already been used
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "Cannot update a payment link that has been used",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] `POST /`: `merchant_reference_id` already exists
>
> **HTTP 409 Conflict** · `DUPLICATE_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "DUPLICATE_REQUEST",
>       "message": "A payment link with this reference already exists",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] `GET /:id`, `PATCH /:id`, or `GET /:id/consumptions`: the link does not exist or belongs to another merchant
>
> **HTTP 404 Not Found** · `ENTITY_NOT_FOUND` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "ENTITY_NOT_FOUND",
>       "message": "The entity was not found. Verify the entity ID in the dashboard.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

#### Open a Payment Link

`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:

```text theme={null}
?status=not_found
?status=expired
?status=inactive
?status=used_up
?status=unavailable
?status=error
```

No JSON body is returned in this channel.

Without a status URL, the route returns JSON errors:

> [accordion] The link does not exist
>
> **HTTP 404 Not Found** · `ENTITY_NOT_FOUND` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "ENTITY_NOT_FOUND",
>       "message": "The entity was not found. Verify the entity ID in the dashboard.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The link can't take another payment
>
> **HTTP 409 Conflict** · `INVALID_STATE` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "WORKFLOW",
>       "code": "INVALID_STATE",
>       "message": "Payment link is no longer available",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] lite cannot create the checkout session
>
> **HTTP 502 Bad Gateway** · `PROVIDER_CONNECTION_ERROR` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "CONNECTION",
>       "code": "PROVIDER_CONNECTION_ERROR",
>       "message": "A connection error occurred with the payment provider. Retry after a short delay.",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The link is expired, paid, disabled, or has reached its usage limit
>
> **HTTP 409 Conflict** · `INVALID_STATE` · Retriable: **No**
>
> The message names the reason, for example `Payment link has expired`, `Payment link is not active` or `Payment link is no longer available`. Don't retry: the link can't take a payment.
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "WORKFLOW",
>       "code": "INVALID_STATE",
>       "message": "Payment link has expired",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The consumption record cannot be created
>
> **HTTP 500 Internal Server Error** · `INTERNAL_ERROR` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "SYSTEM",
>       "code": "INTERNAL_ERROR",
>       "message": "An unexpected error occurred. Retry with backoff. lite.sa has been alerted.",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

### 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`.

> [accordion] Field validation fails
>
> **HTTP 400 Bad Request** · `MISSING_REQUIRED_FIELD` or `INVALID_FIELD_VALUE` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "MISSING_REQUIRED_FIELD",
>       "message": "Invalid input: expected string, received undefined",
>       "field": "holder_id",
>       "retriable": false
>     },
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_FIELD_VALUE",
>       "message": "cardNumber must be 12-19 digits",
>       "field": "pan_data.card_number",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

| Field | Returned message |
| - | - |
| `pan_data.card_number` | `cardNumber must be 12-19 digits` |
| `pan_data.expiry_month` | `expiryMonth must be a valid month in MM format` |
| `pan_data.expiry_year` | `expiryYear must be 2 digits (YY)` |
| `pan_data.cvc` | `cvc must be 3 or 4 digits` |
| `pan_data.holder_name` | `holderName must contain only letters and spaces` |
| `pan_data` | `One of panData, paymentToken, or data must be provided` |
| Any missing required field | A validator message such as `Invalid input: expected string, received undefined` |

Other create errors:

> [accordion] The payment method is unsupported
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "Unsupported payment method",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] Apple Pay `data` is not valid JSON
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "Invalid data format. Expected valid JSON string.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The payment token cannot be decrypted
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "Failed to decrypt payment token. Payment token decryption failed or returned invalid data.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] lite cannot process the Apple Pay data
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "Failed to map payment data to CDMA format",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] Card details are missing
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "PAN data is required",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] lite cannot tokenize or save the instrument
>
> **HTTP 500 Internal Server Error** · `INTERNAL_ERROR` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "SYSTEM",
>       "code": "INTERNAL_ERROR",
>       "message": "An unexpected error occurred. Retry with backoff. lite.sa has been alerted.",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] lite cannot create the instrument
>
> **HTTP 500 Internal Server Error** · `INTERNAL_ERROR` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "SYSTEM",
>       "code": "INTERNAL_ERROR",
>       "message": "Failed to CreateInstrument",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

A duplicate fingerprint with `future_usage` returns the existing instrument with HTTP 201. It is not returned as an error.

#### List instruments

`GET /instruments`

> [accordion] The lookup input fails validation
>
> **Response:** `400 MISSING_REQUIRED_FIELD` or `400 INVALID_FIELD_VALUE`\
> **Retriable:** No
>
> Field validation can return one error per invalid field:
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "MISSING_REQUIRED_FIELD",
>       "message": "<field> should not be empty",
>       "field": "<field>",
>       "retriable": false
>     },
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_FIELD_VALUE",
>       "message": "<validation message>",
>       "field": "<field>",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] lite cannot list instruments
>
> **HTTP 500 Internal Server Error** · `INTERNAL_ERROR` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "SYSTEM",
>       "code": "INTERNAL_ERROR",
>       "message": "Failed to LookupInstruments",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

#### Retrieve an instrument

`GET /instruments/:id`

> [accordion] The instrument is not found
>
> **HTTP 404 Not Found** · `ENTITY_NOT_FOUND` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "ENTITY_NOT_FOUND",
>       "message": "The requested instrument was not found.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The instrument belongs to another merchant
>
> **HTTP 403 Forbidden** · `ENTITY_ACCESS_DENIED` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "SETUP",
>       "code": "ENTITY_ACCESS_DENIED",
>       "message": "Access denied to this instrument.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] lite cannot retrieve the instrument
>
> **HTTP 500 Internal Server Error** · `INTERNAL_ERROR` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "SYSTEM",
>       "code": "INTERNAL_ERROR",
>       "message": "Failed to GetInstrumentById",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

#### Update an instrument

`PUT /instruments/action`

> [accordion] `instrument_id` or `action_type` fails validation
>
> **Response:** `400 MISSING_REQUIRED_FIELD` or `400 INVALID_FIELD_VALUE`\
> **Retriable:** No
>
> Field validation can return one error per invalid field:
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "MISSING_REQUIRED_FIELD",
>       "message": "<field> should not be empty",
>       "field": "<field>",
>       "retriable": false
>     },
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_FIELD_VALUE",
>       "message": "<validation message>",
>       "field": "<field>",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The instrument is not found
>
> **HTTP 404 Not Found** · `ENTITY_NOT_FOUND` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "ENTITY_NOT_FOUND",
>       "message": "The requested instrument was not found.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The requested action is not publicly supported
>
> **HTTP 400 Bad Request** · `INVALID_REQUEST` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "VALIDATION",
>       "code": "INVALID_REQUEST",
>       "message": "<Action description> is not currently supported",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] The action is not allowed in the instrument's current state
>
> **HTTP 409 Conflict** · `INVALID_STATE` · Retriable: **No**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "WORKFLOW",
>       "code": "INVALID_STATE",
>       "message": "This operation is not allowed in the current state. Check the current status first.",
>       "retriable": false
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

> [accordion] lite cannot update the instrument
>
> **HTTP 500 Internal Server Error** · `INTERNAL_ERROR` · Retriable: **Yes**
>
> ```json theme={null}
> {
>   "errors": [
>     {
>       "category": "SYSTEM",
>       "code": "INTERNAL_ERROR",
>       "message": "An unexpected error occurred. Retry with backoff. lite.sa has been alerted.",
>       "retriable": true
>     }
>   ],
>   "request_id": "<request-id>"
> }
> ```

An action that leaves the instrument in its existing state returns success rather than an error.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.