home

Indirect Tax

Sovos Docs

Show Page Sections

Portugal

Enabling support for Portugal involves confirming prerequisites and product IDs, registering with the AT (Autoridade Tributária e Adueneira) tax authority, and setting up credentials.

Prerequisites

Available products

  • pt_temp__1.0

Error handling

When handling errors, the client application must follow the Indirect Tax API's error handling principles, as specified in the error handling documentation.

In general, all error codes in the 400 range are client errors, which you need to analyze. After fixing the error, you can resend the request. Error codes 408 and 429 are exceptions: In these cases, you should wait at least 60 seconds before retrying. Error codes in the 500 range are server errors. In that case, resend the request according to the instructions given on the error handling documentation, which also includes a full list of error codes Indirect Tax API can return.

You can find errors coming from the Sovos platform in the application response. In addition, here is a list of errors that the certified eInvoicing solution can return:

Error code IDError description
SDOC0003The series name is required.
SDOC0004The discount amount is not a valid number.
SDOC0005The discount percentage is not a valid number.
SDOC0006The discount percentage is required.
SDOC0007The currency is required.
SDOC0008The document correlation ID is required.
SDOC0009The document type is required.
SDOC0010The document platform is required.
SDOC0011The document type is not valid.
SDOC0012The document platform is not valid.
SDOC0013The discount percentage is not a valid percentage.
SDOC0014Is self billing is not a valid number boolean.
SDOC0015Ignore database notifications configuration is not a valid boolean.
SDOC0016The document dates are required.
SDOC0017The document totals are required.
SDOC0018The document lines are required.
SDOC0019The document customer/buyer information is required.
SDOC0020The document seller/issuer information is required.
SDOC0021The observations value is required.
SDOC0022The binary data content is required.
SDOC0023The binary data content type is required.
SDOC0024The binary data name is required.
SDOC0025The binary data content is not a valid base64.
SDOC0026The due date is not a valid date.
SDOC0027The delivery date is not a valid date.
SDOC0028The goods service available date is not a valid date.
SDOC0029The departure date is not a valid date.
SDOC0030The arrival date is not a valid date.
SDOC0031The party seller name is required.
SDOC0032The party seller address is required.
SDOC0033The party seller zip code is required.
SDOC0034The party seller zip area is required.
SDOC0035The party seller country is required.
SDOC0036The party seller VAT number is required.
SDOC0037Has a document in attachment is not a valid boolean.
SDOC0038The notifications email is required.
SDOC0039The notifications email is not valid.
SDOC0040The notifications language is required.
SDOC0041The meta info value is required.
SDOC0042The meta info key is required.
SDOC0043The due date is required.
SDOC0044The goods service available date is required. This can be specified in the header or in all document lines.
SDOC0045Inconsistent goods service available date. This can only be specified in the header or in all document lines.
SDOC0046Total to pay is not a valid number.
SDOC0047Total VAT is not a valid number.
SDOC0048Total taxable is not a valid number.
SDOC0049Total gross amount is not a valid number.
SDOC0050Total net amount is not a valid number.
SDOC0051Total discount is not a valid number.
SDOC0052Total charges is not a valid number.
SDOC0053Total stamp duty is not a valid number.
SDOC0054Total withholding tax amount is not a valid number.
SDOC0055Number of lines is not a valid number.
SDOC0056Total to pay must be a non-negative number.
SDOC0057Total VAT must be a non-negative number.
SDOC0058Total taxable must be a non-negative number.
SDOC0059Total gross amount must be a non-negative number.
SDOC0060Total net amount must be a non-negative number.
SDOC0061Total discount must be a non-negative number.
SDOC0062Total charges must be a non-negative number.
SDOC0063Total stamp duty must be a non-negative number.
SDOC0064Total withholding tax amount must be a non-negative number.
SDOC0065Number of lines must be a non-negative number.
SDOC0066Discount amount must be a non-negative number.
SDOC0067Total to pay is required.
SDOC0068Total gross amount is required.
SDOC0069Total taxable is required.
SDOC0070Total VAT or stamp duty is required.
SDOC0071Total VAT is required when there is a line with VAT percentage defined.
SDOC0072Total VAT is required when there is a summary with VAT percentage defined.
SDOC0073Total stamp duty is required when there is a line with stamp duty paragraph defined.
SDOC0074Total stamp duty is required when there is a summary with stamp duty paragraph defined.
SDOC0075VAT summary is required when the total VAT is defined.
SDOC0076Stamp duty summary is required when the total stamp duty is defined.
SDOC0077Total charges is required when there is a line with charges defined.
SDOC0078Total discount is required when there is a line with discounts defined.
SDOC0079Total discount is required when there are document discounts defined.
SDOC0080Total VAT is required when there is advance payment with VAT percentage defined.
SDOC0081Total withholding tax amount is required when there is a line with withholding information defined.
SDOC0082Total withholding tax amount is required when there is a summary with withholding information defined.
SDOC0083Withholding information summary is required when the total withholding tax amount is defined.
SDOC0084VAT summary taxable amount is required.
SDOC0085VAT summary tax percentage is required.
SDOC0086VAT summary tax amount is required.
SDOC0087VAT summary taxable amount is not a valid number.
SDOC0088VAT summary tax percentage is not a valid number.
SDOC0089VAT summary tax amount is not a valid number.
SDOC0090VAT summary taxable amount must be a non-negative number.
SDOC0091VAT summary tax amount must be a non-negative number.
SDOC0092VAT summary tax percentage is not a valid percentage.
SDOC0093VAT summary tax code is not valid.
SDOC0094Stamp duty summary taxable amount is required.
SDOC0095Stamp duty summary paragraph is required.
SDOC0096Stamp duty summary tax amount is required.
SDOC0097Stamp duty summary taxable amount is not a valid number.
SDOC0098Stamp duty summary percentage is not a valid number.
SDOC0099Stamp duty summary tax amount is not a valid number.
SDOC0100Stamp duty summary amount is not a valid number.
SDOC0101Stamp duty summary taxable amount must be a non-negative number.
SDOC0102Stamp duty summary tax amount must be a non-negative number.
SDOC0103Stamp duty summary percentage is not a valid percentage.
SDOC0104Stamp duty summary amount must be a non-negative number.
SDOC0105Withholding tax summary taxable amount is required.
SDOC0106Withholding tax summary tax percentage is required.
SDOC0107Withholding tax summary tax amount is required.
SDOC0108Withholding tax summary taxable amount is not a valid number.
SDOC0109Withholding tax summary tax percentage is not a valid number.
SDOC0110Withholding tax summary tax amount is not a valid number.
SDOC0111Withholding tax summary taxable amount must be a non-negative number.
SDOC0112Withholding tax summary tax amount must be a non-negative number.
SDOC0113Withholding tax summary tax percentage is not a valid percentage.
SDOC0114Withholding tax summary tax code is not valid.
SDOC0115The line delivery date is not a valid date.
SDOC0116The line goods service available date is not a valid date.
SDOC0117The line meta info value is required.
SDOC0118The line meta info key is required.
SDOC0119The line observations value is required.
SDOC0120Line discount amount is not a valid number.
SDOC0121Line discount percentage is not a valid number.
SDOC0122Line discount percentage is not a valid percentage.
SDOC0123Line discount amount must be a non-negative number.
SDOC0124The line discount percentage is required.
SDOC0125Line charge amount is not a valid number.
SDOC0126Line charge percentage is not a valid number.
SDOC0127Line charge percentage is not a valid percentage.
SDOC0128Line charge VAT is required.
SDOC0129The line charge amount is required.
SDOC0130The line charge type is required.
SDOC0131The line quantity is required.
SDOC0132Schedule line quantity is required.
SDOC0133Schedule line delivery date is required.
SDOC0134The quantity value is required.
SDOC0135The quantity unit of measure is required.
SDOC0136The quantity value is not a valid number.
SDOC0137The quantity value must be a non-negative number.
SDOC0138When the line net amount and the line taxable amount are both defined, they must have the same value.
SDOC0139Line withholding tax percentage is required.
SDOC0140Line withholding tax amount is required.
SDOC0141Line charge qualifier is not valid.
SDOC0142Line withholding tax percentage is not a valid number.
SDOC0143Line withholding tax amount is not a valid number.
SDOC0144The party seller email is not valid.
SDOC0145Line withholding tax amount must be a non-negative number.
SDOC0146Line withholding tax percentage is not a valid percentage.
SDOC0147Line withholding tax code is not valid.
SDOC0148Line taxable unit price or line net price is required.
SDOC0149Line stamp duty paragraph is required.
SDOC0150Line stamp duty tax amount is required.
SDOC0151When the line item net price and the item line taxable unit price are both defined, they must have the same value.
SDOC0152Line stamp duty percentage is not a valid number.
SDOC0153Line stamp duty tax amount is not a valid number.
SDOC0154Line stamp duty amount is not a valid number.
SDOC0155Line stamp duty percentage is not a valid percentage.
SDOC0156Line stamp duty amount must be a non-negative number.
SDOC0157Line VAT taxable amount or line net amount is required.
SDOC0158Line VAT tax percentage is required.
SDOC0159Line VAT tax amount is required.
SDOC0160Line VAT taxable amount is not a valid number.
SDOC0161Line VAT tax percentage is not a valid number.
SDOC0162Line VAT tax amount is not a valid number.
SDOC0163Line VAT tax percentage is not a valid percentage.
SDOC0164Line VAT tax code is not valid.
SDOC0165The case package quantity value is required.
SDOC0166The case package quantity unit of measure is required.
SDOC0167The case package quantity value is not a valid number.
SDOC0168The case package quantity value must be a non-negative number.
SDOC0169Units per package is not a valid number.
SDOC0170Units per package must be greater than zero.
SDOC0171When the line VAT tax percentage is zero, the exemption reason must be specified.
SDOC0172The line VAT exemption reason code is required.
SDOC0173The line VAT exemption reason text value is required.
SDOC0174The line VAT exemption reason code is not valid.
SDOC0175The invoicing start date is not a valid date.
SDOC0176The invoicing end date is not a valid date.
SDOC0177The line invoicing start date is not a valid date.
SDOC0178The line invoicing end date is not a valid date.
SDOC0179The creation date is not a valid date.
SDOC0180The last update date is not a valid date.
SDOC0181The line number is not a valid number.
SDOC0182The line number must be greater than zero.
SDOC0183A line type product cannot have withholding taxes.
SDOC0184The line type is not valid.
SDOC0185The line seller assigned identification or the trade item identification is required.
SDOC0186The line item gross price or the line item unit price is required.
SDOC0187The line item unit price is not a valid number.
SDOC0188The line VAT or stamp duty tax is required.
SDOC0189When the total net amount and the total taxable are both defined, they must have the same value.
SDOC0190The line item net price is not a valid number.
SDOC0191The line item gross price is not a valid number.
SDOC0192The line item taxable unit price is not a valid number.
SDOC0193The line item description is required.
SDOC0194The line item gross amount is not a valid number.
SDOC0195The line item net amount is not a valid number.
SDOC0196The line item total discount amount is not a valid number.
SDOC0197The line item total tax amount is not a valid number.
SDOC0198The line item total payable amount is not a valid number.
SDOC0199The line item total discount amount must be a non-negative number.
SDOC0200The line item total tax amount must be a non-negative number.
SDOC0201When the line VAT tax percentage is not zero, the exemption reason cannot be specified.
SDOC0202The line item total payable amount is required.
SDOC0203The line item gross amount is required.
SDOC0204When the line item gross price and the item line unit price are both defined, they must have the same value.
SDOC0205The advance payment line number is not a valid number.
SDOC0206The advance payment line number must be greater than zero.
SDOC0207The advance payment line description is required.
SDOC0208The advance payment line VAT is required.
SDOC0209The advance payment line assigned identification is required.
SDOC0210The advance payment line taxable unit price is not a valid number.
SDOC0211The advance payment line gross amount is not a valid number.
SDOC0212The advance payment line net amount is not a valid number.
SDOC0213The advance payment line taxable unit price must be greater than zero.
SDOC0214The advance payment line gross amount must be greater than zero.
SDOC0215The advance payment line net amount must be greater than zero.
SDOC0216The advance payment line VAT taxable amount, the taxable unit price, or the gross amount is required.
SDOC0217The advance payment line net amount is required.
SDOC0218Only an invoice can deduct a previously received advance payment.
SDOC0219An advance payment cannot have references.
SDOC0220Only invoices or credit notes can have advance payment information.
SDOC0221Invalid document type for invoice processing.
SDOC0222A debit note or a credit note must reference an invoice.
SDOC0223A debit note or a credit note must state the reason for credit/debit.
SDOC0224The party seller is final consumer is not a valid boolean.
SDOC0225The party seller VAT number is not valid.
SDOC0226The party seller country is not valid.
SDOC0227The party seller cannot be a final consumer.
SDOC0228The notifications language is not valid.
SDOC0229The currency is not valid.
SDOC0230The party buyer email is invalid.
SDOC0231The party buyer is final consumer is not a valid boolean.
SDOC0232The party buyer VAT number is not valid.
SDOC0233The party buyer country is not valid.
SDOC0234The party buyer name is required.
SDOC0235The party buyer VAT number is required.
SDOC0236The party buyer address is required.
SDOC0237The party buyer ZIP code is required.
SDOC0238The party buyer ZIP area is required.
SDOC0239The party buyer country is required.
SDOC0240The party buyer GLN is not valid.
SDOC0241The party seller GLN is not valid.
SDOC0242The trade item identification is not a valid GTIN.
SDOC0243A simplified invoice is not permitted if the taxable exceeds 1000.
SDOC0244This document was already processed.
SDOC0245This document sender (party seller) was not found.
SDOC0246This document sender (party seller) must have VAT definitions in the system.
SDOC0247This document sender (party seller) must have document number range definitions in the system.
SDOC0248The document series name was not found.
SDOC0249The stamp duty definition was not found for the specified paragraph.
SDOC0250The VAT definition was not found for the specified percentage.
SDOC0251The charge definition was not found for the specified type.
SDOC0252The VAT exemption reason definition was not found for the specified reason code.
SDOC0253The unit of measure definition was not found for the specified unit of measure code.
SDOC0254There is a withholding tax percentage for the product issuer code definition but there is not match for the document line.
SDOC0255The document for invoice references must exist in the system.
SDOC0256Line stamp duty percentage or line stamp duty amount is required.
SDOC0257Line stamp duty percentage and line stamp duty amount cannot be both specified.
SDOC0258Stamp duty summary percentage or stamp duty summary amount is required.
SDOC0259Stamp duty summary percentage and stamp duty summary amount cannot be both specified.
SDOC0260The line VAT and stamp duty tax cannot be defined for non-priced item lines.
SDOC0261Line VAT taxable amount and line net amount cannot be defined for non-priced item lines.
SDOC0262The line item total payable amount cannot be defined for non-priced item lines.
SDOC0263Line taxable unit price and line net price cannot be defined for non-priced item lines.
SDOC0264The line item gross price and the line item unit price cannot be defined for non-priced item lines.
SDOC0265The line item gross amount cannot be defined for non-priced item lines.
SDOC0266The line withholding tax cannot be defined for non-priced item lines.
SDOC0267The line charges cannot be defined for non-priced item lines.
SDOC0268The line discounts cannot be defined for non-priced item lines.
SDOC0269The party ship from email is invalid.
SDOC0270The party ship from is final consumer is not a valid boolean.
SDOC0271The party ship from VAT number is not valid.
SDOC0272The party ship from country is not valid.
SDOC0273The party ship from name is required.
SDOC0274The party ship from address is required.
SDOC0275The party ship from zip code is required.
SDOC0276The party ship from zip area is required.
SDOC0277The party ship from country is required.
SDOC0278The party ship from GLN is not valid.
SDOC0279The party ship from cannot be a final consumer.
SDOC0280The party ship to email is invalid.
SDOC0281The party ship to is final consumer is not a valid boolean.
SDOC0282The party ship to VAT number is not valid.
SDOC0283The party ship to country is not valid.
SDOC0284The party ship to name is required.
SDOC0285The party ship to address is required.
SDOC0286The party ship to zip code is required.
SDOC0287The party ship to zip area is required.
SDOC0288The party ship to country is required.
SDOC0289The party ship to GLN is not valid.
SDOC0290The party ship to cannot be a final consumer.
SDOC0291This document sender (party seller) cannot send this document type.
SDOC0292This document receiver (party buyer) cannot receive this document type.
SDOC0293This document receiver (party buyer) is not configured to be connected with the document sender (party seller).
SDOC0294The line gross amount must be equal to unit/gross price * quantity.
SDOC0295When the line unit/gross price is negative, no discount should be applied.
SDOC0296The line discount amount is not equal to the calculated gross amount * discount percentage.
SDOC0297The line taxable amount must be equal to the line gross amount without discounts.
SDOC0298The line discounts amount must be equal to the line calculated discounts.
SDOC0299The line discounts amount is required when there are line calculated discounts.
SDOC0300The line discounts amount should not be specified when there are no line calculated discounts.
SDOC0301The line net price (taxable unit price) must be equal to line specified taxable amount / quantity.
SDOC0302The line net price (taxable unit price) must be equal to line calculated taxable amount / quantity.
SDOC0303The line withholding tax amount must be equal to the line calculated withholding tax amount.
SDOC0304The line VAT amount must be equal to the line calculated VAT amount.
SDOC0305The line stamp duty amount must be equal to the line calculated stamp duty amount.
SDOC0306The line total amount must be equal to the line calculated total amount.
SDOC0307The line charge VAT amount must be equal to the line charge calculated VAT amount.
SDOC0308The line charge amount must be equal to the line charge calculated amount.
SDOC0309The document total charge amount must be equal to the line charges calculated amount.
SDOC0310The document total discount amount must be equal to the line discounts calculated amount.
SDOC0311The document discount amount must be equal to the line discounts calculated amount.
SDOC0312The document total stamp duty amount must be equal to the line stamp duties calculated amount.
SDOC0313There is a line stamp duty not found in the document stamp duty summary.
SDOC0314There is a summary stamp duty not found in the line stamp duty.
SDOC0315The document summary stamp duty amount must be equal to the line stamp duties calculated amount for the paragraph.
SDOC0316The document summary stamp duty taxable amount must be equal to the line stamp duties calculated taxable amount for the paragraph.
SDOC0317There is a summary VAT not found in the line VAT.
SDOC0318The document summary VAT amount must be equal to the line VAT calculated amount for the percentage.
SDOC0319The document summary VAT taxable amount must be equal to the line VAT calculated taxable amount for the percentage.
SDOC0320There is a summary withholding tax not found in the line withholding taxes.
SDOC0321The document summary withholding tax amount must be equal to the line withholding taxes calculated amount for the percentage.
SDOC0322The document summary withholding tax taxable amount must be equal to the line withholding taxes calculated taxable amount for the percentage.
SDOC0323There is a line VAT not found in the document VAT summary.
SDOC0324There is a line withholding tax not found in the document withholding tax summary.
SDOC0325The document total VAT amount must be equal to the line VAT calculated amount.
SDOC0326The document total withholding tax amount must be equal to the line withholding taxes calculated amount.
SDOC0327The document total taxable amount must be equal to the line taxable calculated amount.
SDOC0328The document total gross amount must be equal to the line gross calculated amount.
SDOC0329The document total amount must be equal to the line total calculated amount.
SDOC0330The line total calculated amount cannot be negative for a product, even though negative adjustments are permitted.
SDOC0331Total VAT is required when there is a line with charges with VAT percentage defined.
SDOC0332Line withholding information is required when the total withholding tax amount is defined.
SDOC0333Line stamp duty information is required when the total stamp duty amount is defined.
SDOC0334Line gross amount is required when the line gross price is defined.
SDOC0335Line gross price is required when the line gross amount is defined.
SDOC0336Line gross amount is required when the total gross amount is defined and there is no advance payment information.
SDOC0337Total gross amount is required when there is a line with gross amount or advance payment defined.
SDOC0338Line charges is required when the total charges amount is defined.
SDOC0339Line discounts or document discounts is required when the total discount amount is defined.
SDOC0340Line VAT information is required when the total VAT amount is defined.
SDOC0341When the advance payment gross amount and the advance payment taxable unit price are both defined, they must have the same value.
SDOC0342When the advance payment taxable amount and the advance payment taxable unit price are both defined, they must have the same value.
SDOC0343When the advance payment taxable amount and the advance payment gross amount are both defined, they must have the same value.
SDOC0344The advance payment VAT amount must be equal to the advance payment calculated VAT amount.
SDOC0345The advance payment total amount must be equal to the advance payment calculated total amount.
SDOC0346This document sender (party seller) cannot generate a certified document for this document type.
SDOC0347Generate document date configuration is not a valid boolean.
SDOC0348The document date is less than the last generated document date for the series name.
SDOC0349A legal credit or debit note must have at least an existing referenced invoice for rectification data.
SDOC0350The document references must belong to the same customer as the document.
SDOC0351The document references must belong to the same seller as the document.
SDOC0352The document date is less than the referenced document date.
SDOC0353The document currency is not the same as the referenced currency.
SDOC0354The document line product code was not found in the referenced documents.
SDOC0355The credit document line taxable amount for the product code is less than the one available based on the calculation of the referenced documents.
SDOC0356The credit document line quantity amount for the product code is less than the one available based on the calculation of the referenced documents.
SDOC0357The credit document total taxable amount is less than the one available based on the calculation of the referenced documents.
SDOC0358An invoice that deducts an advance payment must have a reference to the invoice containing the advance payment.
SDOC0359The advance payment value to deduct is less than the one available based on the calculation of the referenced documents.
SDOC0360The document date is less than the referenced advance payment document date.
SDOC0361The document currency is not the same as the referenced advance payment currency.
SDOC0362The document advance payment line code was not found in the referenced documents.
SDOC0363The document advance payment references must belong to the same customer as the document.
SDOC0364The document advance payment references must belong to the same seller as the document.
SDOC0365The document correlation ID is not valid. It must be a GUID or a Trade document ID.
SDOC0366The transport net weight value is required.
SDOC0367The transport net weight unit of measure is required.
SDOC0368The transport net weight value is not a valid number.
SDOC0369The transport net weight value must be a non-negative number.
SDOC0370The transport gross weight value is required.
SDOC0371The transport gross weight unit of measure is required.
SDOC0372The transport gross weight value is not a valid number.
SDOC0373The transport gross weight value must be a non-negative number.
SDOC0374The discount amount is required.
SDOC0375The line discount amount is required.
SDOC0376The line number is required.
SDOC0377The line number must be specified and must be unique.
SDOC0378The line departure date is not a valid date.
SDOC0379The line arrival date is not a valid date.
SDOC0380Ignore referenced documents checks configuration is not a valid boolean.
SDOC0381Invalid document type for dispatch advice processing.
SDOC0382Line gross amount is required when the total gross amount is defined.
SDOC0383Document ship to information is required.
SDOC0384The departure date is required.
SDOC0385The arrival date is required.
SDOC0386The line item unit price must be a non-negative number.
SDOC0387The line item net price must be a non-negative number.
SDOC0388The line item gross price must be a non-negative number.
SDOC0389The line item taxable unit price must be a non-negative number.
SDOC0390The line item gross amount must be a non-negative number.
SDOC0391The line item net amount must be a non-negative number.
SDOC0392The line item total payable amount must be a non-negative number.
SDOC0393The exchange rate value is required.
SDOC0394The exchange rate currency is required.
SDOC0395The exchange rate value is not a valid number.
SDOC0396The exchange rate value must be a non-negative number.
SDOC0397The exchange rate currency is not valid.
SDOC0398For legal documents, the currency code must be EUR.
SDOC0399Invoice reference as third-party ERP internal reference configuration is not a valid boolean.
SDOC0400The cancellation date is not a valid date.
SDOC0401The batch due date is not a valid date.
SDOC0402The location email is not valid.
SDOC0403The location country is not valid.
SDOC0404The location GLN is not valid.
SDOC0405Document charge amount is not a valid number.
SDOC0406Document charge percentage is not a valid number.
SDOC0407Document charge percentage is not a valid percentage.
SDOC0408Document charge VAT is required.
SDOC0409The document charge amount is required.
SDOC0410The document charge type is required.
SDOC0411Document charge qualifier is invalid.
SDOC0412The case package net price is not a valid number.
SDOC0413This document destination (party buyer) was not found.
SDOC0414This document destination (party buyer) cannot send this document type.
SDOC0415This document destination (party buyer) cannot generate a certified document for this document type.
SDOC0416This document destination (party buyer) must have VAT definitions in the system.
SDOC0417This document destination (party buyer) must have document number range definitions in the system.

