Skip to main content

Errors

Basis Theory uses standard HTTP status codes to indicate whether an API request succeeded or failed. A response with a 2xx status code indicates success, a 4xx status code indicates a failure due to information provided with the request, and a 5xx status code indicates an unexpected error occurred within Basis Theory.

In general, errors are returned with a response body that conforms to the RFC 7807 - Problem Details for HTTP APIs specification, as illustrated below.

{
"errors": {
"additionalProp1": ["string"],
"additionalProp2": ["string"],
"additionalProp3": ["string"]
},
"type": "string",
"title": "string",
"status": 400,
"detail": "string",
"instance": "string"
}

Response​

AttributeTypeDescription
titlestringA short, human-readable summary of the problem
detailstringA human-readable explanation specific to this occurrence of the problem
errors.{property}arrayAn array of human readable error messages returned per request {property}
statusintegerHTTP status code of the response

Error Codes​

Error CodeMeaning
400Invalid request body
401A missing or invalid BT-API-KEY was provided
403The provided BT-API-KEY does not have the required permissions
404Request entity was not found
408Timed out due to a delayed response from the destination
409Conflict with the current state of the request entity
422Request does not satisfy requirements for processing
429Request has been rate limited
500Something went wrong on Basis Theory's side

An OpenSSL UNEXPECTED_EOF_WHILE_READING error can occur before the API returns an HTTP response when a client reuses a pooled HTTPS connection that the Basis Theory edge has already closed. See HTTP Client Configuration for recommended pool lifetimes and retry behavior.

Proxy Errors​

Failed Proxy requests can be due to several different reasons, such as an error being returned by the proxy destination, an error was thrown from a custom transform, or the proxy request was invalid. For further details about possible proxy errors, or how to return errors from a custom proxy transform, see Proxy Transform Error Handling.

Reactor Errors​

Failed Reactors will respond with an error that follows the standard error schema described above. For further details about how to return custom errors or best practices around handling errors within your reactor code, see Reactor Error Handling.