> For the complete documentation index, see [llms.txt](https://docs.oxapay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.oxapay.com/api-reference/error.md).

# Error

**API Error Responses**

When an error occurs in the OxaPay API, the response will be structured in a standardized format. This allows users to easily identify and address issues with their requests. Below is an overview of the error response structure, the possible status codes, and the types of errors you may encounter.

{% tabs %}
{% tab title="Error response structure" %}

```json
{
  "data": {},
  "message": string, // A message containing additional information about the result of the request.
  "error": {
    "type": string,
    "key": string,
    "message": string
  } || {}, // An object that provides details about any errors that occurred.
  "status": integer, // The status of the request response. Typically provided as a numeric code (e.g., 200 for success or other codes for errors).
  "version": string // The version of the API being used.
}
```

{% endtab %}
{% endtabs %}

#### Statuses

| **Status Code**               | **Meaning**                                               | **Common Causes**                                                               |
| ----------------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------- |
| **200 OK**                    | The request was successful.                               | The request was processed without errors.                                       |
| **400 Bad Request**           | The request was invalid or malformed.                     | Missing required fields, invalid data format, or unacceptable parameter values. |
| **401 Unauthorized**          | The user is not authenticated or has invalid credentials. | Missing or invalid API key, incorrect session or token.                         |
| **404 Not Found**             | The requested resource could not be found.                | The resource doesn't exist or the endpoint is incorrect.                        |
| **500 Internal Server Error** | An unexpected server-side error occurred.                 | Server failure, issues with third-party integrations or dependencies.           |
| **503 Service Unavailable**   | One of the services is temporarily unavailable.           | Server overload, service downtime, or maintenance.                              |