Register with the Portugal tax authority

Obtain the required NIF by registering with the Autoridade Tributária e Adueneira (AT).


Issue certified e-invoice

Issuing a certified e-invoice in Portugal is based on the Default business process, which follows this order: Validation, Invoice Creation, PDF Generation, Signing, and Legal Archiving. The following diagram provides a detailed overview:

Portugal outbound flow

Step 1: Supplier creates the Standard Business Document

Every invoice sent to Sovos must be part of a Standard Business Document (SBD). This document includes a Standard Business Document Header (SBDH) and a Sovos Document node, which in turn includes a Sovos Canonical Invoice (SCI). To create the SBD, follow the detailed instructions in the SBDH, Sovos Document, and SCI pages.

Here are some key elements that should be included in the SBD to create a document in the SCI format:

NodeRequiredAttributesValue
StandardBusinessDocumentHeader.Sender.IdentifierYesAuthority="PT"Supplier's NIF
StandardBusinessDocumentHeader.Receiver.IdentifierYesAuthority="PT"Buyer's NIF
StandardBusinessDocumentHeader.DocumentIdentification.StandardYesurn:oasis:names:specification:ubl:schema:xsd:Invoice-2
StandardBusinessDocumentHeader.DocumentIdentification.TypeVersionYes2.1
StandardBusinessDocumentHeader.DocumentIdentification.TypeYesInvoice
StandardBusinessDocumentHeader.BusinessScope.Scope (with child nodes)Yes

