Compliance Network models
Reference for the Compliance Network semantic models used in the Sovos Intelligence Query Builder.
What this domain is
Models in scope: three.
Compliance Network (CN) holds the e-invoicing documents that flow through the Sovos Compliance Network. This includes the invoices, credit notes, and related documents that Sovos exchanges with tax authorities and trading partners. Use CN when your question is about individual documents and their processing or compliance status (“Was it authorized?” “What did the tax authority reply?” “When was it archived?”), rather than about VAT-return figures or the general ledger.
The three models and how they relate
| Model | Grain (one row =) | Use it for |
|---|---|---|
CN_ARCHIVE_INVOICES |
one archived document, enriched with status and tax-authority metadata | archive search, compliance/status dashboards, audit |
CN_CANONICAL_INVOICES |
one canonical (normalized UBL) invoice header | document-level totals, parties, currency, portal deep-links |
CN_CANONICAL_INVOICES_LINES |
one invoice line (with header context) | line-item detail, quantities, unit prices |
CODE
CN_CANONICAL_INVOICES ──DOCUMENTUUID──▶ CN_CANONICAL_INVOICES_LINES (header → its lines)
CN_ARCHIVE_INVOICES (separate archive/status view; relate on NATURALKEY / DOCUMENTID and CompanyId)
- Header to lines
-
Join
CN_CANONICAL_INVOICES.DocumentUuid = CN_CANONICAL_INVOICES_LINES.DocumentUuid. - Cross-domain
-
CompanyId(the SDA company id) links CN to VAT Filing, SAF-T, and Intelligence.SourceCompanyCodealigns with the source-ERP company code used in VAT Filing.
Practical notes for CN
- For financial figures, prefer the canonical models' totals (
TaxExclusiveAmount,TotalTaxAmount,TaxInclusiveAmount,PayableAmount) over the archive model's derivedVATAmount. SovosUrlis a deep-link into the regional e-invoicing portal. It is not available for Argentina.- Join the archive view to the canonical view on
NATURALKEY/DOCUMENTIDandCompanyIdwhen you need both status metadata and normalized invoice detail.
CN_ARCHIVE_INVOICES
- Variant name (physical alias)
-
CN_ARCHIVE_INVOICES. modelName "Compliance Network". modelGroupIdc5fb7978-.. Version 2. - Grain
- One row = one archived compliance document (invoice/credit note) as stored in the SDA delta archive, enriched with tax-authority and status metadata.
- Purpose
- Archive-layer view of documents processed through the Sovos Compliance Network (e-invoicing), enriched with sender/receiver parties, SCI/cloud/government status codes, tax-authority responses, attachment and document-reference counts. Suited to archive search, status/compliance dashboards, and audit.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| Direction | VARCHAR(30) | Document flow direction (alias of PROCESSTYPE). | Outbound |
| DocumentId | - | Internal document identifier. | SDA document identifier |
| DocumentNumber | - | Human document/invoice number (DOCUMENTNUMBER). | |
| NaturalKey | - | Business natural key of the document (NATURALKEY). | join/dedupe key candidate |
| DocumentDate | DATE | Document issue date (CAST DOCUMENTDATE). | 2026-07-03, 2025-08-29 |
| DocumentTotal | FLOAT | Gross document total. | 559, 465, 250.33 |
| NetAmount | NUMBER | Net amount of the document. | |
| VATAmount | NUMBER(38,2) | DocumentTotal - NetAmount, rounded. | 329, -50, -140806 (can be negative / large - see gotchas) |
| InvoiceType | VARCHAR | (UNTDID 1001 code). | 380 (invoice), 381 (credit note), 389 (self-billed) |
| DocumentType | VARCHAR(100) | Localized document type. | Factura |
| ProcessType | - | Same source as Direction (PROCESSTYPE). | Outbound |
| Category | VARCHAR(50) | Product/document category code. | RO_INV |
| BusinessCategory | VARCHAR | Business-category classification of the document. | |
| InvoiceFormat | VARCHAR | Invoice format. | e.g. UBL or a local format |
| Country | VARCHAR(6) | UPPER(COUNTRY), ISO country. | RO |
| Product | VARCHAR(101) | Sovos product/mapping id. | ro_Factura__1.0 |
| ProductCategoryId | VARCHAR | Product-category identifier. | |
| Organization | - | Organization code/name (ORGANIZATION). | |
| OrganizationName | - | Organization display name. | |
| CompanyCode | - | Source company code (COMPANYCODE) — links to VAT SourceCompanyCode. |
join key |
| SourceCompanyId | - | COMPANYID from source. | join key |
| SenderName / SenderIdentifier / SenderAuthorityIdentifier | - | Sending party name, id, and authority id. | |
| ReceiverName / ReceiverIdentifier / ReceiverAuthorityIdentifier | - | Receiving party name, id, authority id. | |
| ReceiverCountryCode | VARCHAR | Receiver country code. | |
| SenderSystemId | - | Sending system identifier. | |
| SenderDocumentId | - | Sender's document id. | |
| CreationDate / UpdateDate / ArchivedAt / ExpirationDate | DATE | Lifecycle dates (CAST to DATE). | archive lifecycle |
| SciResponseCode | - | SCI response code. | |
| SciResponseDate | DATE | SCI response date. | |
| SciCloudStatusCode / SciCloudStatusReason | - | Sovos cloud processing status + reason. | |
| SciGovtStatusCode / SciGovtStatusReason | - | Government/tax-authority status + reason. | |
| SciActionStatusCode / SciActionStatusReason | - | Action/workflow status + reason. | |
| StatusCode | VARCHAR | Processing status code. | document.authorized |
| StatusMessage | VARCHAR | Short status message. | |
| StatusSemaphore | NUMBER(38,0) | Traffic-light status. | 1 |
| IsFullyProcessed | BOOLEAN | Whether the document has been fully processed. | true |
| TaxAuthStatusCode / TaxAuthStatusMessage | VARCHAR | Tax-authority response status code/message. | |
| TaxAuthKeyId / TaxAuthUploadId | VARCHAR | Tax-authority key id / upload id. | |
| TaxAuthMessageCount | NUMBER | Number of tax-authority messages. | a count, not a message |
| DocRefSearchKey | VARCHAR | Document-reference search key. | |
| DocRefKeyCount | NUMBER | Number of document-reference keys. | count |
| AttachmentCount | NUMBER | Number of attachments. | count |
| HasLegalDocument | BOOLEAN | TRUE if any attachment has IsLegal=TRUE. | derived boolean |
| CompanyId | - | SDA_COMPANY_ID |
primary CN join key |
| SdaOrganizationId | - | SDA_ORGANIZATION_ID. | join key |
| DataSource | - | Literal 'Compliance Network'. |
constant |
- Keys vs attributes vs measures
-
Keys:
CompanyId(SDA_COMPANY_ID),SdaOrganizationId,CompanyCode,NaturalKey,DocumentId. Measures:DocumentTotal,NetAmount,VATAmount, and the count fields (TaxAuthMessageCount,DocRefKeyCount,AttachmentCount). Everything else is attribute/status metadata. - Joins
-
CompanyId(SDA_COMPANY_ID) andSdaOrganizationIdalign with the CN canonical models.CompanyCode↔ VATSourceCompanyCode. - Notes
-
VATAmountis a derived value (DocumentTotal minus net) and can be negative or large, so prefer the canonical models' totals for financial reporting.DirectionandProcessTypecarry the same underlying value.
CN_CANONICAL_INVOICES
- Variant name
-
CN_CANONICAL_INVOICES. modelName "Compliance Network". modelGroupId243699ac-.. Version 11. - Grain
- One row = one canonical UBL invoice header (document level).
- Purpose
-
Canonical, normalized invoice-header view built from parsed UBL headers in the Compliance Network, with supplier/customer parties, monetary totals, currency/FX, lifecycle dates, and a computed deep-link (
SovosUrl) into the regional e-invoicing portal.
| Field | Type | Description | Notes |
|---|---|---|---|
| SovosUrl | VARCHAR | Computed deep-link to the Sovos regional e-invoicing portal; 'No URL available' when Country=AR. |
built from CN_ORGANIZATION_ID + Category + received/issued + DOCUMENT_UUID |
| Country | VARCHAR(10) | ISO country. | |
| DocumentStatus | VARCHAR(500) | Header document status. | |
| InvoiceId | - | Invoice business id (INVOICE_ID). | |
| SenderDocumentId | - | Sender's document id. | |
| CreationDateTime | - | Document creation timestamp. | |
| InvoiceTypeCode | VARCHAR(50) | UNTDID invoice type code. | e.g. 380/381 |
| InvoiceUuid | - | Invoice UUID. | join key candidate |
| DocumentUuid | - | Document UUID. | line-join key (→ lines DOCUMENT_UUID) |
| SenderSystemId | - | Sender system id. | |
| OrderReferenceId | - | Purchase order reference. | |
| SenderIdentifier / SenderAuthority | - | Sender id and authority. | |
| SupplierTaxId / SupplierTaxSchemeId | - | Supplier tax id + scheme. | |
| SupplierName / SupplierLegalName / SupplierCity / SupplierCountryCode / SupplierAddressLine | - | Supplier party details. | supplier family |
| ReceiverIdentifier | - | Receiver identifier. | |
| CustomerTaxId / CustomerTaxSchemeId | - | Customer tax id + scheme. | |
| CustomerName / CustomerLegalName / CustomerCity / CustomerCountryCode / CustomerBuyerContactId | - | Customer party details. | customer family |
| IssueDate | DATE | Invoice issue date. | |
| IssueTime | - | Issue time. | |
| DueDate / PaymentDueDate | - | Payment due dates. | |
| LineCount | NUMBER(10,0) | Number of invoice lines. | measure |
| TaxExclusiveAmount | NUMBER(38,5) | Net (tax-exclusive) total. | measure |
| TotalTaxAmount | NUMBER(38,5) | Total tax amount. | measure |
| TaxInclusiveAmount | NUMBER(38,5) | Gross (tax-inclusive) total. | measure |
| PayableAmount | NUMBER(38,5) | Amount payable. | measure |
| PayableCurrency | VARCHAR(10) | Payable currency. | |
| DocumentCurrencyCode | - | Document currency. | |
| ExchangeRate | - | FX rate. | measure |
| SourceCurrency / TargetCurrency | - | FX source/target currencies. | |
| Product | VARCHAR(500) | Sovos product/mapping id. | |
| ProcessType | VARCHAR(100) | Inbound/Outbound. | |
| DocumentType | VARCHAR(100) | Document type. | |
| Category | VARCHAR(500) | Product/document category. | |
| RawDocument | - | Full raw document body. | large text; hidden by default |
| StatusMessage | - | Status message. | |
| LoadedAt | - | Ingestion timestamp. | |
| OrganizationId | - | SDA_ORGANIZATION_ID. | join key |
| CompanyId | - | SDA_COMPANY_ID |
primary CN join key |
| SourceCompanyCode | - | COMPANY_CODE. | ↔ VAT SourceCompanyCode / ORG map CN_COMPANY_VAT_CODE |
- Keys vs attributes vs measures
-
Keys:
DocumentUuid,InvoiceUuid,CompanyId(SDA_COMPANY_ID),OrganizationId,SourceCompanyCode. Measures:LineCount,TaxExclusiveAmount,TotalTaxAmount,TaxInclusiveAmount,PayableAmount,ExchangeRate. Rest attributes. - Joins
-
DocumentUuid→ CN_CANONICAL_INVOICES_LINES.DocumentUuid (header ↔ lines).SourceCompanyCode↔ VATSourceCompanyCode.CompanyIdandOrganizationIdlink across domains. - Notes
-
SovosUrlis'No URL available'for Argentina.RawDocumentholds the full raw document body and is large, so select it only when needed.
CN_CANONICAL_INVOICES_LINES
- Variant name
-
CN_CANONICAL_INVOICES_LINES. modelName "Compliance Network". modelGroupId8272b538-.. Version 4. - Grain
- One row = one invoice line (line item), carrying denormalized header context.
- Purpose
- Line-level detail of canonical UBL invoices, with item name/description, quantities, unit price, line amount and currency, plus header attributes (country, type, dates, category) and the SovosUrl deep-link.
| Field | Type | Description | Notes |
|---|---|---|---|
| SovosUrl | - | Portal deep-link (NULL when Country=AR — note: header variant uses literal string, lines variant uses NULL). | header context |
| Country | VARCHAR(10) | ISO country (from header). | |
| InvoiceId | - | Invoice business id (header). | |
| DocumentUuid | - | Document UUID (header). | header-join key |
| InvoiceUuid | - | Invoice UUID (header). | |
| InvoiceTypeCode | VARCHAR(50) | Invoice type code (header). | |
| ProcessType | VARCHAR(100) | Inbound/Outbound (header). | |
| DocumentType | VARCHAR(100) | Document type (header). | |
| IssueDate | - | Issue date (header). | |
| CreationDateTime | - | Creation timestamp (header). | |
| Category | VARCHAR(500) | Category (header). | |
| LineNumber | NUMBER(10,0) | Line sequence number. | grain key with DocumentUuid |
| LineId | - | Line identifier (LINE_ID). | |
| ItemName | VARCHAR(2000) | Line item name. | |
| ItemDescription | - | Line item description. | |
| InvoicedQuantity | NUMBER(28,5) | Quantity invoiced. | measure |
| QuantityUnitCode | VARCHAR(20) | UoM code (UN/ECE). | |
| UnitPrice | NUMBER(38,5) | Unit price. | measure |
| LineExtensionAmount | NUMBER(38,5) | Line net amount (qty×price). | measure |
| LineCurrency | VARCHAR(10) | Line currency. | |
| LoadedAt | - | Ingestion timestamp (LIN.LOADED_AT). | |
| OrganizationId | - | SDA_ORGANIZATION_ID (header). | join key |
| CompanyId | - | SDA_COMPANY_ID (header). |
primary CN join key |
| SourceCompanyCode | - | COMPANY_CODE (header). | ↔ VAT SourceCompanyCode |
- Keys vs attributes vs measures
-
Keys: the composite grain is (
DocumentUuid,LineNumber), plusLineId,CompanyId,OrganizationId, andSourceCompanyCode. Measures:InvoicedQuantity,UnitPrice,LineExtensionAmount. Rest attributes. - Joins
-
DocumentUuid→ CN_CANONICAL_INVOICES.DocumentUuid (lines ↔ header).SourceCompanyCode↔ VATSourceCompanyCode.CompanyIdandOrganizationIdlink across domains. - Notes
-
A line with no matching header shows NULL header fields.
SovosUrlis NULL for Argentina.
