Direct Debit
Errors
The API uses standard HTTP status codes to indicate the success or failure of an API call. The error body provided will be either JSON or XML format per the preference included within the headers.
Due to the complexity of the API and the Direct Debit Scheme, we are unable to provide a definitive list of all the errors that the system may generate, however we have attempted to make the errors generated as clear as possible — i.e. plain English. The response codes each endpoint can return are listed against it in API Endpoints.
JSON
{
"Message": "The requested resource does not support http method 'POST'."
}
XML
<Error>
<Message>The requested resource does not support http method 'POST'.</Message>
</Error>
Common error shapes
400 Bad Request — validation failure
Validation errors carry an ErrorCode, a human-readable Message, and a Detail
field that pinpoints the specific problem:
{
"ErrorCode": 3,
"Message": "Validation error",
"Detail": "Amount must be greater than zero"
}
401 Unauthorised — API key missing or incorrect
{ "Message": "API not enabled" }
404 Not Found
{ "Message": "Contract not found" }