Child node Type: Country

Child node Identifier: PT

StandardBusinessDocumentHeader.BusinessScope.Scope (with child nodes)Yes

Child node Type: ProcessType

Child node Identifier: Outbound

StandardBusinessDocumentHeader.BusinessScope.Scope (with child nodes)Yes

Child node Type: CompanyCode

Child node Identifier : Supplier's NIF

StandardBusinessDocumentHeader.BusinessScope.Scope (with child nodes)Yes

Child node Type: SenderDocumentId

Child node Identifier: A unique document ID. We recommend the ERP document ID.

StandardBusinessDocumentHeader.BusinessScope.Scope (with child nodes)Yes

Child node Type: SenderSystemId

Child node Identifier: The system ID configured in the backend. This parameter is used to determine which notifications are returned to the client and what attachments they include. If SenderSystemId is not configured on the client side, it will use the default value of "DefaultSystemERP". For more information, see this topic.

StandardBusinessDocumentHeader.BusinessScope.Scope (with child nodes)No

Child node Type: BusinessCategory

Child node Identifier: B2B

StandardBusinessDocumentHeader.BusinessScope.Scope.BusinessService.BusinessServiceNameYesDefault
SovosDocument.SovosCanonicalInvoice.InvoiceYesSCI
Note:

Include all the mandatory nodes, as specified in the SBDH schema. If the information cannot be provided, and the respective mandatory node has not been mentioned on the current page, for example the receiver.identifier, the node can be left empty but must still be included in the SBDH.

