API errors
If an API request results in an error, the Ripple Payments Direct API returns a response with an HTTP error code in the 400 or 500 series. The error response body also contains more information about the error and recommended next steps when available.
Error response body schema
An error response from the Ripple Payments Direct API has the following response body schema:
Array of objects Error response body. | |||||||||||||||||||||||
Array
|
Error handling
You can determine how to handle an error by using thetype
value.type
to determine next steps
Use the type
field rather than the code
or description
fields to determine the error recovery action you need to take. This is because new error code
values may be added, and the description associated with an error, may be improved as part of routine enhancements. User errors
If the error type isAUTH_ERROR
, NOT_FOUND
, or USER_ERROR
, the cause may be such things as an expired auth token, a malformed request URL, or a request body that has invalid values.The description
field in the error response body for these types of errors typically includes more details about the error and actionable information when available.System errors
Errors with theCONFIGURATION_ERROR
and SYSTEM_ERROR
type are internal or server errors. These errors cannot be overcome without Ripple's help. Contact Ripple technical support for help and provide the error information you received in the response. This includes the error code, title, error type, description, timestamp, and the API endpoint that returned the error.
Example error
This JSON snippet shows an example 404 error when looking up an invalid quote ID.
{
"status": 404,
"errors": [
{
"code": "USR_011",
"title": "Invalid quote collection",
"type": "USER_ERROR",
"description": "Unable to find quote collection with ID: {0}. Try again with a valid quote collection ID.",
"timestamp": "2023-11-02T18:26:00.000123Z"
}
],
"timestamp": "2023-11-02T18:26:00.000Z"
}