API Reference

Status and Error Codes

When you send a request to the OpenBorder API, the response will include an HTTP status code that indicates the outcome of the request.

  • 2xx codes signify a successful request.
  • 4xxand 5xx codes 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 CodeDescriptionWhat to do
200 - OKThe request was successful, and the response contains the requested dataNo action required.
204 - No ContentThe request was successful.No action required.
400 - Bad RequestInvalid 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 - UnauthorizedInvalid 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 EntityUnprocessable payload request received.Review API response for validation errors (ex., invalid data types, values, or dependencies).
500 - Internal Server ErrorOpenBorder errorContact 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
}