Skip to main content

Error Handling

There are two sorts of errors that can happen on the Loaded API, 'expected' errors, and the more unfortunate variety - things that we haven't catered for correctly.

Usage errors

For the first type, expected errors, we do our best to provide useful error messages that explain why we're not accepting the request that you've sent. E.g. perhaps you've tried to create an Order and have referenced a Staff Member that isn't actually created in Loaded yet. The HTTP status codes are also used with these sorts of errors to highlight what the problem might be. Check the details of the possible status codes and what they mean here

Unexpected errors

For the second type you're going to end up receiving a pretty unhelpful error instead - sorry! Let us know what you were doing when you got this error and we'll dig into things to work out how we can fix it. These errors should contain an Error response body.

The error messages contains an ErrorId field, which Loaded support will be able to use to isolate the logs containing the relevant details. When reporting API errors to us please include the value of this field, along with a description of what you were trying to do, and (if possible), the request body.

tip

Errors can happen in production too. To make it easy to support the integration make sure that your code always logs the error responses, particularly that really useful ErrorId value. This will allow us to diagnose things quickly - without it we'll be flying blind.