Error Handling

How we handle errors

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 CodeDescription
400Bad Request - something in the request was not as expected. We will usually provide more details in the response body to allow you to debug.
401Authentication Error - check your access token.
403Forbidden - 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.
404Not Found - the resource your requesting doesn't exist.
429Too Many Requests - you have made too many requests and hit the rate limit. You should wait and retry.
500Internal Server Error - something has gone wrong on our side, best to contact our support.