Errors

Understanding OCTO Error Codes and messages.

We will respond to every request with either a 200 OK if everything went ok, or a 400 Bad Request if it didn't. In the case of the 400 Bad Request the response body will look like this:

{
    "error": "INVALID_PRODUCT_ID",
    "errorMessage": "The Product ID was invalid or missing",
    "productId": "123"
}

You will always receive error and errorMessage which is defined as:

Depending on the error code we also may pass additional fields which can make it easier to understand what's wrong in your request. In the example above we provide productId and pass the value that was sent in the request, indicating that the productId of 123 is not valid.

List of Error Codes

Below is a list of the error codes and a description of what each means. Further down this page we also provide an example request body for all the error codes that provide additional attributes.

As explained above it's also possible for specific error codes to have additional attributes that help you diagnose what is wrong with your request. Below are all the specific errors that contain these attributes:

INVALID_PRODUCT_ID

{
  "error": "INVALID_PRODUCT_ID",
  "errorMessage": "The Product ID was invalid or missing",
  "productId": "123"
}

INVALID_OPTION_ID

{
  "error": "INVALID_OPTION_ID",
  "errorMessage": "The Option ID was invalid or missing",
  "optionId": "321"
}

INVALID_UNIT_ID

{
  "error": "INVALID_UNIT_ID",
  "errorMessage": "The Unit ID was invalid or missing",
  "unitId": "senior"
}

INVALID_AVAILABILITY_ID

{
  "error": "INVALID_AVAILABILITY_ID",
  "errorMessage": "The Availability ID was invalid or missing",
  "availabilityId": "2020-01-01T10:30+08:00"
}

Last updated