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 |
In the case of a 422 Unprocessable Entity, you can look to the JSON body for detail of the errors:
{
"errors" => [
"Amount insured doesn't match the calculation in 'purchased_quote_token'"
]
}