API errors
When there is something wrong with a request, the API returns an error response that looks like this:
- Example error response
{
"http_status_code": 422,
"error_type": "validation_error",
"error_code": "invalid_field",
"error_message": "Invalid value for request field 'amount.quantity' - 0.00 is too low",
"field": "amount.quantity"
}
The format of the error response:
http_status_code
: the status code associated with the errorerror_type
: a general error categoryerror_code
: a more specific error subcategoryerror_message
: a detailed description of the errorfield
: [optional] the field at fault, if applicable
Error types
Errors are categorised into the following types:
validation_errors
Used for requests that are valid syntax-wise, but semantically-incorrect and cannot be processed by the server. For example, if the request is missing required fields or header, or a request field is incompatible with a user's configuration.
syntax_error
Used for syntactically-incorrect requests, i.e. where the grammar or form of the request itself is wrong. For example, if the request is invalid JSON, or a query or path parameter is incorrectly-formatted.
security_error
Used when there is an issue with authentication or permissions. For example, if an API key has not been provided, or a user does not have sufficient permission to perform an action.
internal_error
Used when the error is on Rootline's side.
idempotency_error
Used when there is an issue with the idempotency keys.