When you send a request to the OpenBorder API, the response will include an HTTP status code that indicates the outcome of the request.
2xxcodes signify a successful request.4xxand5xxcodes indicate an issue with the request - such as a missing required field, an invalid API key, or improperly formatted data.
For any response returning a 4xx status code, the API will include an error message detailing the specific cause and how to resolve it. The following is a list of status codes that can be returned by the OpenBorder API.
Common Status Codes
| HTTP Status Code | Description | What to do |
|---|---|---|
200 - OK | The request was successful, and the response contains the requested data | No action required. |
204 - No Content | The request was successful. | No action required. |
400 - Bad Request | Invalid request payload received. | Review your request body and ensure all required fields and formats are correct. Review API response for validation errors (ex. invalid JSON). |
401 - Unauthorized | Invalid or missing authorization token. | Verify that your x-openborder-direct-api-key header is included and valid for the environment you are making requests against. |
422 - Unprocessable Entity | Unprocessable payload request received. | Review API response for validation errors (ex., invalid data types, values, or dependencies). |
500 - Internal Server Error | OpenBorder error | Contact OpenBorder support with request details. |
Example Error Responses
{
"message": "Unexpected token 'c', ...\"ence_id\": cart_12345\"... is not valid JSON",
"error": "Bad Request",
"statusCode": 400
}{
"message": "Unauthorized",
"statusCode": 401
}{
"message": "Request payload validation error",
"error": [
{
"field": "caller_app",
"error": "caller_app should not be empty, caller_app must be shorter than or equal to 255 characters, caller_app must be a string"
},
{
"field": "order_discount",
"error": "order_discount must not be less than 0, order_discount must be a number conforming to the specified constraints"
}
],
"statusCode": 422
}