SBD sample
Below is a sample of the SBD. In addition, there's a full sample of the SBD on the Postman Samples page.
<sbd:StandardBusinessDocument xmlns="http://uri.etsi.org/01903/v1.4.1#" xmlns:sbd="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader" xmlns:ad="http://www.sovos.com/namespaces/additionalData" xmlns:sci="http://www.sovos.com/namespaces/sovosCanonicalInvoice" xmlns:svs="http://www.sovos.com/namespaces/sovosDocument" xmlns:sov="http://www.sovos.com/namespaces/sovosExtensions" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:leg="http://www.sovos.com/namespaces/sovosExtensions/LegalExtension" xmlns:inv="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader file:///C:\Users\helder.barbosa\OneDrive - Sovos Compliance\Sovos\Sovos XSDs\Sovos Document/StandardBusinessDocumentHeader.xsd">
<sbd:StandardBusinessDocumentHeader>
	<sbd:HeaderVersion>1.0</sbd:HeaderVersion>
	<sbd:Sender>
		<sbd:Identifier Authority="PT">999999999</sbd:Identifier>
	</sbd:Sender>
	<sbd:Receiver>
		<sbd:Identifier Authority="PT">999999999</sbd:Identifier>
		<sbd:ContactInformation>
			<sbd:Contact/>
			<sbd:EmailAddress/>
			<sbd:FaxNumber/>
			<sbd:TelephoneNumber/>
			<sbd:ContactTypeIdentifier/>
		</sbd:ContactInformation>
	</sbd:Receiver>
	<sbd:DocumentIdentification>
		<sbd:Standard>urn:oasis:names:specification:ubl:schema:xsd:Invoice-2</sbd:Standard>
		<sbd:TypeVersion>2.1</sbd:TypeVersion>
		<sbd:InstanceIdentifier>100002</sbd:InstanceIdentifier>
		<sbd:Type>Invoice</sbd:Type>
		<sbd:MultipleType>false</sbd:MultipleType>
		<sbd:CreationDateAndTime>2023-10-31T00:00:00Z</sbd:CreationDateAndTime>
	</sbd:DocumentIdentification>
	<sbd:BusinessScope>
		<sbd:Scope>
			<sbd:Type>Country</sbd:Type>
			<sbd:InstanceIdentifier/>
			<sbd:Identifier>PT</sbd:Identifier>
		</sbd:Scope>
		<sbd:Scope>
			<sbd:Type>CompanyCode</sbd:Type>
			<sbd:InstanceIdentifier/>
			<sbd:Identifier>999999999</sbd:Identifier>
		</sbd:Scope>
		<sbd:Scope>
			<sbd:Type>SenderDocumentId</sbd:Type>
			<sbd:InstanceIdentifier/>
			<sbd:Identifier>1003432234</sbd:Identifier>
		</sbd:Scope>
		<sbd:Scope>
			<sbd:Type>SenderSystemId</sbd:Type>
			<sbd:InstanceIdentifier/>
			<sbd:Identifier>SystemERP</sbd:Identifier>
		</sbd:Scope>
		<sbd:Scope>
			<sbd:Type>ProcessType</sbd:Type>
			<sbd:InstanceIdentifier/>
			<sbd:Identifier>Outbound</sbd:Identifier>
		</sbd:Scope>
		<sbd:Scope>
			<sbd:Type>BusinessProcess</sbd:Type>
			<sbd:InstanceIdentifier/>
			<sbd:BusinessService>
				<sbd:BusinessServiceName>Default</sbd:BusinessServiceName>
			</sbd:BusinessService>
		</sbd:Scope>
		<sbd:Scope>
			<sbd:Type>BusinessCategory</sbd:Type>
			<sbd:InstanceIdentifier/>
			<sbd:Identifier>B2B</sbd:Identifier>
		</sbd:Scope>
		<sbd:Scope>
			<sbd:Type>Version</sbd:Type>
			<sbd:InstanceIdentifier/>
			<sbd:Identifier>1.0</sbd:Identifier>
		</sbd:Scope>
	</sbd:BusinessScope>
