Skip to content

Response Codes & Errors

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

CodeMeaningBody
200 OKThe request was processed successfullyResource as JSON
201 CreatedThe resource was createdResource as JSON
400 Bad RequestThe request body could not be parsed as JSONParse errors as JSON
401 UnauthorizedThe API key is missing or invalidError as JSON
404 Not FoundThe resource you're referencing does not existEmpty
409 ConflictThe resource you're trying to create already existsEmpty
422 Unprocessable EntityInput did not pass validationValidation 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:

{
  "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