# The Error object

> Every response that is not a success has exactly this envelope, whatever went wrong.

Source: https://rais.app/docs/api/objects/error

The `request_id` is also in the `Rais-Request-Id` response header: quote it when you contact support.

## Attributes

- `error` (object): The error. Every non-2xx response of the API has exactly this envelope.
  - `type` (string): The category of the error. It decides how to react (fix the request, retry, call support). One of `authentication_error`, `permission_error`, `invalid_request_error`, `not_found_error`, `idempotency_error`, `rate_limit_error`, `api_error`, `payment_error`.
  - `code` (string): A stable, machine-readable identifier of the problem (see the list of error codes).
  - `message` (string): A human-readable explanation, safe to show to a developer.
  - `param` (string, nullable): The request parameter the error is about, if any.
  - `request_id` (string): The identifier of the request (also in the Rais-Request-Id header). Quote it to support.

## Example

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "amount_too_small",
    "message": "The minimum amount is 50.00 DA (5000 centimes).",
    "param": "amount",
    "request_id": "req_8f3a1c9d2b7e4a60"
  }
}
```
