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

# Errors

> Overview of xPay's HTTP response codes and error meanings.

xPay uses standard HTTP response codes to indicate the success or failure of an API request. Codes in the `2xx` range signify success. Codes in the `4xx` range indicate client-side errors based on the information provided. Codes in the `5xx` range indicate errors related to xPay's servers.

**Below is the list of HTTP status codes**

| Code  | Reason                | Potential Root Cause                                                                                                                        |
| ----- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `200` | Request is OK         | The request was successfully received and processed.                                                                                        |
| `400` | Bad Request           | There’s something wrong about the request. Potentially incorrect parameters, insufficient parameters, or an issue with authentication.      |
| `401` | Unauthorized          | You do not have access to the requested resource or your API keys are incorrect.                                                            |
| `404` | Resource Not Found    | You're likely hitting the wrong endpoint or the resource does not exist.                                                                    |
| `409` | Conflict              | Multiple idempotent requests were hit concurrently.                                                                                         |
| `429` | Too Many Requests     | You have exceeded the rate limit. Please slow down your request rate. See [Rate Limits](/developer-resources/rate-limits) for more details. |
| `500` | Internal Server Error | Likely a server-side issue on xPay's side.                                                                                                  |

Most errors in xPay will include an error code that can be used to handle the issue programmatically, along with a description that explains the reported problem.

## Attributes of the error object

Example error object:

```json HTTP Status Code: 500 theme={null}
{
  "errorCode": "internal_server_error",
  "errorDescription": "An unexpected error occurred on the server."
}
```

<ParamField path="errorCode" type="string">
  A unique code representing the type of error that occurred. This code is used to identify specific issues and facilitate troubleshooting.
</ParamField>

<ParamField path="errorDescription" type="string">
  A detailed message explaining the error represented by the error code. This description provides additional context to help understand the cause of the error.
</ParamField>

## Error codes

Below is a list of error codes that xPay may return in the `errorCode` field, along with information on how to resolve them.

| Error Code              | Description                                                                                                                                                                       |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `internal_server_error` | Indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.                                                                      |
| `bad_request`           | The server cannot or will not process the request due to a client error (e.g., malformed request syntax).                                                                         |
| `resource_not_found`    | The server can't find the requested resource, which could mean the URL is incorrect or the resource has been removed.                                                             |
| `rate_limit_exceeded`   | You have exceeded the rate limit. Please slow down your request rate and implement proper retry mechanisms. See [Rate Limits](/developer-resources/rate-limits) for more details. |
| `unauthorized`          | The request requires user authentication. If the request lacks valid authentication credentials, the server responds with this error.                                             |
| `conflict`              | Returned when multiple idempotent requests are concurrently hit.                                                                                                                  |
