## Error Response Format

Requests resulting in an error response will contain an HTTP status code, error message, and an error code for non-authentication related errors.

### HTTP Status Codes

While the samples below show HTTP Status Codes that indicate errors, a `200` status code can indicate the request body is valid, but the end result was not successful. Examples are show in the API specification.

Scenarios include but are not limited to:

- Attempts to add bank accounts that are invalid
- Attempts to add debit cards that are invalid or not supported
- Declined transactions

`401` - Invalid authorization token

Authentication Error

```json
{
    "http_status": 401,
    "error_message": "401 UNAUTHORIZED"
}
```

`403` - Forbidden access to a resource or feature

Authorization Error

```json
{
    "http_status": 403,
    "error_message": "403 FORBIDDEN"
}
```

`400` - Invalid or missing parameters in the JSON request body

Bad Request Example

```json
{
    "http_status": 400,
    "error_code": "ERR_INVALID_RECIPIENT_ID",
    "error_message": "Invalid recipient ID"
}
```

`404` - Resource or entity not found

Invalid Resource

```json
{
    "http_status": 404,
    "error_code": "ERR_INVALID_ACCOUNT_ID",
    "error_message": "Invalid account ID"
}
```

`422` - Unable to process due to business constraints

Payment Greater than Max allowed

```json
{
    "http_status": 422,
    "error_code": "ERR_PAYMENT_MAX",
    "error_message": "Payment amount is greater than max amount"
}
```

Updated 8 months ago
