Errors
Handle API errors and understand standard error codes
Errors are raised under the related HTTP 4xx Client Error or 5xx Server Error HTTP status codes. The body of the response includes more information.
Error Response Format
{
"details": {
"payment_method_id": "Required"
},
"error_description": "payment_method_id",
"error_type": "InvalidAttributes",
"object": "error"
}{
"details": {
"object": "list",
"values": [
{
"email": "Required"
},
{
"name": "Required"
}
]
},
"error_description": "[0][email], [1][name]",
"error_type": "InvalidAttributes",
"object": "error"
}Error Handling in SDKs
Catch and handle errors when API operations fail due to validation issues or missing resources.
When creating or updating multiple objects, errors are returned for each object with validation issues.
Standard Error Codes
Object Operation Validation Issues
| Code | Name | Meaning |
|---|---|---|
| 400 | Bad Request | A bad request is most commonly a validation issue due to missing or malformed attributes. More information on the issue can be found in the body of the response. |
Issues With Access & Permissions
| Code | Name | Meaning |
|---|---|---|
| 401 | Unauthorized | An unauthorized response is caused by an invalid or expired API secret key. |
| 403 | Forbidden | A forbidden response is caused when a request is made to a resource that is not in scope of the API secret key that was used. |
Requesting Nonexistent Resources
| Code | Name | Meaning |
|---|---|---|
| 404 | Not Found | A not found response is used when requesting a URL path that does not exist. If the URL path is the full object resource path, the object has likely been deleted. |
API Rate Limit Reached
| Code | Name | Meaning |
|---|---|---|
| 429 | Too Many Requests | A too many requests response is raised when the API secret key, IP, or other limiting factor has reached the preset usage limit. |
Internal Issues & Downtime
| Code | Name | Meaning |
|---|---|---|
| 500 | Internal Server Error | An internal server error is raised if there was an unexpected issue while processing your request. |
| 503 | Service Unavailable | A service unavailable error is raised if the Payload service you're requesting has been temporarily brought offline for maintenance. |