# Response Codes & Errors

The Onward API returns semantic HTTP response codes that can be used to determine your next step.

| Code | Meaning | Body |
|  --- | --- | --- |
| 200 OK | The request was processed successfuly | Resource as JSON |
| 202 Created | The resource was created | Resource as JSON |
| 409 Conflict | The resource you're trying to create already exists | Empty |
| 422 Unprocessable Entity | Input did not pass validation | Validation errors as JSON |


## Validation Errors

In the case of a `422 Unprocessable Entity`, you can look to the JSON body for detail of the errors:

```json
{
  "errors" => [
    "Amount protected doesn't match the calculation in 'purchased_quote_token'"
  ]
}
```

### Error Messages

Some common error messages you can expect to see in the `errors[]` array of a 422 response body include:

- Cart amount is above the maximum protected amount.
- Order amount is above the maximum protected amount.
- Amount protected doesn't match the calculation in 'purchased_quote_token'
- Order is already protected.
- [field name] is required
- [field name] can't be blank
- [enum field name] should be one of these values: [enum options]
- [field name] is not included in the list