The Spendesk API follows standard conventions using HTTP response codes.
Error Model
A consistent model is to aid error handling which provides additional detail, where necessary, to help resolve the error(s).
HTTP Response Code: 400
Response Body:
{
"errors": [
{
"code": "BAD_REQUEST_INCORRECT_OR_MISSING_FIELD",
"detail": "There is a validation error with incorrect field in request body. Please fix and repeat your request.",
"source": "type"
},
{
"code": "BAD_REQUEST_INCORRECT_OR_MISSING_FIELD",
"detail": "There is a validation error with incorrect field in request body. Please fix and repeat your request.",
"source": "bookkeepingStatus"
},
]
}
HTTP Codes
These are the common standard HTTP response codes that will be used when there is an error in your request:
HTTP Code | Description |
---|---|
400 | Bad Request - something in the request was not as expected. We will usually provide more details in the response body to allow you to debug. |
401 | Authentication Error - check your access token. |
403 | Forbidden - you're trying to access something you don't have the correct privileges for. Try reviewing the scope of your API credentials or access token. |
404 | Not Found - the resource your requesting doesn't exist. |
429 | Too Many Requests - you have made too many requests and hit the rate limit. You should wait and retry. |
500 | Internal Server Error - something has gone wrong on our side, best to contact our support. |