</sbd:StandardBusinessDocumentHeader>

Step 2: Supplier sends the SBD to Sovos

The supplier sends a POST request to the /documents endpoint.

The request must include the following request body parameters:

NameTypeRequiredDescription
datastringYesThe SBD encoded in Base64, as created in step 1.
dataEncodingstringYesEnter "base64".
Request sample
curl --location --request POST 'https://api-test.sovos.com/v1/documents' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer TOKEN' \
--header 'x-correlationId: SET-TO-UNIQUE-VALUE' \
--data-raw '{
	"data": "PD9...de4=",
	"dataEncoding" : "base64"
}'
Response sample
{
    "timestamp": 1605282724079,
    "status": 202,
    "success": true,
    "message": "Document Received",
    "data": {
        "documentId": "3ad...af"
    }
}

Step 3: Validation

Sovos performs the necessary semantic, syntactic, and legal validations. In addition, Sovos performs a schema validation to make sure that the XML file conforms to the expected structure, comparing it with the official schema. A failed validation can result in the errors from this list and, in that case, the Certified e-invoicing process will be canceled.

Step 4: Invoice creation

Sovos creates a certified e-invoice for which a document number is generated from the identified document number series. The resulting ATCUD will include the document's sequential number. The data will be stored in the system, so it'll be available for generating the SAF-T report.

