Errors
Complete list of error codes with explanations and troubleshooting tips
OneBalance uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx
range indicate success. Codes in the 4xx
range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx
range indicate an error with OneBalance’s servers.
HTTP Status Codes
Status Code | Type | Description |
---|---|---|
200 | OK | Everything worked as expected. |
400 | Bad Request | The request was unacceptable, often due to missing a required parameter. |
401 | Unauthorized | No valid API key provided. |
402 | Request Failed | The parameters were valid but the request failed. |
403 | Forbidden | The API key doesn’t have permissions to perform the request. |
404 | Not Found | The requested resource doesn’t exist. |
429 | Too Many Requests | Too many requests hit the API too quickly. We recommend an exponential backoff of your requests. |
500, 502, 503, 504 | Server Errors | Something went wrong on OneBalance’s end. |
Error Response Format
Both 400
and 500
level errors return a JSON object in the response body, containing specific attributes detailing the error.
Name | Type | Description |
---|---|---|
error | string | A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be “not_found.” |
message | string | A message providing additional information about the error, including details to help resolve it when possible. |
statusCode | number | HTTP status code. |
timestamp | string | Timestamp of the error. |
path | string | Path of the request that caused the error. |
Example Error Response
HTTP/1.1 401 Unauthorized
Unauthorized
Error Handling Best Practices
- Always check for error responses in your API integrations
- Use the
statusCode
to determine the type of error - Look at the
message
field for specific details on how to resolve the issue - Include the error
id
when contacting support about any API issues