How can we help?

Error handling and retry strategy

Understand which errors to retry, which require fixes, and what Sovos handles automatically.

When you submit documents through the Sovos API, you may receive error responses. Each error falls into one of three categories:

Category nameCode rangeDescriptionRetry responsibilityGeneral action
Client400-404, 409, 422Problems with your request data. Fix the issue before resubmittingNone; fix the requestInspect errors[].subCode, correct the problem, resubmit
Network408, 429Timeout or rate limiting. Your system should retry after waitingYour systemWait at least 60 seconds, then retry
Server500-504Sovos or tax authority system issues. Sovos automatically retries these errorsSovos (automatic)Continue polling; do not retry manually

The following topics explain the error response format, specific error codes and subcodes, automatic retry behavior, and troubleshooting steps for each error category.

HTTP status codes and retry rules

Sovos uses standard HTTP response codes. Understanding which codes to retry and which require fixes prevents duplicate submissions and ensures efficient error recovery.

CodeNameCategoryRetry?Action
200OKSuccessN/AProcess response data
202AcceptedSuccessN/APoll for completion using jobState
400Bad requestClientNeverCheck for validation errors in your request. If no validation errors are found, contact Sovos support
401UnauthorizedAuthNeverVerify that your API key or token is valid
403ForbiddenAuthNeverCheck product assignments and permissions
404Not foundClientNeverVerify the documentId and endpoint URL
408Request timeoutNetworkYesWait 60 or more seconds, then retry the request
409ConflictClientNeverCheck for duplicate submission
422Unprocessable entityClientNeverFix business rule violations
429Too many requestsNetworkYesWait 60 or more seconds (check the Retry-After header), then retry
500Internal server errorServerAutoSovos retries automatically. Continue polling
501Not implementedServerAutoSovos retries automatically. Continue polling
502Bad gatewayServerAutoSovos retries automatically. Continue polling
503Service unavailableServerAutoSovos retries automatically. Continue polling
504Gateway timeoutServerAutoSovos retries automatically. Continue polling

Error categories

  • Client errors (400-404, 409, 422) - Problems with your request data. Fix the problem before resubmitting.
  • Network errors (408, 429) - Timeout or rate limiting. Your system should retry after waiting.
  • Server errors (500-504) - Sovos or tax authority system problems. Sovos automatically retries these errors.

Error response structure

All error responses follow a consistent JSON structure that includes the HTTP status code, error messages, and subcodes for programmatic handling.

The following example shows a typical error response:

{
  "timestamp": 1634217579717,
  "status": 401,
  "success": false,
  "message": "Unauthorized",
  "errors": [
    {
      "message": "The request requires authentication.",
      "subCode": "authorization.invalidCredentials"
    }
  ]
}
Key fields
FieldTypeDescription
timestampIntegerUnix time stamp in milliseconds when the error was generated on the server.
statusIntegerHTTP status code. Determines error category and retry responsibility.
successBooleanAlways false for error responses.
messageStringHuman-readable summary of the error.
errors[].subCodeStringMachine-readable error type. Use this for programmatic handling.
errors[].messageStringDetailed description of the specific error.

Error subcodes

Subcodes provide more specific error categorization than HTTP status codes alone, enabling programmatic error handling.

For example, HTTP 400 is a generic "Bad Request" error. Subcodes tell you specifically what went wrong:

  • invalidParameter - An invalid field value. Fix the field.
  • missingParameter - A required field is missing. Add the field.
  • document.malformed - The XML structure is invalid. Fix the document structure.

Common subcodes

SubcodeWhat it meansProgrammatic action
invalidParameterInvalid field value in requestValidate input data.
missingParameterRequired field is missingAdd the missing field.
document.malformedXML structure is invalidFix the document structure.
authorization.invalidCredentialsInvalid API credentialsRefresh the authentication token.
internalServerErrorSystem errorMonitor for automatic retry.

Use subcodes for automation

The following example shows how to handle subcodes programmatically:

if (response.errors && response.errors.length > 0) {
  const subCode = response.errors[0].subCode

  switch(subCode) {
    case 'invalidParameter':
    case 'missingParameter':
      alertValidationTeam(response)
      break

    case 'authorization.invalidCredentials':
      refreshAuthToken()
      break

    case 'internalServerError':
      monitorRetryStatus(documentId)
      break
  }
}

What Sovos retries automatically

Sovos automatically retries HTTP 500-504 errors when communicating with tax authorities. You do not need to implement retry logic for these errors.

Important:

Retry parameters are country-specific. Maximum attempts, delay schedules, and total duration vary by country. Your country-specific implementation guide covers the exact retry parameters.

What Sovos does

When Sovos detects a retryable error from a tax authority, the following process occurs:

  1. Sovos detects the retryable error from the tax authority.
  2. Sovos raises a TaxAuthorityUnavailable event.
  3. Sovos retries the transmission with the configured delay schedule.
  4. Sovos continues until the transmission succeeds or the maximum number of attempts is reached.

Your responsibility

While Sovos handles the retry logic, you are responsible for the following actions:

  • Continue polling the transmission endpoint.
  • Pass the jobState parameter from each response to the next poll.
  • Monitor for the final status (success or failure).

Troubleshooting by HTTP code

Use the following troubleshooting steps based on the HTTP status code you receive.

400-404 and 422: Fix your request

  1. Review errors[].subCode and errors[].message.
  2. Check SCIInternalValidation for field-specific details.
  3. Fix the identified problems in your document.
  4. Resubmit as a new document.
  5. If HTTP 400 persists with no validation errors, contact Sovos support.

408 and 429: Wait and retry

  1. Wait 60 or more seconds.
  2. Check the Retry-After header if present (429).
  3. Retry the original request.
  4. Implement throttling if you receive frequent 429 responses.

500-504: Monitor automatic retry

  1. Continue polling with jobState.
  2. Sovos retries automatically.
  3. Check the tax authority status page if the error persists.
  4. Contact support if the error exceeds the maximum retry duration.

401: Re-authenticate

  1. Verify that your API credentials are correct.
  2. Check if the token has expired (typically one hour).
  3. Get a new token.
  4. Retry the request with the new token.

403: Check permissions

  1. Verify that the product is assigned to your company.
  2. Check your role permissions.
  3. Contact your administrator if you need access.

When contacting support

When you contact support, provide the following information:

  • documentId
  • correlationId (the x-correlationId header value)
  • Time stamp
  • Complete error response
  • Steps you attempted to resolve the problem