Step 5: PDF generation

Sovos generates a PDF based on the contents of the XML file. While Sovos uses a default template to create the corresponding PDF, it is also possible to obtain a template that matches the issuer's look and feel. In either case, Sovos must always follow legal rules such as including the ATCUD and the QR code in the generated PDF.

Step 6: Signing

Sovos provides advanced digital signature for the issued certified e-invoice, with the Sovos digital certificate following the obligation to apply a qualified electronic signature (QES) or seal.

Sovos stores all certified invoice data for the legal period of at least ten years. Sovos also stores the signed generated PDF for the same legal period. This data is available for audit or consultation purposes.

Step 8: Supplier retrieves the application responses

Attachments configuration
Sovos highly recommends configuring your application response attachments as download links instead of base64-encoded data to avoid potential size limitations when retrieving responses. The default option is "download links".
Note:

When you use "download links", the response contains a URL to download the file. When you use "binary data", the file is embedded in the base64-encoded response. This configuration is available through the Professional Services team.

As a response to the initial sending of the document, the client receives a JSON response message with an HTTP status code of 202 (asynchronous transaction). This means that the supplier must retrieve the application responses that become available during the transaction, which provide status information and a URL to access the PDF.

To complete a transaction, the supplier must retrieve application responses until the SCIResponseCode in the response has the value of either "AP" or "RE", which indicates that the transaction is finished. A successful transaction will generate five application responses, as shown in the table below:

