# The Error object

> The body of every failed call.

Source: https://fx-port.com/docs/api/objects/error

Parse `errors[]`: each entry has a stable `code`, a `type` that tells you how to react, a human `message` and, when there is one, the `field` at fault. The older keys (`detail`, `error`, `message`, `code`) stay in the body for integrations written before `errors[]` existed. See the Errors guide.

## Attributes

- `environment` (string): The environment of the key that made the call: `sandbox` for fxp_test_ keys, `live` for fxp_live_ keys. Present in every JSON body. One of `sandbox`, `live`.
- `success` (boolean): Always `false` for an error.
- `errors` (array of object): The errors, most important first. Parse this array; the other keys are the older shapes of the same error and stay for existing integrations.
  - `code` (string): Stable, machine-readable code in snake_case. Branch on this, never on the message.
  - `type` (string): The family of the error: tells you how to react. One of `authentication_error`, `permission_error`, `validation_error`, `not_found`, `conflict`, `payment_error`, `rate_limit_error`, `supplier_error`, `internal_error`.
  - `title` (string): A short label of the error.
  - `message` (string): A sentence for a human: what is wrong and how to fix it. Wording can change; the code does not.
  - `field` (string, nullable): The request field the error is about, when there is one.
  - `details` (object, nullable): Structured extras of the error (for example `available` and `required` for an insufficient balance).
  - `documentation_url` (string): The documentation of this error code.
- `meta` (object): The id of the request and the HTTP status, repeated for clients that only read the body.
  - `request_id` (string): The id of the request.
  - `status` (integer): The HTTP status code.
- `request_id` (string): The id of the request, also in the `X-Request-Id` header. Quote it when you write to support.
- `detail` (object, deprecated): Legacy name: use `errors`. The older error body (a string, an object with `error` and `message`, or a list of validation errors).
- `error` (object, deprecated): Legacy name: use `errors[].code`. The older error code or text.
- `message` (string, deprecated): Legacy name: use `errors[].message`. The older error message.
- `code` (string, deprecated): Legacy name: use `errors[].code`. The older error code.
