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

# Errors

> Understand error codes, response structures, and recovery strategies.

Rails B2B API uses standard HTTP response codes to indicate the success or failure of an API request. In general:

* Codes in the `2xx` range indicate success.
* Codes in the `4xx` range indicate an error that failed given the information provided.
* Codes in the `5xx` range indicate a service error (e.g. liquidity or bridge issues).

### Error Response Schema

All error responses return the standard envelope with `status: "error"`, where `data` contains a machine-readable code and detail attributes.

```json Error Payload theme={null}
{
  "status": "error",
  "message": "Validation failed",
  "data": {
    "code": "INSUFFICIENT_LP_LIQUIDITY",
    "detail": "No settlement capacity available for the requested corridor and amount."
  }
}
```

### Machine-Readable Error Codes

When writing logic to handle errors programmatically, inspect the `data.code` string:

| Code String                   | HTTP Status | Meaning & Resolution                                                               |
| :---------------------------- | :---------- | :--------------------------------------------------------------------------------- |
| `UNAUTHENTICATED`             | `401`       | Missing or invalid auth header or API key.                                         |
| `FORBIDDEN`                   | `403`       | The authenticated profile lacks the required scope (e.g. sender profile required). |
| `INVALID_REQUEST`             | `400`       | Bad payload structure, missing parameters, or invalid format.                      |
| `UNSUPPORTED_CURRENCY`        | `400`       | The selected target fiat currency is not supported or not active.                  |
| `UNSUPPORTED_COIN`            | `400`       | The selected stablecoin type is not supported in the Move Gateway.                 |
| `RECIPIENT_VALIDATION_FAILED` | `400`       | Payout bank account failed validation pre-check.                                   |
| `IDEMPOTENCY_KEY_MISMATCH`    | `409`       | Replayed request payload does not match the first cached request.                  |
| `INSUFFICIENT_LP_LIQUIDITY`   | `503`       | No settlement capacity available for the requested corridor and amount.            |
| `BRIDGE_UNAVAILABLE`          | `503`       | LiFi quote failed, or all bridge nodes are offline.                                |
| `MATCHING_PAUSED`             | `503`       | Order matching is temporarily paused for maintenance.                              |
| `RATE_LIMITED`                | `429`       | Requests exceeded the throttling limits. Back off and retry.                       |
| `INTERNAL_ERROR`              | `500`       | Server-side exception. Correlate with request logs.                                |
