XSD+SCH eSPap (Entidade de Serviços Partilhados da Administração Pública) · CIUS-PT 2.1.1

Portugal CIUS-PT Invoice (UBL)

Portuguese e-invoice (UBL, CIUS-PT)

A Portuguese e-invoice for the public administration, checked against the UBL 2.1 schema and eSPap's CIUS-PT rules (EN 16931 and BR-CIUS-PT).

About

Suppliers of Portuguese public bodies send electronic invoices under Decreto-Lei 111-B/2017: large companies since 1 January 2021, small and medium companies and public bodies acting as suppliers from 1 January 2027. The invoice follows CIUS-PT, the Portuguese core invoice usage specification of EN 16931 that eSPap defines, in UBL 2.1.

The CIUS-PT rules (BR-CIUS-PT-*, DT-CIUS-PT-*) check what Portugal adds: the buyer's identifier and contact, address lines, references to contracts and despatch advice, the formats of codes and dates, and the totals, with the tolerance of 1.00 € the specification allows.

E-invoicing in Portugal: the rules in short and how to check an invoice →

Good to know

  • Rules run only when the document matches the schema. Documents over 50 MB are checked against the schema only.
  • The rules are eSPap's Schematron for CIUS-PT 2.1.1 (26 February 2021), with the EN 16931 rules as CIUS-PT adapts them, in one set. eSPap has not published the CII form of CIUS-PT yet.
  • The example is the main invoice of eSPap's CIUS-PT use cases with the identifier of the current release (CIUS-PT:2.1.1); as published, it names 1.0.0.

Files

14 files · 2.7 MB · Download all (.zip)
  • maindoc/UBL-Invoice-2.1.xsd main
    58.8 KB View Download
  • common/UBL-CommonAggregateComponents-2.1.xsd
    2.3 MB View Download
  • common/UBL-CommonBasicComponents-2.1.xsd
    214.7 KB View Download
  • common/UBL-CommonExtensionComponents-2.1.xsd
    9.3 KB View Download
  • common/UBL-QualifiedDataTypes-2.1.xsd
    3.5 KB View Download
  • common/UBL-UnqualifiedDataTypes-2.1.xsd
    26.7 KB View Download
  • common/UBL-ExtensionContentDataType-2.1.xsd
    4.2 KB View Download
  • common/CCTS_CCT_SchemaModule-2.1.xsd
    44.2 KB View Download
  • common/UBL-CommonSignatureComponents-2.1.xsd
    5.4 KB View Download
  • common/UBL-SignatureAggregateComponents-2.1.xsd
    7.6 KB View Download
  • common/UBL-SignatureBasicComponents-2.1.xsd
    4.1 KB View Download
  • common/UBL-xmldsig-core-schema-2.1.xsd
    10.5 KB View Download
  • common/UBL-XAdESv132-2.1.xsd
    21.2 KB View Download
  • common/UBL-XAdESv141-2.1.xsd
    1.3 KB View Download

The validator loads all of these with their folder structure, so includes and imports resolve as published.

Business rules

Schematron · run in this order

The rules run after the schema check, only when the document matches the schema, and in your browser like the schema check (with SaxonJS by Saxonica). Each finding names its rule, such as BR-CO-15, and the line it points at; each rule has a page with what it checks.

Example document

pt-cius-invoice.xml · 92.2 KB · passes the schema and the rules

In CI and from code

The same schema by its name, pt-cius-invoice, through the API.

npx @xmlvalid/cli validate "**/*.xml" --schema pt-cius-invoice
- uses: xmlvalid/validate-action@v1
  with:
    files: "**/*.xml"
    schema: pt-cius-invoice
    api-key: ${{ secrets.XMLVALID_API_KEY }}
curl https://xmlvalid.com/api/v1/validations \
  -H "Authorization: Bearer $XMLVALID_API_KEY" \
  -F document=@pt-cius-invoice.xml \
  -F schema=pt-cius-invoice

Free accounts get 100 API validations a month. On Pro, a URL monitor can check a published document against this schema every hour and email you when it breaks. More CI setups