Error Handling
TaxBandits API uses the commonly used error codes to stream the success or failure message to an API request. If validation checks fail during the creation of the business, the field errors will return the information in the Response, which can be handled at your end. There are three components in error handling, as outlined below.
Error Structure
{
<<-- HTTP Status Code Fields -->>
"StatusCode": 200,
"StatusName": "Ok",
"StatusMessage": "Successful API call",
<<-- Submission Detail -->
"SubmissionId": "6a30078c-7e5f-4db0-862a-d5e1266363f0",
<<-- Form Success Details & Business Validation Errors -->>
"FormRecords": {
<<-- Collection of Form Success Details -->
"SuccessRecords": {
. . .
},
<<-- Collection of Business Validation Error Details -->
"ErrorRecords": {
. . .
},
<<-- Collection of Data Validation Error Details -->
"Errors": {
. . .
}
}
HTTP Status Codes
HTTP status codes are reported back in the Response JSON. Below is how the HTTP status codes are grouped:
S No. | Code | Status | Description |
---|---|---|---|
1 | 200 | Ok | Successful API call |
2 | 300 | Multi-Status | Multiple statuses are available for the request. |
3 | 400 | BadRequest | A validation error has occurred. |
4 | 401 | Unauthorized | Invalid authorization credentials. |
5 | 402 | CreditsNotSufficient | The Credit in your account is not sufficient to transmit all requested records. |
6 | 404 | NotFound | The resource you have specified cannot be found. |
7 | 405 | MethodNotAllowed | Target resource doesn't support this method. |
8 | 429 | RequestLimitExceeded | The API rate limit for your organisation/application has been exceeded |
9 | 500 | InternalServerError | An unhandled error with this API call. Contact the API team if problems persist |
10 | 503 | NotAvailable | API is currently unavailable – typically due to a scheduled outage – try again soon |
<<-- HTTP Status Code Fields -->
{
"StatusCode": 200,
"StatusName": "Ok",
"StatusMessage": "Successful API call",
}
Data validation errors
Before processing the individual records, our API subjects the data to some mandatory data validation checks, and errors observed will be reported under the object “Errors”.
"Errors":
{
<<-- Error on an incorrect TIN format -->
{
"Id": "F00-100088",
"Name": "Business.EINorSSN",
"Message": "Enter a valid EINorSSN"
}
}
Business validation errors
To process the individual records, the data is subjected to business validation checks, and errors observed will be reported under the object “ErrorRecords”.
<<-- Collection of Business Validation Error -->
"ErrorRecords": {
<<-- Business Validation Errors on Record with Sequence 8 -->
"RecordId": "0e6b053a-3e67-4559-a09f-5631bd06f5e9",
"Sequence": "8",
"Errors":
{
<<-- Error on Recipient First Name required -->
"Id": "F00-100239",
"Name": "Recipient.FirstPayeeNm",
"Message": "FirstPayeeNm is required",
}
},