Sovos Docs

Show Page Sections

Document lifecycle and completion

Documents move through multiple processing stages from submission to authorization. You can track processing status, determine when a workflow is complete, and download document attachments.

When you submit a document, Sovos processes it through a series of stages including reception, validation, signing, and transmission to the tax authority. Each stage produces status notifications that you can track. After the tax authority authorizes or rejects the document, you can download attachments such as the cleared legal document, authorization proof, and PDF renditions.

Document processing stages

Documents progress through multiple stages from initial submission to final authorization or rejection.

StageStatus codeDescriptionDuration
Reception100Document received by SovosImmediate
Mapping101Transformed to canonical format, country-specific format createdSeconds
Validation102Schema and business rule validationSeconds
Signing103Digital signature applied (if required)Seconds
Transmission104Sent to tax authoritySeconds
Tax authority processing105Tax authority validating document (may repeat)Minutes to hours
Authorization or rejection200 or 400Tax authority approved or rejectedN/A
Post-processing207, 208PDF generation, archiving (if set up)Seconds
Completion209Workflow finishedN/A
Tip:

This is a complete list of possible processing stages across all countries. Actual stages vary by country and tax authority requirements. Your country implementation guide covers which stages apply to your market.

Notification flow patterns

Notification flows show the general progression of document processing events. Actual flows vary by country based on required events and tax authority processing steps.

The following patterns show common notification flows. These are examples to illustrate the general progression.

Tip:

You do not need to set up notifications for every stage. Focus on key milestones. Many internal processing steps (such as signing) are handled automatically by Sovos, and failures at these steps appear in the StatusReason of subsequent notifications.

Success path


document.received (100)
  ↓
document.mapped (101)
  ↓
document.validated (102)
  ↓
document.signed (103)
  ↓
document.transmitted (104)
  ↓
document.processing (105) ← May repeat during polling
  ↓
document.authorized (200) ← Document outcome
  ↓
document.pdf.created (207) ← If PDF is set up
  ↓
document.completed (209)  ← Workflow complete

Rejection path


document.received (100)
  ↓
document.mapped (101)
  ↓
document.validated (102)
  ↓
document.rejected (400) ← Workflow terminates

The Check Notifications article covers processing notifications in chronological order and handling out-of-order delivery.

Determining workflow completion

You can determine when document processing is complete by checking the response code and the completion field.

When processing is complete

Stop polling when:

  • SCIResponseCode is AP, RE, or CA (terminal codes)
  • Response field completed = true

Continue polling when:

  • SCIResponseCode is IP (in process)
  • Response field completed = false
Important:

If indicators conflict, SCIResponseCode takes precedence.

The Understanding Application Responses and Status Codes article covers complete details on status codes and their meanings.

Document attachments

Responses at status 200 and 209 include attachments with different versions of your document.

Set up and download attachments

You need to set up attachments when you set up notifications. For each status code, you select which attachments to include in the response.

Focus on two key status codes:

Status 200 (document.authorized):

  • Set up: LegalCleared, AuthorizationProtocol (baseline)
  • Provides: Immediate access to cleared document and authorization proof when tax authority approves
  • Use when: You need real-time access to authorization proof, or your workflow requires immediate processing after authorization

Status 209 (document.completed):

  • Set up: PDF, LegalCleared, AuthorizationProtocol (baseline)
  • Provides: Complete package - all attachments from 200 plus post-processing artifacts (PDF, archiving metadata)
  • Use when: You need the complete document package, or can wait for workflow completion
  • Recommended: Download from 209 for completeness

If you set up only one status code, select 209. It includes everything from 200 plus more post-processing attachments.

Optional additions:

  • Legal, CanonicalInvoice - if your ERP needs original submission documents
  • ActionRequest - for cancellation workflows

The Configure Product article covers setup steps. Your country implementation guide covers country-specific attachment types.

Common attachment types

TypeDescriptionTypical use
LegalClearedTax authority cleared documentRequired - legal compliance and archiving
AuthorizationProtocolTax authority authorization proofRequired - audit trail and clearance verification
PDFPDF renditionRequired - buyer delivery and human readability
LegalOriginal legal document as submittedOptional - ERP record keeping
LegalSignedDigitally signed legal documentOptional - if digital signatures used
CanonicalInvoiceSovos canonical format (SCI)Optional - data extraction and transformation
ActionRequestCancellation or action request documentFor cancellation or document action workflows
LegalPdfGovernment-stamped official PDFCountry-specific - some markets require stamped PDF
Note:

This table shows the most common attachment types. More country-specific types exist (for example, Italy SDI exchange documents: DeliveryReceipt, OutcomeNotice, FailedDeliveryNotice). Your country implementation guide covers the complete list of attachment types available in your market.

Attachment location in response

Attachments are embedded in the ApplicationResponse XML within cac:DocumentReference elements.

The notification structure:


{
  "notificationId": "f2fa3f84-ba97-4e7a-9c02-85e468cc7012",
  "content": "<base64-encoded ApplicationResponse XML>",
  "metadata": {
    "documentId": "637366217796159052",
    "sciCloudStatusCode": "200"
  }
}

Decode the content to access attachments:


<ApplicationResponse>
  <cac:DocumentResponse>
    <cac:Response>
      <!-- Status codes here -->
    </cac:Response>

    <!-- Attachments are here -->
    <cac:DocumentReference>
      <cbc:ID>[INVOICE_NUMBER]</cbc:ID>
      <cac:Attachment>
        <cac:ExternalReference>
          <cbc:URI schemeID="SCIStorage">https://storage.sovos.com/[DOCUMENT_ID].xml</cbc:URI>
          <cbc:FileName>Invoice.xml</cbc:FileName>
          <cbc:MimeCode>text/xml</cbc:MimeCode>
        </cac:ExternalReference>
      </cac:Attachment>
    </cac:DocumentReference>

    <cac:DocumentReference>
      <cbc:ID>[INVOICE_NUMBER]</cbc:ID>
      <cac:Attachment>
        <cbc:EmbeddedDocumentBinaryObject
            mimeCode="application/pdf"
            filename="Invoice.pdf">
          ...base64 PDF data...
        </cbc:EmbeddedDocumentBinaryObject>
      </cac:Attachment>
    </cac:DocumentReference>
  </cac:DocumentResponse>
</ApplicationResponse>

Attachment patterns:

  • URL-based: Download from cbc:URI with schemeID="SCIStorage"
  • Embedded: Base64-encoded file in cbc:EmbeddedDocumentBinaryObject
Note:

The ApplicationResponse XML structure is universal across all countries (UBL 2.1 standard). The attachment location path (cac:DocumentResponse/cac:DocumentReference/cac:Attachment) is the same everywhere. What varies by country is which attachment types are generated.