Sovos Docs

Error handling and retry logic

This topic explains how to handle errors and retry failed submissions when sending invoices through the Sovos Compliance Network, including HTTP error codes, common validation failures, and retry rules.

When a submission fails, the Sovos Compliance Network returns an HTTP status code that tells you what went wrong and what to do next. Some errors require you to fix your data before resubmitting. Others are temporary and safe to retry.

Error handling

HTTP error codes

The following table lists the HTTP codes you may get from the Sovos Compliance Network, what each one means, and the action to take:

HTTP codeMeaningAction
400Malformed request or invalid Standard Business Document structureFix the request. Don't retry without changes.
401Invalid or expired bearer tokenRe-authenticate and retry.
403Account not authorized for this productContact Sovos support.
409Duplicate SenderDocumentIdEach invoice needs a unique ID. Poll first to check whether the original submission succeeded before resubmitting with a new ID.
422PINT-AE validation failureRead the error detail in the response. Fix the field errors and resubmit with a new SenderDocumentId.
429Rate limit exceededWait and retry with exponential backoff.
500Transient platform errorRetry with backoff. Contact Sovos support if it persists.
503Platform maintenanceRetry after the Retry-After period.
Common validation failures

The following table covers the most frequent validation errors, their causes, and how to fix them:

ErrorCauseFix
Missing CustomizationIDPINT-AE specification identifier absentSet to the full PINT-AE URN.
Invalid Tax Identification Number (TIN) TIN is not exactly 10 digitsVerify from Federal Tax Authority (FTA) registration.
Invalid Tax Registration Number (TRN)TRN is not a valid 15-digit alphanumericVerify from EmaraTax.
Missing buyer endpointAccountingCustomerParty.EndpointID absentSupply the PEPPOL ID of the buyer before submitting.
AED tax amount missingTaxTotal in AED not presentAll invoices must include AED-equivalent tax totals.
INVALID_RECEIVER from ASPBuyer TIN not found in PEPPOL networkVerify buyer has onboarded with an ASP.

Retry logic

The following example shows how to implement retry logic when submitting an invoice:

function submitWithRetry(invoicePayload, maxAttempts):
    attempt = 1
    delay = 5 seconds

    while attempt <= maxAttempts:
        response = submitInvoice(invoicePayload)

        if response.httpStatus == 200:
            return response.transactionId        // success — begin polling

        if response.httpStatus in [400, 422]:
            logError(response.errorDetail)
            return SUBMISSION_ERROR              // fix payload; do not retry

        if response.httpStatus == 409:
            pollForExistingStatus(invoicePayload.senderDocumentId)
            return DUPLICATE_CHECK_REQUIRED      // do not resubmit with same ID

        if response.httpStatus == 401:
            refreshToken()
            // retry immediately without incrementing delay

        if response.httpStatus in [429, 500, 503]:
            wait(delay)
            delay = delay * 2                    // exponential backoff
            attempt = attempt + 1

    return MAX_RETRIES_EXCEEDED
Retry rules

Retry on: 401, 429, 500, and 503.

Don't retry on: 400, 409, or 422. Fix the payload first, then resubmit.