Status and Error Codes

When CereTax receives an API request, a number of different HTTP status codes can be returned in the response depending on the original request. In general, 2xx codes indicate success. 4xxcodes indicate the request contained an input error (e.x., a required field was omitted, an invalid value was used, etc.).5xx codes indicate an error with the CereTax server.

Any response with a 4xx or 5xx status code will include an error message with details about the error conditions for that code. All Errors will be returned in an errorMessages object in the API response, and include the following fields:

FieldDescription
code4-digit numerical error code
typespecifies the type of error, ex. input, authentication, situs
messagea short description of the error
summarya more detailed description of the error
errorsthe specific fields or values that triggered the error (when applicable)

Invoice and lineItem errors will be returned under the impacted invoice or lineItem.

All other errors will be returned in the main response body.

The following are examples of different types of errors and their location:

{
    "invoice": {
        "invoiceNumber": "123",
        "totalTaxInvoice": 0,
        "lineItems": [
            {
                "lineId": "1",
                "totalTaxLine": 0,
                "taxes": [],
                "validateAddresses": null,
                "valid": true,
                "errorMessages": []
            }
        ]
    },
    "ksuid": "2EDOt60pwulsWvMc7RyGnza4EDg",
    "systemTraceAuditNumber": "123456",
    "errorMessages": [
        {
            "code": 2007,
            "type": "Input",
            "message": "Duplicate STAN Provided",
            "summary": "The systemTraceAuditNumber provided in your request has already been used. Please provide a unique value."
        }
    ]
}
{
    "invoice": {
        "invoiceNumber": "123",
        "totalTaxInvoice": 0,
        "lineItems": [
            {
                "lineId": "1",
                "totalTaxLine": 0,
                "taxes": [],
                "validateAddresses": null,
                "valid": true,
                "errorMessages": []
            }
        ], 
				"errorMessages": [
					{
						"code": 2002,
						"type": "Input",
						"message": "Missing Required Values",
						"summary": "Values for one or more required fields were not included in your API request.",
						"errors": {
							"businessType": "empty value"
						}
					}
				]		
    },
    "ksuid": "2EDOt60pwulsWvMc7RyGnza4EDg",
    "systemTraceAuditNumber": "123456"
}
{
    "invoice": {
        "invoiceNumber": "123",
        "totalTaxInvoice": 0,
        "lineItems": [
            {
                "lineId": "1",
                "totalTaxLine": 0,
                "taxes": [],
                "validateAddresses": [],
                "valid": false,
                "errorMessages": [
                    {
                        "code": 2002,
                        "type": "Input",
                        "message": "Missing Required Values",
                        "summary": "Values for one or more required fields were not included in your API request.",
                        "errors": {
                            "contentYear": "Please provide a value for content year./"
                        }
                    }
                ]
            }
        ]
    },
    "ksuid": "2E7yK0j7YTb4bFO0i6MGsq3v2az",
    "systemTraceAuditNumber": "2E7yK0j7YTb4bFO0i6MGsq3v2az"
}
"errorMessages": [
	{
		"code": "1001",
		"message": "Invalid API Key",
		"summary": "The API key that you used for authentication was not valid.",
		"type": "Authentication"
	}
]

📘

The following is the full list of error codes that can be returned by the CereTax APIs. This list will be updated as new error codes are introduced.

HTTP Statuscodetypemessagesummary
4031001AuthenticationInvalid API KeyThe API key that you used for authentication was not valid.
4031002AuthenticationMissing Authentication TokenAn authentication token was not provided in your API request
4031003AuthenticationAuthentication FailedUnable to authenticate the user or account
4222001InputMissing Required FieldsOne or more required fields was not included in your API request
4222002InputMissing Required ValuesValues for one or more required fields were not included in your API request
4222003InputInvalid Input ValueOne or more of the fields you provided had an invalid value.
4222004InputNo Line Items ProvidedA line item was not provided in your API request. At least one line item must be provided.
4222005InputDuplicate LinesThe line Ids you provided were not unique. All line Ids must be unique within an invoice
4222006InputDuplicate Invoice NumberThe invoice number provided in your request conflicts with an existing invoice
4222007InputDuplicate STAN ProvidedThe systemTraceAuditNumber provided in your request has already been used. Please provide a unique value.
4222008InputInvalid transaction statusThe transaction status used for this operation is not valid.
2002009InputNo applicable taxes foundNo applicable taxes found for the PS Code, Customer Type, and Business Type combination included in the request.
4222010InputInvalid Delivery ChargesThe same delivery charge cannot be passed at both the invoice and lineItem level.
4222011InputInvalid Delivery ChargesDelivery charges for shipping and handling must specified using the separate 'shipping' and 'handling' parameters OR the combined 'shippingAndHandling" parameter
4222012InputDuplicate CustomerA customer record already exists with the provided customerId or customerAccount.
4222013InputDuplicate ExemptionAn exemption already exists for the provided exemptionId, customerAccount, and profileId.
4222015InputMissing date range for reportAt least one of the following date range combinations must be used: content year & month, compliance year & month, invoiceDateStart & invoiceDateEnd, vendorInvoiceDateStart & vendorInvoiceDateEnd
4223001SitusInvalid Postal CodeOne or more of the postal codes you provided was not valid.
4223002SitusInvalid Address InputOne or more of the address inputs you provided was not valid or was incomplete
4223003SitusAddress Cannot Be ValidatedOne or more of the addresses you provided could not be validated. Please review the provided addresses.
4224001FormattingInvalid Request FormatThe format of your request was invalid
2005000TransactionCannot Reverse Unposted TransactionThe requested transaction has not been Posted. Only Posted transactions can be reversed.
5005001TransactionInvalid Transaction Status ChangeTransaction cannot be changed to the provided status.
5009000InternalInternal Server ErrorInternal Server Error