Last updated 2 years ago

Common API Errors

422 Validation Error

You will invariably hit some 422 validation error. This means that the value of some field didn't meet Rebilly's expectations (a field could be missing, or the value in a different format than expected, or outside of the expected bounds). Consult the messages within the error response to troubleshoot.

We recommend whitelisting errors to be displayed to the customer, rather than passing through all errors for display. You could do this in two ways:

  1. Catch and log the errors.
  2. Query the Rebilly API logs for the 422 errors.

Add those safe to the whitelist, and when they occur, pass them on to the customer. Otherwise, present a more generic error message.

409 Conflict Error

This error is less common than the validation error. It means that there is a conflict that would prevent changing the state of the resource as requested. For example, when a transaction is paid, it cannot be initiated again. If a subscription order is active, it cannot be reactivated (because it's already active).

5xx Errors

Be sure and alert Rebilly to any 5xx (500, 502, 503) errors that may occur. These should likely have been 422 or 409 errors that were improperly handled on the server side.