Sovos Document
The Sovos Document schema is the solution to limitations present in the Standard Business Document (SBD) format.
The main purpose of this container is to handle reported information, considering both Local and SCI formats. It also gives support for additional information printed on PDFs using the main UBL 2.1 standard and the AdditionalData
format.
When creating the Sovos Document tag, use the prefix "svs:". Here is a sample:
<svs:SovosDocument>
*Child elements*
</svs:SovosDocument>
Sovos Document structure
The Sovos Document (SD) contains either a Sovos Local Document or a Sovos Canonical Invoice (SCI) and, optionally, Additional Data. When using SCI, it must contain, in most cases, an Invoice primary schema to simplify most types of layouts required for electronic invoicing, such as credit or debit notes. However, for very specific cases that can't be simplified with the single layout of an Invoice, there's the possibility to follow separate Credit Note, Debit Note and Despatch Advice schemas with their respective namespaces:
- crn
- CreditNote
- dbn
- DebitNote
- dea
- DespatchAdvice
Sovos Local Document
The Sovos Local Document has the following child containers:
Base64 Document
Child container used to send invoices for the eArchiving, Post audit and E-Invoicing Compliance services.
When creating the Base64 Document tag, consider the parent node svs:SovosLegalDocument
and use the prefix "enc:".
Here is a sample:
<svs:SovosLegalDocument>
<enc:Base64Document>
<enc:EmbeddedDocument id="1" filename="invoice.xml" mimeCode="application/xml">*Base64 encoded file*</enc:EmbeddedDocument>
</enc:Base64Document>
</svs:SovosLegalDocument>
The following table lists the different Xpaths for this container:
XPath | Type | # | Description |
---|---|---|---|
EmbeddedDocument | string | 1..1 | Element that contains the Base64 encoded file. |
id | integer | 1..1 | Attribute that determines the order and should always be set to "1". |
filename | string | 1..1 | The name of the file. |
mimeCode | string | 1..1 | Attribute that should be set to the mime type of the Base64 encoded file as specified by IANA. |
Attachment
Child container used to send attachments for the archiving service.
When creating the Attachment
tag, consider the parent node svs:SovosLegalDocument
and use the prefix "cac:". Here is a sample:
<svs:SovosLegalDocument>
<cac:Attachment>
<cbc:EmbeddedDocumentBinaryObject filename="attachment1.pdf" mimeCode="application/pdf">*Base64 encoded file*</cbc:EmbeddedDocumentBinaryObject>
<cac:ExternalReference>
<cbc:Description>Attachment1</cbc:Description>
</cac:ExternalReference>
</cac:Attachment>
</svs:SovosLegalDocument>
The cac:Attachment
tag can occur multiple times.
The following table lists the different Xpaths for this container:
XPath | Type | # | Description | |
---|---|---|---|---|
EmbeddedDocumentBinaryObject | string | 1..1 | Element that contains the Base64 encoded attachment. | |
filename | string | 1..1 | The name of the file. | |
mimeCode | string | 1..1 | Attribute that should be set to the mime type of the Base64 encoded file as specified by IANA. | |
ExternalReference | block | 1..1 | An external reference. | |
Description | string | 1..1 | This element determines the order and should be set to Attachment{number} . For example, Attachment1 should be used for the first attachment, and so on.
|
Sovos Canonical Invoice container
Sovos Canonical Invoice (SCI) is a child container used to report information using UBL 2.1 standard documents.
When creating the Sovos Canonical Invoice tag, consider the parent node svs:SovosDocument
and use the prefix "sci:".
Here is a sample:
<svs:SovosDocument>
<sci:SovosCanonicalInvoice>
*UBL 2.1 standard document*
</sci:SovosCanonicalInvoice>
</svs:SovosDocument>
These are the available UBL standards for the SCI container:
UBL 2.1 invoice
Standard used to report invoices. When creating the Invoice
tag, use the prefix "inv:". Here is a sample:
<svs:SovosDocument>
<sci:SovosCanonicalInvoice>
<inv:Invoice>
*UBL 2.1 standard elements*
</inv:Invoice>
</sci:SovosCanonicalInvoice>
</svs:SovosDocument>
UBL 2.1 credit note
Standard used to report credit note documents. When creating the Invoice
tag, use the prefix "crn:". Here is a sample:
<svs:SovosDocument>
<sci:SovosCanonicalInvoice>
<crn:CreditNote>
*UBL 2.1 standard elements*
</crn:CreditNote>
</sci:SovosCanonicalInvoice>
</svs:SovosDocument>
UBL 2.1 debit note
Standard used to report debit note documents. When creating the Invoice
tag, use the prefix "dbn:".
Here is a sample:
<svs:SovosDocument>
<sci:SovosCanonicalInvoice>
<dbn:DebitNote>
*UBL 2.1 standard elements*
</dbn:DebitNote>
</sci:SovosCanonicalInvoice>
</svs:SovosDocument>
UBL 2.1 despatch advice
Standard used to report despatch advice documents. When creating the Invoice
tag, use the prefix "dea:".
Here is a sample:
<svs:SovosDocument>
<sci:SovosCanonicalInvoice>
<dea:DespatchAdvice>
*UBL 2.1 standard elements*
</dea:DespatchAdvice>
</sci:SovosCanonicalInvoice>
</svs:SovosDocument>
AdditionalData element
AdditionalData
is an additional element that supports data printed in PDF format.
Sample using the AdditionalData
element:
<ad:AdditionalData>
<ad:HeaderFields>
<ad:Field name="name" type="type" item=""></ad:Field>
</ad:HeaderFields>
<ad:ItemFields>
<ad:Field name="name" type="type" item="item"></ad:Field>
</ad:ItemFields>
</ad:AdditionalData>
Different Xpaths for this element:
XPath | Type | # | Description | ||
---|---|---|---|---|---|
HeaderFields | block | 0..1 | Block to add information at the invoice level. | ||
Field | string | 0..* | Element used to report printed information. | ||
name | string | 1..1 | Attribute that refers to the description of information that needs to be printed. | ||
type | string | 0..1 | Attribute used for special cases where the client wants to report Base64-encoded values or image references. Enum: "Base64" and "Image". | ||
item | string | 0..1 | Attribute used to link the current Field tag with their respective invoice line item.
| ||
ItemFields | block | 0..1 | Block to add information at the invoice line level. | ||
Field | string | 0..* | Element used to report printed information. | ||
name | string | 1..1 | Attribute that refers to the description of information that needs to be printed. | ||
type | string | 0..1 | Attribute used for special cases where the client wants to report Base64-encoded values or image references. Enum: "Base64" and "Image". | ||
item | string | 0..1 | Attribute used to link the current Field tag with their respective invoice line item.
|
Sovos document examples
The following are two usage cases for the Sovos Document schema:
Local format reporting
In this case, you must use the SovosLegalDocument
tag. Optionally, you can use the AdditionalData
element, placing it at the same level as the SovosLegaldocument
tag.
Here is a sample:
<svs:SovosDocument>
<svs:SovosLegalDocument>
*Country specific format*
</svs:SovosLegalDocument>
<ad:AdditionalData>
<ad:HeaderFields>
<ad:Field name="name" type="type" item="item"></ad:Field>
</ad:HeaderFields>
<ad:ItemFields>
<ad:Field name="name" type="type" item="item"></ad:Field>
</ad:ItemFields>
</ad:AdditionalData>
</svs:SovosDocument>
SCI format reporting
You must use the SovosCanonicalInvoice
tag with an Invoice
, CreditNote
, or DebitNote
tag. Optionally, you may need to include the SovosExtension
element to add a country-specific extension. If you include this extension, and you are also using the AdditionalData
tag, you need to create AdditionalData
at the same level as the country-specific extension.
Here is a sample:
<svs:SovosDocument>
<sci:SovosCanonicalInvoice>
<inv:Invoice>
<ext:UBLExtensions>
<ext:UBLExtension>
<ext:ExtensionContent>
<sov:SovosExtension>
*Country specific extension*
<ad:AdditionalData>
<ad:HeaderFields>
<ad:Field/>
</ad:HeaderFields>
<ad:ItemFields>
<ad:Field/>
</ad:ItemFields>
</ad:AdditionalData>
</sov:SovosExtension>
</ext:ExtensionContent>
</ext:UBLExtension>
</ext:UBLExtensions>
</inv:Invoice>
</sci:SovosCanonicalInvoice>
</svs:SovosDocument>