#SCICloudStatusCodeSCIResponseCode
1209AP
2401RE

The supplier can use the following Indirect Tax API endpoints to retrieve application responses:

  • GET /notifications/PT

  • GET /documents/PT/{documentId}/notifications

GET /notifications/PT
The supplier can send a GET request to the /notifications/PT endpoint to retrieve application responses that match the configured search criteria. To make this request, set the following query parameters:
NameTypeRequiredDefaultDescription
taxIdstringNo

Include only notifications related to the specified taxId. This value relates to the CompanyCode set in the SBDH.

pageintegerNo1To specify the page to be returned, enter a value between 1 and 10.
perPageintegerNo10

To specify the number of results for the returned page, enter a value between 1 and 100.

Note: If the attachment file is configured to return the binary content instead of a link, use only values between 1 and 10.

sourceSystemIdstringYesInclude only notifications related to documents that originate from the given source system. This value is related to the SenderSystemId in the SBDH.
includeAcknowledgedbooleanNofalseEnter "true" to specify whether previously acknowledged notifications must be included in the result.
Request sample
curl --location --request GET 'https://api-test.sovos.com/v1/notifications/PT?page=1&perPage=2&includeAcknowledged=true&taxId={taxId}&sourceSystemId={sourceSystemId}&includeBinaryData=true&processType=0' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer TOKEN' \
--header 'x-correlationId: SET-TO-UNIQUE-VALUE'
Response sample
{
    "status": 200,
    "message": "Notifications Listed",
    "success": true,
    "timestamp": 1708537586642,
    "data": {
        "pageState": {
            "page": 1,
            "perPage": 2,
            "totalEntries": 1,
            "totalPages": 1
        },
            {
                "notificationId": "b0a9c81a-...9b29-e7a693da0ecd",
                "correlationId": "rrt-...-21916838-1",
                "appPrefix": "sph",
                "metadata": {
                    "productId": "pt_temp__1.0",
                    "documentId": "DOCUMENT-ID",
                    "erpDocumentId": "ERP-DOCUMENT-ID",
                    "erpSystemId": "SystemERP",
                    "processType": "0",
                    "taxId": "999999999",
                    "sciCloudStatusCode": "209",
                    "sciResponseCode": "AP",
                    "sciStatusAction": "NOA"
                },
                "content": "PD..g==",
                "createdDate": 1708008887925
            }
        ]
    }
}
GET /documents/PT/{documentId}/notifications
The supplier can send a GET request to the /documents/PT/{documentId}/notifications endpoint to retrieve application responses related to a single document. To make this request, set the following parameter:
NameTypeRequiredParameter typeDefaultDescription
documentIdstringYesPathThe ID of the document returned in step 2
includeAcknowledgedbooleanNoQueryfalseEnter "true" to specify whether previously acknowledged notifications must be included in the result.
includeBinaryData booleanNoQueryfalseEnter "true" to include the binary data of the XML and PDF in the application response.
Request sample
curl --location --request GET 'https://api-test.sovos.com/v1/documents/PT/{documentId}/notifications?includeAcknowledged=true&includeBinaryData=true' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer TOKEN' \
--header 'x-correlationId: SET-TO-UNIQUE-VALUE'
Response sample
{
    "timestamp": 1633687728708,
    "status": 200,
    "success": true,
    "message": "Notifications Listed",
    "data": {
        "pageState": {
            "page": 1,
            "perPage": 2,
            "totalPages": 1,
            "totalEntries": 1
        },
        "notifications": [
            {
                "createdDate": 1629824492,
                "metadata": {
                    "productId": "pt_temp__1.0",
                    "documentId": "3add2b7104dc0049ff0bf410f57e0a19afaf",
                    "erpDocumentId": "80257087",
                    "erpSystemId": "SystemERP",
                    "processType": "0",
                    "taxId": "999999999",
                    "sciCloudStatusCode": "200",
                    "sciResponseCode": "AP",
                    "sciStatusAction": "NOA"
                },
                "appPrefix": "SPH",
                "notificationId": "da3095da-f974-420c-bce2-e33682692276",
                "content": "PEF...c2U+"
            }
        ]
    }
}

Step 9: Supplier marks the application responses as acknowledged

The supplier must process the retrieved application responses and mark them as acknowledged. This can be done by sending a PUT request to the /notifications/PT endpoint.

To make this request, set the following request body parameters:

NameTypeRequiredDescription
statusstringYesEnter "read".
notificationIdstringYesThe ID of the notification that must be marked as acknowledged.
Note: Multiple notificationId values can be acknowledged in one Indirect Tax API call by including them in a single request.
Request sample
curl --location --request PUT 'https://api-test.sovos.com/v1/notifications/PT' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer TOKEN' \
--header 'x-correlationId: SET-TO-UNIQUE-VALUE' \
--data-raw '[
    {
        "status": "read",
        "notificationId": "51341d39-fd3e-4dcf-aea3-a73d73e0de76"
    }
]'
Response sample
{
    "timestamp": 1601673284,
    "status": 200,
    "success": true,
    "message": "Notifications acknowledged successfully."
}