Error Codes
Response Codes
To denote a successful execution or an error occurrence, the standard HTTP code is used. Along with the HTTP code, the response body will include an error entity with a custom error code assigned to the specific issue described in the message.
HTTP Codes for Errors
Error Condition | HTTP Response Code | HTTP Code Name |
---|---|---|
Invalid submitted data | 400 | BAD REQUEST |
Unauthorized or forbidden access to resource. | 401 | UNAUTHORIZED |
Unauthorized or forbidden access to resource. | 403 | FORBIDDEN |
The operation took a long time, more than expected, to complete. | 408 | REQUEST TIMEOUT |
There was an unexpected error in the API. | 500 | INTERNAL SERVER ERROR |
Response Body Format
The error response will include one of the following entities in the response body.
Format 1
{
"status":"XXX",
"errors":[
{
"subcode":"XXXX-XXXX",
"message":"..."
}
],
"message":"...",
"success":false
}
For errors with this format, the success field will always be “false,” and the status field will have the same code value as the HTTP status code in the response. The base message, the outer message field, will include a description for the given endpoint path where the error was thrown, and the inner message field will include the specific description of the error cause. The subcode field will be a combination of the product code name, SMAR for receivables or SMAP for payables, with a code number associated directly to the cause of the error.
Format 2
{
"timestamp":"XXXXXXXXXXXXX",
"status":"XXX",
"error":"...",
"message":"...""path":"..."
}
For errors with this format, the status field will have the same code value as the HTTP status code in the response, and the error field will be the standard name assigned to that HTTP status code. Additionally, and the message field will include the description of the error and the path field will be the path of the resource that threw the error.
Error Subcodes
Error Code | Error Code Type | Meaning |
---|---|---|
0000 | General | General error. Errors with this code are unexpected and are related to issues that could be originated in the server or in an external service. |
0001 | General | Forbidden. A general error for unauthorized or forbidden issues. |
0002 | General | Forbidden, missing permissions. |
0011 | Validation | String or list property with a null or empty value. |
0012 | Validation | Object or number with a null or empty value. |
0014 | Validation | Maximum permitted length failure. |
0015 | Validation | Minimum permitted length failure. |
0016 | Validation | Invalid date format. |
0101 | Administrative information | Missing or invalid account information. |
0201 | Connectivity | Invalid GTD Authentication Key. |
0202 | Connectivity | Timeout error, the tax calculation engine (GTD) timed out. |
0204 | Connectivity | Tax calculation engine (GTD) service not found. |
1004 | Transaction validation | Invalid discount amount. |
1010 | Transaction validation | Missing line items. |
1015 | Transaction validation | Invalid Credit/Debit indicator number. |
2005 | Transaction state validation | Invalid requested transaction state. |
3000 | Configuration validation | Transaction lines exceeds the allowable max. |
99692 | Tax calculation engine errors | A validation error generated by the tax calculation engine (GTD). Common reasons for this error could be an invalid organization name, an invalid currency code, or a negative discount amount. |