Errors
OCTO responds to every request with either 200 OK when everything is valid or 400 Bad Request when it is not. In the case of 400 Bad Request, the response body looks like this:
{
"error": "INVALID_PRODUCT_ID",
"errorMessage": "The Product ID was invalid or missing",
"productId": "123"
}You will always receive error and errorMessage:
error
The error code. A table of possible error codes is shown below.
errorMessage
A human-readable error message that is translated depending on the language provided by the Accept-Language header.
Depending on the error code, we may also pass additional fields that make it easier to understand what is wrong with 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 example response bodies for the error codes that include additional attributes.
INVALID_PRODUCT_ID
Missing or invalid productId in the request.
INVALID_OPTION_ID
Missing or invalid optionId in the request.
INVALID_UNIT_ID
Missing or invalid unitId in the request.
INVALID_AVAILABILITY_ID
Missing or invalid availabilityId in the request.
INVALID_BOOKING_UUID
Missing or invalid booking UUID, or if you are confirming the booking, the booking may already have expired.
BAD_REQUEST
The request body is not formatted correctly, has missing required fields, or contains incorrect data types.
UNPROCESSABLE_ENTITY
The request body is technically correct but cannot be processed for other reasons, for example if a booking is cancelled after the cancellation cutoff has elapsed.
INTERNAL_SERVER_ERROR
The backend server is down or there is a network outage.
UNAUTHORIZED
The API key was not sent in the Authorization header to an endpoint that requires authentication.
FORBIDDEN
The API key was invalid or revoked by the backend system, or you are trying to access an endpoint/resource you do not have access to.
As explained above, it is also possible for specific error codes to have additional attributes that help you diagnose what is wrong with your request. Below are all specific errors that contain these attributes:
INVALID_PRODUCT_ID
INVALID_PRODUCT_IDINVALID_OPTION_ID
INVALID_OPTION_IDINVALID_UNIT_ID
INVALID_UNIT_IDINVALID_AVAILABILIY_ID
INVALID_AVAILABILIY_IDLast updated