> ## Documentation Index
> Fetch the complete documentation index at: https://docs.invopop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AT Portugal

> Submit certified invoices and periodic SAF-T data to Portugal’s Autoridade Tributária.

> [tab] Description
>
> > [card] [Register suppliers](https://docs.invopop.com/guides/pt-at-supplier.md)
> >
> > Supplier registration guide ›
>
> > [card] [Issue invoices](https://docs.invopop.com/guides/pt-at.md)
> >
> > Issuing guide ›
>
> | | |
> | - | - |
> | Developer | [Invopop](https://invopop.com) |
> | Category | Government |
> | Scope | B2B, B2C |
> | Country | [Portugal](https://docs.invopop.com/compliance/portugal.md) |
>
> Invopop is an officially certified invoice provider in Portugal. Our **AT Portugal app** supports invoice, receipt and delivery note compliance with Portugal’s AT e-invoicing regulation. Automate supplier onboarding, SAF-T report generation, invoice generation with ATCUD, and more. This app enables businesses (and their suppliers) to issue invoices and other document types in accordance with Portuguese law.
>
> #### Key features
>
> * **Workflow automation:** This app provides automated workflows for issuing invoices, onboarding suppliers, and managing fiscal submissions to the Autoridade Tributária e Aduaneira (AT).
> * **Legally compliant PDF documents:** Invoices, payments and delivery notes are generated with a certified ATCUD and QR codes, as required by the Portuguese tax legislation.
> * **SAF-T (PT):** The app makes workflow steps available to manage SAF-T (PT) entries for each supplier.
> * **Realtime and manual reporting options:** Report in real-time via webservice or generate a file to upload through the AT's portal.
> * **Supplier portal:** Suppliers can generate SAF-T PT reports and create authorized series via the [Supplier Portal](https://at-pt.invopop.com/portal).
> * **Supplier registration:** Registration completes in a single workflow step, with no manual onboarding for the supplier.
> * **White-label support:** Invoicing can be performed either under a client’s brand (white-label) or directly by the issuing organization, according to operational needs.
>
> #### Supported document types
>
> The current integration supports the following document types for reporting to the AT:
>
> | Category | Code | Portuguese Name | English Translation |
> | - | - | - | - |
> | **Invoices** | **FT** | *Fatura* | Standard Invoice |
> | | **FS** | *Fatura Simplificada* | Simplified Invoice |
> | | **FR** | *Fatura-Recibo* | Invoice-Receipt |
> | | **ND** | *Nota de Débito* | Debit Note |
> | | **NC** | *Nota de Crédito* | Credit Note |
> | **Payment receipts** | **RG** | *Outro Recibo* | Other Receipt |
> | | **RC** | *Recibo no âmbito do regime de IVA de Caixa* | Cash VAT Receipt |
> | **Transport documents** | **GR** | *Guia de Remessa* | Delivery Note |
> | | **GT** | *Guia de Transporte* | Waybill |
> | | **GD** | *Guia de Devolução* | Return Guide |
> | | **GC** | *Guia de Consignação* | Consignment Guide |
> | **Work documents** | **PF** | *Pró-forma* | Proforma |
> | | **OU** | *Outros* | Other |
>
> Other SAF-T document types beyond those listed above are not currently supported. If you require support for additional document types, please contact us so we can analyze and consider prioritizing their development.
>
> Make sure to check out our [Supplier registration guide](https://docs.invopop.com/guides/pt-at-supplier.md) for onboarding suppliers and the [Issuing invoices guide](https://docs.invopop.com/guides/pt-at.md) for issuing documents.
>
> ## FAQ
>
> Invoicing questions
>
> > [accordion] Should our customers upload their SAF-T files manually?
> >
> > In Portugal, fiscally relevant documents issued through invoicing software must be reported to the Tax Authority (AT). There are two possible reporting models:
> >
> > 1. **SAF-T monthly export** – a single XML file including all documents for the month. This file is generated by the invoicing software and then uploaded manually to the AT portal, as there is no API available for submitting it automatically.
> > 2. **Real-time transmission** – instead of a monthly file, each invoice is sent individually to the AT at the time of issuance, using the authority's API.
> >
> > Whether one model or the other is used usually depends on the issuer's accountant's preference (who typically uploads the SAF-T monthly report should they choose that model). Invopop's [AT Portugal app](https://docs.invopop.com/apps/at-portugal.md) supports both reporting methods, so each supplier can pick the one that best fits their needs.
> >
> > If a supplier uses real-time transmission — the **Send document to AT** step in the workflow — the documents submitted this way are already communicated to the AT, so they don't need to upload a monthly SAF-T file for them. The only documents that still require the monthly SAF-T upload are those not reported in real time, such as RG payment receipts, which the AT's webservice does not accept.
>
> > [accordion] How do I configure my workspace for Portuguese invoicing?
> >
> > Install the AT Portugal app, register the supplier with their NIF, and pick a reporting model (monthly SAF-T or real-time submission). Run invoices through the AT Issue Invoice workflow — Invopop generates the ATCUD, QR, and signature automatically.
>
> > [accordion] Why does recording fail with 'payable: too high according to Artigo 40.º do CIVA'?
> >
> > When issuing in Portugal you may see an error similar to:
> >
> > > `recording envelope: totals: (payable: too high according to Artigo 40.º do CIVA.)`
> >
> > **What it means:** Article 40 of the Portuguese VAT Code (*Código do IVA*) caps the amount a **simplified invoice** (*fatura simplificada*) can carry. The limits are:
> >
> > * **€1,000** for goods sold by retailers or itinerant sellers to buyers who are not taxable persons (final consumers).
> > * **€100** for every other supply of goods or services.
> > * **No limit** for suppliers under the Article 53 small-business exemption regime (since Decree-Law 35/2025).
> >
> > Above the applicable limit, a simplified invoice is no longer allowed and the document must be a **full invoice** (*fatura*). Note that a simplified invoice can only carry the fields listed in Article 40, so adding the buyer's name or address to it is not an option — the document type has to change.
> >
> > **What to do:**
> >
> > * Issue the document as a **full invoice** instead of a simplified one.
> > * If the buyer is a **taxable person** (a business or a freelancer invoicing with a NIF), include their **name, address, and NIF** — Article 36 requires these identification elements only for taxable-person buyers.
> > * If the buyer is a **final consumer**, no customer identification is required on a full invoice, whatever the amount. If you don't have their details, leave the `customer` block out, and Invopop will report the document to the AT under the generic final consumer.
> >
> > In GOBL, drop the `simplified` tag from `$tags` and adjust the `customer` block as above, then re-run the workflow.
>
> > [accordion] Why does my credit note fail with 'The credit note line #N cannot be applied to any line available to credit'?
> >
> > **What it means:** when a credit note references an invoice issued through Invopop, every credit note line must be matched against the quantity and price still available to credit on the original invoice's lines. Line `#N` could not be matched to any of them.
> >
> > For a credit note line to be applied to an invoice line:
> >
> > 1. Its `item.name` must be **exactly identical** to the invoice line's, and both lines must have the same VAT treatment — the same rate and, where applicable, the same exemption.
> > 2. Among the lines matching by name and VAT, it must satisfy one of:
> >    * **Same unit price** as the invoice line, with a quantity up to the remaining quantity — to credit fewer units at the original price.
> >    * **Same quantity** as the invoice line, with a unit price up to the remaining price — to credit part of the amount for the full quantity.
> >
> > Include only the lines you are crediting — the credit note does not need to mirror the full invoice — and the order of the lines is irrelevant. Availability is cumulative: every accepted credit note reduces the remaining quantity or price, so the total credited per line can never exceed the original invoice amount.
> >
> > **What to do:** check that line `#N`'s item name and VAT rate or exemption exactly match a line on the referenced invoice (watch for typos or renamed items), and that it keeps either the original unit price or the original quantity as described above. If everything matches, review credit notes previously issued against the same invoice — the remaining quantity or amount may already have been credited.
> >
> > Note that a credit note supports exactly **one** `preceding` reference, and line matching only applies when the referenced invoice was issued through Invopop — references to external series (for example, invoices issued by a previous provider) are accepted without matching.
>
> > [accordion] Why does my payment workflow fail with 'payment type RG is not supported for real-time reporting'?
> >
> > This error means your workflow includes the **Send to the AT** step for a payment receipt. Payment receipts are not supported for real-time reporting — the AT does not accept them via the real-time webservice.
> >
> > **The fix:** remove the **Send to the AT** step from your payment workflow. RG receipts are only reportable through the monthly SAF-T file. The **Record for SAF-T reporting** step alone is all you need for full compliance.
>
> > [accordion] What payment receipt types are supported in Portugal?
> >
> > Portugal defines two payment receipt types:
> >
> > * **RG — Outros Recibos**: Standard payment receipts, reported through the monthly SAF-T file only. Real-time reporting is not available for this type.
> > * **RC — Recibo no âmbito do regime de IVA de Caixa**: Receipts specific to the VAT Cash accounting regime. RC payments are not currently supported by the AT Portugal app.
>
> > [accordion] Where do I find Portugal-specific GOBL documentation?
> >
> > See the [Portugal tax regime in GOBL](https://docs.gobl.org/regimes/pt) for tax categories, NIF rules, and AT-specific extensions. The [`pt-saft-v1`](https://docs.gobl.org/addons/pt-saft-v1) addon documents fields required by the SAF-T schema.
>
> Registering supplier questions
>
> > [accordion] How do I register a supplier with AT?
> >
> > Run the AT Register Supplier workflow on the supplier, provide their AT web-service credentials, then register at least one series per document type they'll issue. Both can be done in the supplier portal or through the API ([credentials](https://docs.invopop.com/api-ref/apps/at-pt/credentials.md), [series](https://docs.invopop.com/api-ref/apps/at-pt/series-register.md)). Each series gets a validation code from the AT, used to build the ATCUD on every document. See [Register a supplier](https://docs.invopop.com/guides/pt-at-supplier.md).
>
> > [accordion] What credentials does AT require to authenticate a supplier?
> >
> > An AT web-services sub-user (username and password) created in the AT portal, in both models. It always needs the `WSE` permission, to register series; add `WFA` if documents are reported in real time.
>
> > [accordion] How are supplier credentials stored in Invopop for Portugal?
> >
> > Invopop stores the AT web-service credentials encrypted at rest, in both models: they're needed to register series, and for real-time reporting. In the SAF-T model, the supplier (or their accountant) also downloads the monthly SAF-T file and uploads it to the AT's portal.
>
> Reporting questions
>
> > [accordion] How often must I submit AT reports?
> >
> > Real-time model: per invoice. SAF-T model: once per month, by the 5th of the following month. The choice is made in your workflow: include the **Send document to AT** step for real-time reporting, or leave it out and report through the monthly SAF-T file.
>
> > [accordion] How do I schedule periodic reports for Portugal?
> >
> > For invoice-level reporting, there's nothing to schedule in real time: the **Send document to AT** step reports each document as it's issued. In the SAF-T model, generate the month's file on demand (from the supplier portal or the [SAF-T endpoint](https://docs.invopop.com/api-ref/apps/at-pt/saft.md)) and upload it to the AT's portal by the 5th of the following month; Invopop doesn't generate or upload it automatically. Periodic VAT and IES are filed separately by the accountant.
>
> > [accordion] What format does AT expect for periodic reports?
> >
> > Monthly SAF-T-PT XML uploaded to AT's portal (no API for this), or real-time WebService XML calls per invoice. Both follow the same SAF-T schema; real-time submits one document at a time, SAF-T submits an aggregated file covering the month.
>
> More answers in our [Portugal FAQ](https://docs.invopop.com/faq/portugal.md) section

> [tab] Actions
>
> The following workflow actions will be available once you install and enable this app:
>
> > [card] Record document for SAF-T
> >
> > &#x20;3
> > Record a GOBL document for SAF-T PT reporting.
>
> > [card] Send document to AT
> >
> > Send document to the AT in realtime via web service.
>
> > [card] Seal for the AT
> >
> > Seal the document with the AT hash chain and ATCUD so it can be recorded for SAF-T or sent to the AT.
>
> > [card] Register supplier with AT
> >
> > &#x20;100/mo
> > Register a GOBL party to report taxes to the AT in their name.
>
> > [card] Unregister supplier with AT
> >
> > Remove a supplier's registration so it can no longer report taxes to the AT in their name.
>
> > [card] Cancel SAF-T record
> >
> > Cancel a previously recorded GOBL document for SAF-T PT reporting.

> [tab] Workflows
>
> These workflows are essential sequences for processing and issuing AT Portugal documents. You can augment them with webhooks, email, storage actions and more.
>
> Issuing document workflows:
>
> > [accordion] AT Portugal issue invoice
> >
> > ```json AT issue invoice workflow theme={"system"}
> > {
> >     "name": "AT issue invoice",
> >     "description": "Issue an invoice through AT and generate PDF",
> >     "schema": "bill/invoice",
> >     "steps": [
> >         {
> >             "id": "6f884d90-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Set state",
> >             "provider": "silo.state",
> >             "config": {
> >                 "state": "processing"
> >             }
> >         },
> >         {
> >             "id": "76f194b0-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Record document for SAF-T",
> >             "provider": "at-pt.record"
> >         },
> >         {
> >             "id": "59174840-c09a-11f0-b8a2-b531dbe0da3c",
> >             "name": "Send document to AT",
> >             "provider": "at-pt.send"
> >         },
> >         {
> >             "id": "93795a50-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Generate PDF",
> >             "provider": "pdf",
> >             "summary": "Portuguese · A4 · Original",
> >             "config": {
> >                 "date_format": "%Y-%m-%d",
> >                 "hide_promo": true,
> >                 "label": "Original",
> >                 "layout": "A4",
> >                 "locale": "pt",
> >                 "logo_height": 40,
> >                 "watermark": ""
> >             }
> >         },
> >         {
> >             "id": "ce7c50c0-9d55-11f0-b3a4-87562f21f508",
> >             "name": "Generate PDF",
> >             "provider": "pdf",
> >             "summary": "Portuguese · A4 · Duplicado",
> >             "config": {
> >                 "date_format": "%Y-%m-%d",
> >                 "label": "Duplicado",
> >                 "layout": "A4",
> >                 "locale": "pt",
> >                 "logo_height": 40,
> >                 "watermark": "",
> >                 "duplicate": true
> >             }
> >         },
> >         {
> >             "id": "7a708240-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Set state",
> >             "provider": "silo.state",
> >             "config": {
> >                 "state": "sent"
> >             }
> >         }
> >     ],
> >     "rescue": [
> >         {
> >             "id": "805bdbf0-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Set state",
> >             "provider": "silo.state",
> >             "config": {
> >                 "state": "error"
> >             }
> >         }
> >     ]
> > }
> > ```
>
> > [accordion] AT Portugal issue delivery note
> >
> > ```json AT issue delivery workflow theme={"system"}
> > {
> >     "name": "AT issue delivery",
> >     "description": "Issue a delivery document through AT and generate PDF",
> >     "schema": "bill/delivery",
> >     "steps": [
> >         {
> >             "id": "6f884d90-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Set state",
> >             "provider": "silo.state",
> >             "config": {
> >                 "state": "processing"
> >             }
> >         },
> >         {
> >             "id": "76f194b0-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Record document for SAF-T",
> >             "provider": "at-pt.record"
> >         },
> >         {
> >             "id": "59174840-c09a-11f0-b8a2-b531dbe0da3c",
> >             "name": "Send document to AT",
> >             "provider": "at-pt.send"
> >         },
> >         {
> >             "id": "93795a50-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Generate PDF",
> >             "provider": "pdf",
> >             "summary": "Portuguese · A4 · Original",
> >             "config": {
> >                 "date_format": "%Y-%m-%d",
> >                 "hide_promo": true,
> >                 "label": "Original",
> >                 "layout": "A4",
> >                 "locale": "pt",
> >                 "logo_height": 40,
> >                 "watermark": ""
> >             }
> >         },
> >         {
> >             "id": "ce7c50c0-9d55-11f0-b3a4-87562f21f508",
> >             "name": "Generate PDF",
> >             "provider": "pdf",
> >             "summary": "Portuguese · A4 · Duplicado",
> >             "config": {
> >                 "date_format": "%Y-%m-%d",
> >                 "label": "Duplicado",
> >                 "layout": "A4",
> >                 "locale": "pt",
> >                 "logo_height": 40,
> >                 "watermark": "",
> >                 "duplicate": true
> >             }
> >         },
> >         {
> >             "id": "7a708240-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Set state",
> >             "provider": "silo.state",
> >             "config": {
> >                 "state": "sent"
> >             }
> >         }
> >     ],
> >     "rescue": [
> >         {
> >             "id": "805bdbf0-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Set state",
> >             "provider": "silo.state",
> >             "config": {
> >                 "state": "error"
> >             }
> >         }
> >     ]
> > }
> > ```
>
> > [accordion] AT Portugal issue payment
> >
> > ```json AT issue payment workflow theme={"system"}
> > {
> >     "name": "AT issue payment",
> >     "description": "Issue a payment through AT and generate PDF",
> >     "schema": "bill/payment",
> >     "steps": [
> >         {
> >             "id": "6f884d90-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Set state",
> >             "provider": "silo.state",
> >             "config": {
> >                 "state": "processing"
> >             }
> >         },
> >         {
> >             "id": "76f194b0-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Record document for SAF-T",
> >             "provider": "at-pt.record"
> >         },
> >         {
> >             "id": "93795a50-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Generate PDF",
> >             "provider": "pdf",
> >             "summary": "Portuguese · A4 · Original",
> >             "config": {
> >                 "date_format": "%Y-%m-%d",
> >                 "hide_promo": true,
> >                 "label": "Original",
> >                 "layout": "A4",
> >                 "locale": "pt",
> >                 "logo_height": 40,
> >                 "watermark": ""
> >             }
> >         },
> >         {
> >             "id": "ce7c50c0-9d55-11f0-b3a4-87562f21f508",
> >             "name": "Generate PDF",
> >             "provider": "pdf",
> >             "summary": "Portuguese · A4 · Duplicado",
> >             "config": {
> >                 "date_format": "%Y-%m-%d",
> >                 "label": "Duplicado",
> >                 "layout": "A4",
> >                 "locale": "pt",
> >                 "logo_height": 40,
> >                 "watermark": "",
> >                 "duplicate": true
> >             }
> >         },
> >         {
> >             "id": "7a708240-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Set state",
> >             "provider": "silo.state",
> >             "config": {
> >                 "state": "sent"
> >             }
> >         }
> >     ],
> >     "rescue": [
> >         {
> >             "id": "805bdbf0-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Set state",
> >             "provider": "silo.state",
> >             "config": {
> >                 "state": "error"
> >             }
> >         }
> >     ]
> > }
> > ```
>
> Supplier workflows:
>
> > [accordion] AT Portugal register supplier
> >
> > ```json AT register supplier workflow theme={"system"}
> > {
> >     "name": "AT register supplier",
> >     "description": "Register a supplier with AT",
> >     "schema": "org/party",
> >     "steps": [
> >         {
> >             "id": "6f9282a0-3870-11ef-af29-4533d56cea03",
> >             "name": "Set state",
> >             "config": {
> >                 "state": "processing"
> >             },
> >             "summary": "Set state to `processing`{.state .processing}",
> >             "provider": "silo.state"
> >         },
> >         {
> >             "id": "1a9bcde0-a816-11ef-87b2-fd751e6d3b88",
> >             "name": "Sign envelope",
> >             "provider": "silo.close"
> >         },
> >         {
> >             "id": "5b6ca7e0-ad93-11ef-a7da-83137f995008",
> >             "name": "Register supplier with AT",
> >             "provider": "at-pt.register"
> >         }
> >     ],
> >     "rescue": []
> > }
> > ```
>
> > [accordion] AT Portugal post-registration workflow
> >
> > ```json AT supplier post-registration workflow theme={"system"}
> > {
> >     "name": "AT supplier post-registration",
> >     "description": "Mark an AT supplier as registered",
> >     "schema": "org/party",
> >     "steps": [
> >         {
> >             "id": "7e8d8070-3870-11ef-af29-4533d56cea03",
> >             "name": "Set state",
> >             "config": {
> >                 "state": "registered"
> >             },
> >             "summary": "Set state to `registered`{.state .registered}",
> >             "provider": "silo.state"
> >         }
> >     ],
> >     "rescue": []
> > }
> > ```
>
> > [accordion] AT Portugal unregister supplier
> >
> > ```json AT unregister supplier workflow theme={"system"}
> > {
> >     "name": "AT unregister supplier",
> >     "description": "Unregister a supplier with AT",
> >     "schema": "org/party",
> >     "steps": [
> >         {
> >             "id": "5b6ca7e0-ad93-11ef-a7da-83137f995008",
> >             "name": "Unregister supplier with AT",
> >             "provider": "at-pt.unregister"
> >         },
> >         {
> >             "id": "6f9282a0-3870-11ef-af29-4533d56cea03",
> >             "name": "Set state",
> >             "config": {
> >                 "state": "void"
> >             },
> >             "summary": "Set state to `void`{.state .void}",
> >             "provider": "silo.state"
> >         }
> >     ],
> >     "rescue": [
> >         {
> >             "id": "c3a646c0-ab9f-11f1-ac28-4932cb701e8f",
> >             "name": "Set state",
> >             "config": {
> >                 "state": "error"
> >             },
> >             "summary": "Set state to `error`{.state .error}",
> >             "provider": "silo.state"
> >         }
> >     ]
> > }
> > ```
>
> Cancelling document workflows:
>
> > [accordion] AT Portugal cancel invoice
> >
> > ```json AT cancel invoice workflow theme={"system"}
> > {
> >     "name": "AT cancel invoice",
> >     "description": "Cancel an invoice through AT and generate PDF",
> >     "schema": "bill/invoice",
> >     "steps": [
> >         {
> >             "id": "6f884d90-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Set state",
> >             "provider": "silo.state",
> >             "config": {
> >                 "state": "processing"
> >             }
> >         },
> >         {
> >             "id": "cc0002a0-927f-11f0-8cd1-bd9f2c371090",
> >             "name": "Cancel SAF-T record",
> >             "provider": "at-pt.cancel"
> >         },
> >         {
> >             "id": "59174840-c09a-11f0-b8a2-b531dbe0da3c",
> >             "name": "Send document to AT",
> >             "provider": "at-pt.send"
> >         },
> >         {
> >             "id": "7a708240-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Set state",
> >             "provider": "silo.state",
> >             "config": {
> >                 "state": "void"
> >             }
> >         },
> >         {
> >             "id": "93795a50-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Generate PDF",
> >             "provider": "pdf",
> >             "summary": "Portuguese · A4 · Original",
> >             "config": {
> >                 "date_format": "%Y-%m-%d",
> >                 "hide_promo": true,
> >                 "label": "Original",
> >                 "layout": "A4",
> >                 "locale": "pt",
> >                 "logo_height": 40,
> >                 "watermark": ""
> >             }
> >         },
> >         {
> >             "id": "ce7c50c0-9d55-11f0-b3a4-87562f21f508",
> >             "name": "Generate PDF",
> >             "provider": "pdf",
> >             "summary": "Portuguese · A4 · Duplicado",
> >             "config": {
> >                 "date_format": "%Y-%m-%d",
> >                 "label": "Duplicado",
> >                 "layout": "A4",
> >                 "locale": "pt",
> >                 "logo_height": 40,
> >                 "watermark": "",
> >                 "duplicate": true
> >             }
> >         }
> >     ],
> >     "rescue": [
> >         {
> >             "id": "805bdbf0-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Set state",
> >             "provider": "silo.state",
> >             "config": {
> >                 "state": "error"
> >             }
> >         }
> >     ]
> > }
> > ```
>
> > [accordion] AT Portugal cancel delivery note
> >
> > ```json AT cancel delivery workflow theme={"system"}
> > {
> >     "name": "AT cancel delivery",
> >     "description": "Cancel a delivery document through AT and generate PDF",
> >     "schema": "bill/delivery",
> >     "steps": [
> >         {
> >             "id": "6f884d90-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Set state",
> >             "provider": "silo.state",
> >             "config": {
> >                 "state": "processing"
> >             }
> >         },
> >         {
> >             "id": "cc0002a0-927f-11f0-8cd1-bd9f2c371090",
> >             "name": "Cancel SAF-T record",
> >             "provider": "at-pt.cancel"
> >         },
> >         {
> >             "id": "59174840-c09a-11f0-b8a2-b531dbe0da3c",
> >             "name": "Send document to AT",
> >             "provider": "at-pt.send"
> >         },
> >         {
> >             "id": "7a708240-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Set state",
> >             "provider": "silo.state",
> >             "config": {
> >                 "state": "void"
> >             }
> >         },
> >         {
> >             "id": "93795a50-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Generate PDF",
> >             "provider": "pdf",
> >             "summary": "Portuguese · A4 · Original",
> >             "config": {
> >                 "date_format": "%Y-%m-%d",
> >                 "hide_promo": true,
> >                 "label": "Original",
> >                 "layout": "A4",
> >                 "locale": "pt",
> >                 "logo_height": 40,
> >                 "watermark": ""
> >             }
> >         },
> >         {
> >             "id": "ce7c50c0-9d55-11f0-b3a4-87562f21f508",
> >             "name": "Generate PDF",
> >             "provider": "pdf",
> >             "summary": "Portuguese · A4 · Duplicado",
> >             "config": {
> >                 "date_format": "%Y-%m-%d",
> >                 "label": "Duplicado",
> >                 "layout": "A4",
> >                 "locale": "pt",
> >                 "logo_height": 40,
> >                 "watermark": "",
> >                 "duplicate": true
> >             }
> >         }
> >     ],
> >     "rescue": [
> >         {
> >             "id": "805bdbf0-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Set state",
> >             "provider": "silo.state",
> >             "config": {
> >                 "state": "error"
> >             }
> >         }
> >     ]
> > }
> > ```
>
> > [accordion] AT Portugal cancel payment
> >
> > ```json AT cancel payment workflow theme={"system"}
> > {
> >     "name": "AT cancel payment",
> >     "description": "Cancel a payment through AT and generate PDF",
> >     "schema": "bill/payment",
> >     "steps": [
> >         {
> >             "id": "6f884d90-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Set state",
> >             "provider": "silo.state",
> >             "config": {
> >                 "state": "processing"
> >             }
> >         },
> >         {
> >             "id": "cc0002a0-927f-11f0-8cd1-bd9f2c371090",
> >             "name": "Cancel SAF-T record",
> >             "provider": "at-pt.cancel"
> >         },
> >         {
> >             "id": "7a708240-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Set state",
> >             "provider": "silo.state",
> >             "config": {
> >                 "state": "void"
> >             }
> >         },
> >         {
> >             "id": "93795a50-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Generate PDF",
> >             "provider": "pdf",
> >             "summary": "Portuguese · A4 · Original",
> >             "config": {
> >                 "date_format": "%Y-%m-%d",
> >                 "hide_promo": true,
> >                 "label": "Original",
> >                 "layout": "A4",
> >                 "locale": "pt",
> >                 "logo_height": 40,
> >                 "watermark": ""
> >             }
> >         },
> >         {
> >             "id": "ce7c50c0-9d55-11f0-b3a4-87562f21f508",
> >             "name": "Generate PDF",
> >             "provider": "pdf",
> >             "summary": "Portuguese · A4 · Duplicado",
> >             "config": {
> >                 "date_format": "%Y-%m-%d",
> >                 "label": "Duplicado",
> >                 "layout": "A4",
> >                 "locale": "pt",
> >                 "logo_height": 40,
> >                 "watermark": "",
> >                 "duplicate": true
> >             }
> >         }
> >     ],
> >     "rescue": [
> >         {
> >             "id": "805bdbf0-f2b9-11ef-acb2-cd64e858247e",
> >             "name": "Set state",
> >             "provider": "silo.state",
> >             "config": {
> >                 "state": "error"
> >             }
> >         }
> >     ]
> > }
> > ```
>
> New to workflows? Read more in our [workflows guide](https://docs.invopop.com/guides/workflows.md).

> [tab] Documents
>
> > [accordion] AT B2B invoice
> >
> > In this example, we're issuing a simple invoice from a Portuguese supplier to another Portuguese business.
> >
> > Notice:
> >
> > * the minimal version in the first tab contains only the essential fields required to create the invoice, without totals or calculations,
> > * the [`pt-saft-v1`](https://docs.gobl.org/addons/pt-saft-v1) addon ensures the document will be validated and normalized using the SAF-T PT v1 rules built into the [GOBL](https://docs.gobl.org) library,
> > * the `supplier` and `series` fields are set to example values; you'll need to replace them with the details of supplier and series registered as per the previous sections. The series must be registered in the Supplier Portal and follow Portuguese naming conventions (see [Series management](https://docs.invopop.com/guides/pt-at-supplier.md#series-management) for details),
> > * when running `gobl build`, or uploading the file, the system automatically calculates totals, assigns the [`pt-saft-invoice-type`](https://docs.gobl.org/addons/pt-saft-v1#invoice-type) extension to `FT` (Fatura), sets the [`pt-saft-payment-means`](https://docs.gobl.org/addons/pt-saft-v1#payment-means) extension to `CC` for card payment, and applies the [`pt-saft-tax-rate`](https://docs.gobl.org/addons/pt-saft-v1#tax-rate-code) extension to `NOR` for standard VAT,
> > * the built version in the second tab shows the normalized document with calculated totals, line item sums (including advance payment deductions), tax breakdowns, and automatically generated fields, and,
> > * the `h` item unit causes the [`pt-saft-product-type`](https://docs.gobl.org/addons/pt-saft-v1#product-type) extension to be set to `S` (Serviço), and the [`pt-region`](https://docs.gobl.org/regimes/pt#region-code) extension is automatically set to `PT`.
> >
> > ```json AT B2B Invoice (minimal) theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"type": "standard",
> > 	"series": "FT SERIES-A",
> > 	"issue_date": "2024-12-23",
> > 	"currency": "EUR",
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "504614240"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"num": "156",
> > 				"street": "Avenida da República",
> > 				"locality": "Lisboa",
> > 				"code": "1050-045",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "maria@example.com"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "150000.00",
> > 			"office": "CRC Lisboa",
> > 			"other": "sob NIF 770013813"
> > 		}
> > 	},
> > 	"customer": {
> > 		"name": "Gusto Unipessoal Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Avenida da Liberdade 152 2º Direito",
> > 				"locality": "Lisboa",
> > 				"code": "1250-146",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "gusto@example.com"
> > 			}
> > 		],
> > 		"websites": [
> > 			{
> > 				"url": "https://gusto.example.com"
> > 			}
> > 		],
> > 		"telephones": [
> > 			{
> > 				"num": "+351912345678"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"quantity": "20.0",
> > 			"item": {
> > 				"name": "Development services",
> > 				"price": "50.00",
> > 				"unit": "h"
> > 			},
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"rate": "standard"
> > 				}
> > 			]
> > 		}
> > 	],
> > 	"payment": {
> > 		"advances": [
> > 			{
> > 				"date": "2024-12-23",
> > 				"key": "card",
> > 				"description": "Advance payment",
> > 				"amount": "12.34"
> > 			}
> > 		]
> > 	}
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"type": "standard",
> > 	"series": "FT SERIES-A",
> > 	"issue_date": "2024-12-23",
> > 	"value_date": "2024-12-23",
> > 	"currency": "EUR",
> > 	"tax": {
> > 		"ext": {
> > 			"pt-saft-invoice-type": "FT",
> > 			"pt-saft-source": "P"
> > 		}
> > 	},
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "504614240"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"num": "156",
> > 				"street": "Avenida da República",
> > 				"locality": "Lisboa",
> > 				"code": "1050-045",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "maria@example.com"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "150000.00",
> > 			"office": "CRC Lisboa",
> > 			"other": "sob NIF 770013813"
> > 		}
> > 	},
> > 	"customer": {
> > 		"name": "Gusto Unipessoal Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Avenida da Liberdade 152 2º Direito",
> > 				"locality": "Lisboa",
> > 				"code": "1250-146",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "gusto@example.com"
> > 			}
> > 		],
> > 		"websites": [
> > 			{
> > 				"url": "https://gusto.example.com"
> > 			}
> > 		],
> > 		"telephones": [
> > 			{
> > 				"num": "+351912345678"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"i": 1,
> > 			"quantity": "20.0",
> > 			"item": {
> > 				"name": "Development services",
> > 				"price": "50.00",
> > 				"unit": "h",
> > 				"ext": {
> > 					"pt-saft-product-type": "S"
> > 				}
> > 			},
> > 			"sum": "1000.00",
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"key": "standard",
> > 					"rate": "general",
> > 					"percent": "23.0%",
> > 					"ext": {
> > 						"pt-region": "PT",
> > 						"pt-saft-tax-rate": "NOR"
> > 					}
> > 				}
> > 			],
> > 			"total": "1000.00"
> > 		}
> > 	],
> > 	"payment": {
> > 		"advances": [
> > 			{
> > 				"date": "2024-12-23",
> > 				"key": "card",
> > 				"description": "Advance payment",
> > 				"amount": "12.34",
> > 				"ext": {
> > 					"pt-saft-payment-means": "CC"
> > 				}
> > 			}
> > 		]
> > 	},
> > 	"totals": {
> > 		"sum": "1000.00",
> > 		"total": "1000.00",
> > 		"taxes": {
> > 			"categories": [
> > 				{
> > 					"code": "VAT",
> > 					"rates": [
> > 						{
> > 							"key": "standard",
> > 							"ext": {
> > 								"pt-region": "PT",
> > 								"pt-saft-tax-rate": "NOR"
> > 							},
> > 							"base": "1000.00",
> > 							"percent": "23.0%",
> > 							"amount": "230.00"
> > 						}
> > 					],
> > 					"amount": "230.00"
> > 				}
> > 			],
> > 			"sum": "230.00"
> > 		},
> > 		"tax": "230.00",
> > 		"total_with_tax": "1230.00",
> > 		"payable": "1230.00",
> > 		"advance": "12.34",
> > 		"due": "1217.66"
> > 	}
> > }
> > ```
>
> > [accordion] AT invoice with IRS withholding
> >
> > In this example, a self-employed professional (*trabalhador independente*) invoices a Portuguese company for consulting services. On top of the standard VAT, the customer retains personal income tax (*IRS*) at source.
> >
> > Notice:
> >
> > * the minimal version in the first tab contains only the essential fields; the line carries a second tax on top of `VAT`: an `IRS` combo with `percent` set to `25%` and no `rate`,
> > * the document-level `tax.notes` entry with `cat: "IRS"` carries the legal basis for the withholding (here *Art. 101.º CIRS*); the SAF-T export surfaces it as the `WithholdingTaxType` (`IRS`) and `WithholdingTaxDescription` of the `WithholdingTax` block, and,
> > * in the built version the `IRS` tax becomes its own `retained` category in `totals.taxes`, separate from `VAT`, with `retained: "250.00"` (25% of the 1000,00 base).
> >
> > ```json AT Withholding Invoice (minimal) theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"type": "standard",
> > 	"series": "FT SERIES-A",
> > 	"issue_date": "2024-08-03",
> > 	"currency": "EUR",
> > 	"tax": {
> > 		"notes": [
> > 			{
> > 				"cat": "IRS",
> > 				"text": "Art. 101.º CIRS"
> > 			}
> > 		]
> > 	},
> > 	"supplier": {
> > 		"name": "João Silva, Trabalhador Independente",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "545259045"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Rua das Flores",
> > 				"locality": "Lisboa",
> > 				"code": "1000-000",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "joao.silva@example.com"
> > 			}
> > 		]
> > 	},
> > 	"customer": {
> > 		"name": "Empresa Cliente, Lda.",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Avenida da Liberdade 152 2º Direito",
> > 				"locality": "Lisboa",
> > 				"code": "1250-146",
> > 				"country": "PT"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"quantity": "1",
> > 			"item": {
> > 				"name": "Serviços de consultoria",
> > 				"price": "1000.00",
> > 				"unit": "h"
> > 			},
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"rate": "standard"
> > 				},
> > 				{
> > 					"cat": "IRS",
> > 					"percent": "25%"
> > 				}
> > 			]
> > 		}
> > 	]
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> >   "$schema": "https://gobl.org/draft-0/bill/invoice",
> >   "$regime": "PT",
> >   "$addons": [
> >     "pt-saft-v1"
> >   ],
> >   "type": "standard",
> >   "series": "FT SERIES-A",
> >   "issue_date": "2024-08-03",
> >   "value_date": "2024-08-03",
> >   "currency": "EUR",
> >   "tax": {
> >     "ext": {
> >       "pt-saft-invoice-type": "FT",
> >       "pt-saft-source": "P"
> >     },
> >     "notes": [
> >       {
> >         "cat": "IRS",
> >         "text": "Art. 101.º CIRS"
> >       }
> >     ]
> >   },
> >   "supplier": {
> >     "name": "João Silva, Trabalhador Independente",
> >     "tax_id": {
> >       "country": "PT",
> >       "code": "545259045"
> >     },
> >     "addresses": [
> >       {
> >         "street": "Rua das Flores",
> >         "locality": "Lisboa",
> >         "code": "1000-000",
> >         "country": "PT"
> >       }
> >     ],
> >     "emails": [
> >       {
> >         "addr": "joao.silva@example.com"
> >       }
> >     ]
> >   },
> >   "customer": {
> >     "name": "Empresa Cliente, Lda.",
> >     "tax_id": {
> >       "country": "PT",
> >       "code": "514329874"
> >     },
> >     "addresses": [
> >       {
> >         "street": "Avenida da Liberdade 152 2º Direito",
> >         "locality": "Lisboa",
> >         "code": "1250-146",
> >         "country": "PT"
> >       }
> >     ]
> >   },
> >   "lines": [
> >     {
> >       "i": 1,
> >       "quantity": "1",
> >       "item": {
> >         "name": "Serviços de consultoria",
> >         "price": "1000.00",
> >         "unit": "h",
> >         "ext": {
> >           "pt-saft-product-type": "S"
> >         }
> >       },
> >       "sum": "1000.00",
> >       "taxes": [
> >         {
> >           "cat": "VAT",
> >           "key": "standard",
> >           "rate": "general",
> >           "percent": "23.0%",
> >           "ext": {
> >             "pt-region": "PT",
> >             "pt-saft-tax-rate": "NOR"
> >           }
> >         },
> >         {
> >           "cat": "IRS",
> >           "percent": "25%"
> >         }
> >       ],
> >       "total": "1000.00"
> >     }
> >   ],
> >   "totals": {
> >     "sum": "1000.00",
> >     "total": "1000.00",
> >     "taxes": {
> >       "categories": [
> >         {
> >           "code": "VAT",
> >           "rates": [
> >             {
> >               "key": "standard",
> >               "ext": {
> >                 "pt-region": "PT",
> >                 "pt-saft-tax-rate": "NOR"
> >               },
> >               "base": "1000.00",
> >               "percent": "23.0%",
> >               "amount": "230.00"
> >             }
> >           ],
> >           "amount": "230.00"
> >         },
> >         {
> >           "code": "IRS",
> >           "retained": true,
> >           "rates": [
> >             {
> >               "base": "1000.00",
> >               "percent": "25%",
> >               "amount": "250.00"
> >             }
> >           ],
> >           "amount": "250.00"
> >         }
> >       ],
> >       "sum": "230.00",
> >       "retained": "250.00"
> >     },
> >     "tax": "230.00",
> >     "total_with_tax": "1230.00",
> >     "retained_tax": "250.00",
> >     "payable": "980.00"
> >   }
> > }
> > ```
>
> > [accordion] AT Cash VAT invoice
> >
> > In this example, we're issuing a standard invoice from a Portuguese supplier that has adhered to the **Cash VAT scheme** (*regime de IVA de Caixa*), under which VAT becomes due only when the customer actually pays rather than when the invoice is issued.
> >
> > Notice:
> >
> > * the only difference from the standard AT B2B invoice above is the `cash-vat` tag (`$tags: ["cash-vat"]`), which flags the supplier's membership in the scheme,
> > * the [`pt-saft-v1`](https://docs.gobl.org/addons/pt-saft-v1) addon reacts to that tag by setting the [`pt-saft-cash-vat`](https://docs.gobl.org/addons/pt-saft-v1#cash-vat-scheme-indicator) extension to `1` in the invoice's `tax` section, and,
> > * the document is otherwise a normal `standard` invoice: the [`pt-saft-invoice-type`](https://docs.gobl.org/addons/pt-saft-v1#invoice-type) extension is still set to `FT` (Fatura) and the standard VAT rate still maps to the [`pt-saft-tax-rate`](https://docs.gobl.org/addons/pt-saft-v1#tax-rate-code) extension `NOR`.
> >
> > ```json AT Cash VAT invoice (minimal) theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"$tags": [
> > 		"cash-vat"
> > 	],
> > 	"type": "standard",
> > 	"series": "FT SERIES-A",
> > 	"issue_date": "2024-12-23",
> > 	"currency": "EUR",
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "504614240"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"num": "156",
> > 				"street": "Avenida da República",
> > 				"locality": "Lisboa",
> > 				"code": "1050-045",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "maria@example.com"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "150000.00",
> > 			"office": "CRC Lisboa",
> > 			"other": "sob NIF 770013813"
> > 		}
> > 	},
> > 	"customer": {
> > 		"name": "Gusto Unipessoal Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Avenida da Liberdade 152 2º Direito",
> > 				"locality": "Lisboa",
> > 				"code": "1250-146",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "gusto@example.com"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"quantity": "20.0",
> > 			"item": {
> > 				"name": "Development services",
> > 				"price": "50.00",
> > 				"unit": "h"
> > 			},
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"rate": "standard"
> > 				}
> > 			]
> > 		}
> > 	]
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"$tags": [
> > 		"cash-vat"
> > 	],
> > 	"type": "standard",
> > 	"series": "FT SERIES-A",
> > 	"issue_date": "2024-12-23",
> > 	"value_date": "2024-12-23",
> > 	"currency": "EUR",
> > 	"tax": {
> > 		"ext": {
> > 			"pt-saft-cash-vat": "1",
> > 			"pt-saft-invoice-type": "FT",
> > 			"pt-saft-source": "P"
> > 		}
> > 	},
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "504614240"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"num": "156",
> > 				"street": "Avenida da República",
> > 				"locality": "Lisboa",
> > 				"code": "1050-045",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "maria@example.com"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "150000.00",
> > 			"office": "CRC Lisboa",
> > 			"other": "sob NIF 770013813"
> > 		}
> > 	},
> > 	"customer": {
> > 		"name": "Gusto Unipessoal Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Avenida da Liberdade 152 2º Direito",
> > 				"locality": "Lisboa",
> > 				"code": "1250-146",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "gusto@example.com"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"i": 1,
> > 			"quantity": "20.0",
> > 			"item": {
> > 				"name": "Development services",
> > 				"price": "50.00",
> > 				"unit": "h",
> > 				"ext": {
> > 					"pt-saft-product-type": "S"
> > 				}
> > 			},
> > 			"sum": "1000.00",
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"key": "standard",
> > 					"rate": "general",
> > 					"percent": "23.0%",
> > 					"ext": {
> > 						"pt-region": "PT",
> > 						"pt-saft-tax-rate": "NOR"
> > 					}
> > 				}
> > 			],
> > 			"total": "1000.00"
> > 		}
> > 	],
> > 	"totals": {
> > 		"sum": "1000.00",
> > 		"total": "1000.00",
> > 		"taxes": {
> > 			"categories": [
> > 				{
> > 					"code": "VAT",
> > 					"rates": [
> > 						{
> > 							"key": "standard",
> > 							"ext": {
> > 								"pt-region": "PT",
> > 								"pt-saft-tax-rate": "NOR"
> > 							},
> > 							"base": "1000.00",
> > 							"percent": "23.0%",
> > 							"amount": "230.00"
> > 						}
> > 					],
> > 					"amount": "230.00"
> > 				}
> > 			],
> > 			"sum": "230.00"
> > 		},
> > 		"tax": "230.00",
> > 		"total_with_tax": "1230.00",
> > 		"payable": "1230.00"
> > 	}
> > }
> > ```
>
> > [accordion] AT simplified invoice
> >
> > In this example, we're issuing a simplified invoice (*Fatura Simplificada*) — the short-form invoice used for low-value retail sales where the customer doesn't need to be identified.
> >
> > Notice:
> >
> > * the document carries the `simplified` tag (`$tags: ["simplified"]`) and omits the `customer` entirely,
> > * the [`pt-saft-v1`](https://docs.gobl.org/addons/pt-saft-v1) addon reacts to the tag by setting the [`pt-saft-invoice-type`](https://docs.gobl.org/addons/pt-saft-v1#invoice-type) extension to `FS` (Fatura Simplificada), and the `series` follows the matching `FS ` prefix convention,
> > * if the document also records full payment (for example, a 100% advance), the addon derives the type `FR` (Fatura-Recibo) instead, and the series must then use the `FR ` prefix; see the [AT invoice-receipt](#at-invoice-receipt-fatura-recibo) example below, and,
> > * as with the other examples, totals and tax breakdowns are calculated automatically when running `gobl build` or uploading.
> >
> > ```json AT Simplified Invoice (minimal) theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"$tags": [
> > 		"simplified"
> > 	],
> > 	"type": "standard",
> > 	"series": "FS SERIES-A",
> > 	"issue_date": "2024-12-23",
> > 	"currency": "EUR",
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "504614240"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"num": "156",
> > 				"street": "Avenida da República",
> > 				"locality": "Lisboa",
> > 				"code": "1050-045",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "maria@example.com"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "150000.00",
> > 			"office": "CRC Lisboa",
> > 			"other": "sob NIF 770013813"
> > 		}
> > 	},
> > 	"lines": [
> > 		{
> > 			"quantity": "1",
> > 			"item": {
> > 				"name": "Suporte técnico presencial",
> > 				"price": "45.00",
> > 				"unit": "h"
> > 			},
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"rate": "standard"
> > 				}
> > 			]
> > 		}
> > 	]
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"$tags": [
> > 		"simplified"
> > 	],
> > 	"type": "standard",
> > 	"series": "FS SERIES-A",
> > 	"issue_date": "2024-12-23",
> > 	"value_date": "2024-12-23",
> > 	"currency": "EUR",
> > 	"tax": {
> > 		"ext": {
> > 			"pt-saft-invoice-type": "FS",
> > 			"pt-saft-source": "P"
> > 		}
> > 	},
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "504614240"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"num": "156",
> > 				"street": "Avenida da República",
> > 				"locality": "Lisboa",
> > 				"code": "1050-045",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "maria@example.com"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "150000.00",
> > 			"office": "CRC Lisboa",
> > 			"other": "sob NIF 770013813"
> > 		}
> > 	},
> > 	"lines": [
> > 		{
> > 			"i": 1,
> > 			"quantity": "1",
> > 			"item": {
> > 				"name": "Suporte técnico presencial",
> > 				"price": "45.00",
> > 				"unit": "h",
> > 				"ext": {
> > 					"pt-saft-product-type": "S"
> > 				}
> > 			},
> > 			"sum": "45.00",
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"key": "standard",
> > 					"rate": "general",
> > 					"percent": "23.0%",
> > 					"ext": {
> > 						"pt-region": "PT",
> > 						"pt-saft-tax-rate": "NOR"
> > 					}
> > 				}
> > 			],
> > 			"total": "45.00"
> > 		}
> > 	],
> > 	"totals": {
> > 		"sum": "45.00",
> > 		"total": "45.00",
> > 		"taxes": {
> > 			"categories": [
> > 				{
> > 					"code": "VAT",
> > 					"rates": [
> > 						{
> > 							"key": "standard",
> > 							"ext": {
> > 								"pt-region": "PT",
> > 								"pt-saft-tax-rate": "NOR"
> > 							},
> > 							"base": "45.00",
> > 							"percent": "23.0%",
> > 							"amount": "10.35"
> > 						}
> > 					],
> > 					"amount": "10.35"
> > 				}
> > 			],
> > 			"sum": "10.35"
> > 		},
> > 		"tax": "10.35",
> > 		"total_with_tax": "55.35",
> > 		"payable": "55.35"
> > 	}
> > }
> > ```
>
> > [accordion] AT work document
> >
> > In this example, we're issuing a work document (*documento de conferência*): a non-fiscal document presented to a customer for checking goods or services before the final invoice.
> >
> > Notice:
> >
> > * work documents use the [`bill/order`](https://docs.gobl.org/draft-0/bill/order) schema rather than `bill/invoice`, and are reported to the AT under SAF-T's `WorkingDocuments` table,
> > * the [`pt-saft-work-type`](https://docs.gobl.org/addons/pt-saft-v1#document-type) extension is set explicitly to `OU` (*Outros*); unlike `NE` and `OR`, which the addon derives from the `purchase` and `quote` order types, `OU` has no order type of its own and must be declared,
> > * the `series` follows the `OU ` prefix convention and must be registered through the Supplier Portal, exactly as an invoice series is,
> > * when running `gobl build`, or uploading the document, the [`pt-saft-source`](https://docs.gobl.org/addons/pt-saft-v1#document-source) extension defaults to `P` (*produced*), totals and tax breakdowns are calculated, and the [`pt-saft-product-type`](https://docs.gobl.org/addons/pt-saft-v1#product-type) extension is derived per line, and,
> > * to close the loop once the document is invoiced, set the invoice line's `order` field to the work document's number (for example `OU SERIES-A/1`); Invopop then marks it as billed in the SAF-T record.
> >
> > Proformas (`PF`) are also work documents, but are built on `bill/invoice` rather than `bill/order`. See the next example.
> >
> > ```json AT Work document theme={"system"}
> > {
> >   "$schema": "https://gobl.org/draft-0/bill/order",
> >   "$regime": "PT",
> >   "$addons": [
> >     "pt-saft-v1"
> >   ],
> >   "type": "sale",
> >   "series": "OU SERIES-A",
> >   "issue_date": "2024-12-23",
> >   "tax": {
> >     "ext": {
> >       "pt-saft-work-type": "OU"
> >     }
> >   },
> >   "supplier": {
> >     "name": "Innovatech Lda",
> >     "tax_id": {
> >       "country": "PT",
> >       "code": "770013813"
> >     },
> >     "addresses": [
> >       {
> >         "street": "Rua das Flores 200 3º Esquerdo",
> >         "locality": "Porto",
> >         "code": "4050-265",
> >         "country": "PT"
> >       }
> >     ],
> >     "registration": {
> >       "capital": "100000.00",
> >       "office": "Porto"
> >     }
> >   },
> >   "customer": {
> >     "name": "Gusto Unipessoal Lda",
> >     "tax_id": {
> >       "country": "PT",
> >       "code": "514329874"
> >     }
> >   },
> >   "lines": [
> >     {
> >       "quantity": "2",
> >       "item": {
> >         "name": "Noite em quarto duplo",
> >         "price": "50.00"
> >       },
> >       "taxes": [
> >         {
> >           "cat": "VAT",
> >           "rate": "general"
> >         }
> >       ]
> >     },
> >     {
> >       "quantity": "1",
> >       "item": {
> >         "name": "Jantar no restaurante",
> >         "price": "45.00"
> >       },
> >       "taxes": [
> >         {
> >           "cat": "VAT",
> >           "rate": "general"
> >         }
> >       ]
> >     }
> >   ]
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/order",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"type": "sale",
> > 	"series": "OU SERIES-A",
> > 	"issue_date": "2024-12-23",
> > 	"value_date": "2024-12-23",
> > 	"currency": "EUR",
> > 	"tax": {
> > 		"ext": {
> > 			"pt-saft-source": "P",
> > 			"pt-saft-work-type": "OU"
> > 		}
> > 	},
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "770013813"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Rua das Flores 200 3º Esquerdo",
> > 				"locality": "Porto",
> > 				"code": "4050-265",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "100000.00",
> > 			"office": "Porto"
> > 		}
> > 	},
> > 	"customer": {
> > 		"name": "Gusto Unipessoal Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		}
> > 	},
> > 	"lines": [
> > 		{
> > 			"i": 1,
> > 			"quantity": "2",
> > 			"item": {
> > 				"name": "Noite em quarto duplo",
> > 				"price": "50.00",
> > 				"unit": "one",
> > 				"ext": {
> > 					"pt-saft-product-type": "S"
> > 				}
> > 			},
> > 			"sum": "100.00",
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"key": "standard",
> > 					"rate": "general",
> > 					"percent": "23.0%",
> > 					"ext": {
> > 						"pt-region": "PT",
> > 						"pt-saft-tax-rate": "NOR"
> > 					}
> > 				}
> > 			],
> > 			"total": "100.00"
> > 		},
> > 		{
> > 			"i": 2,
> > 			"quantity": "1",
> > 			"item": {
> > 				"name": "Jantar no restaurante",
> > 				"price": "45.00",
> > 				"unit": "one",
> > 				"ext": {
> > 					"pt-saft-product-type": "S"
> > 				}
> > 			},
> > 			"sum": "45.00",
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"key": "standard",
> > 					"rate": "general",
> > 					"percent": "23.0%",
> > 					"ext": {
> > 						"pt-region": "PT",
> > 						"pt-saft-tax-rate": "NOR"
> > 					}
> > 				}
> > 			],
> > 			"total": "45.00"
> > 		}
> > 	],
> > 	"totals": {
> > 		"sum": "145.00",
> > 		"total": "145.00",
> > 		"taxes": {
> > 			"categories": [
> > 				{
> > 					"code": "VAT",
> > 					"rates": [
> > 						{
> > 							"key": "standard",
> > 							"ext": {
> > 								"pt-region": "PT",
> > 								"pt-saft-tax-rate": "NOR"
> > 							},
> > 							"base": "145.00",
> > 							"percent": "23.0%",
> > 							"amount": "33.35"
> > 						}
> > 					],
> > 					"amount": "33.35"
> > 				}
> > 			],
> > 			"sum": "33.35"
> > 		},
> > 		"tax": "33.35",
> > 		"total_with_tax": "178.35",
> > 		"payable": "178.35"
> > 	}
> > }
> > ```
>
> > [accordion] AT invoice-receipt (Fatura-Recibo)
> >
> > In these examples, we're issuing an invoice-receipt (*Fatura-Recibo*): an invoice that is fully paid at the moment it is issued. The `payment.advances` entries cover the full document total, so the built document ends up with `totals.due` at `0.00`. The first example is a standard invoice with an identified customer; the second is the simplified (retail) variant.
> >
> > Notice:
> >
> > * the `series` must use the `FR ` prefix (for example `FR SERIES-A`). Sending a fully paid invoice on an `FT` or `FS` series fails with `series format must be valid`; see [Series management → Naming](https://docs.invopop.com/guides/pt-at-supplier.md#naming),
> > * each entry in `payment.advances` is one payment. List several to record a mix of payment methods — here a card deposit followed by cash at checkout — and each one is shown on the PDF with its date, `description`, and amount. The PDF does not print the method itself, so name it in the `description` (for example `Card deposit`),
> > * when running `gobl build`, or uploading the file, the [`pt-saft-v1`](https://docs.gobl.org/addons/pt-saft-v1) addon sets the [`pt-saft-invoice-type`](https://docs.gobl.org/addons/pt-saft-v1#invoice-type) extension to `FR` automatically once the advances cover the total, and sets the [`pt-saft-payment-means`](https://docs.gobl.org/addons/pt-saft-v1#payment-means) extension on each advance from its `key` (`card` → `CC`, `cash` → `NU`), and,
> > * the simplified variant only differs by the `simplified` tag (`$tags: ["simplified"]`) and the missing `customer`; the `payment.advances` block is identical, and the series still uses the `FR ` prefix rather than `FS `.
> >
> > **Standard invoice-receipt** (with customer):
> >
> > ```json AT Invoice-Receipt (minimal) theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"type": "standard",
> > 	"series": "FR SERIES-A",
> > 	"issue_date": "2026-10-29",
> > 	"currency": "EUR",
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "504614240"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"num": "156",
> > 				"street": "Avenida da República",
> > 				"locality": "Lisboa",
> > 				"code": "1050-045",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "maria@example.com"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "150000.00",
> > 			"office": "CRC Lisboa",
> > 			"other": "sob NIF 770013813"
> > 		}
> > 	},
> > 	"customer": {
> > 		"name": "Gusto Unipessoal Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Avenida da Liberdade 152 2º Direito",
> > 				"locality": "Lisboa",
> > 				"code": "1250-146",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "gusto@example.com"
> > 			}
> > 		],
> > 		"websites": [
> > 			{
> > 				"url": "https://gusto.example.com"
> > 			}
> > 		],
> > 		"telephones": [
> > 			{
> > 				"num": "+351912345678"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"quantity": "2",
> > 			"item": {
> > 				"name": "Room night",
> > 				"price": "100.00",
> > 				"unit": "h"
> > 			},
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"rate": "standard"
> > 				}
> > 			]
> > 		}
> > 	],
> > 	"payment": {
> > 		"advances": [
> > 			{
> > 				"date": "2026-10-20",
> > 				"key": "card",
> > 				"description": "Card deposit",
> > 				"amount": "100.00"
> > 			},
> > 			{
> > 				"date": "2026-10-29",
> > 				"key": "cash",
> > 				"description": "Cash at checkout",
> > 				"amount": "146.00"
> > 			}
> > 		]
> > 	}
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"type": "standard",
> > 	"series": "FR SERIES-A",
> > 	"issue_date": "2026-10-29",
> > 	"value_date": "2026-10-29",
> > 	"currency": "EUR",
> > 	"tax": {
> > 		"ext": {
> > 			"pt-saft-invoice-type": "FR",
> > 			"pt-saft-source": "P"
> > 		}
> > 	},
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "504614240"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"num": "156",
> > 				"street": "Avenida da República",
> > 				"locality": "Lisboa",
> > 				"code": "1050-045",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "maria@example.com"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "150000.00",
> > 			"office": "CRC Lisboa",
> > 			"other": "sob NIF 770013813"
> > 		}
> > 	},
> > 	"customer": {
> > 		"name": "Gusto Unipessoal Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Avenida da Liberdade 152 2º Direito",
> > 				"locality": "Lisboa",
> > 				"code": "1250-146",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "gusto@example.com"
> > 			}
> > 		],
> > 		"websites": [
> > 			{
> > 				"url": "https://gusto.example.com"
> > 			}
> > 		],
> > 		"telephones": [
> > 			{
> > 				"num": "+351912345678"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"i": 1,
> > 			"quantity": "2",
> > 			"item": {
> > 				"name": "Room night",
> > 				"price": "100.00",
> > 				"unit": "h",
> > 				"ext": {
> > 					"pt-saft-product-type": "S"
> > 				}
> > 			},
> > 			"sum": "200.00",
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"key": "standard",
> > 					"rate": "general",
> > 					"percent": "23.0%",
> > 					"ext": {
> > 						"pt-region": "PT",
> > 						"pt-saft-tax-rate": "NOR"
> > 					}
> > 				}
> > 			],
> > 			"total": "200.00"
> > 		}
> > 	],
> > 	"payment": {
> > 		"advances": [
> > 			{
> > 				"date": "2026-10-20",
> > 				"key": "card",
> > 				"description": "Card deposit",
> > 				"amount": "100.00",
> > 				"ext": {
> > 					"pt-saft-payment-means": "CC"
> > 				}
> > 			},
> > 			{
> > 				"date": "2026-10-29",
> > 				"key": "cash",
> > 				"description": "Cash at checkout",
> > 				"amount": "146.00",
> > 				"ext": {
> > 					"pt-saft-payment-means": "NU"
> > 				}
> > 			}
> > 		]
> > 	},
> > 	"totals": {
> > 		"sum": "200.00",
> > 		"total": "200.00",
> > 		"taxes": {
> > 			"categories": [
> > 				{
> > 					"code": "VAT",
> > 					"rates": [
> > 						{
> > 							"key": "standard",
> > 							"ext": {
> > 								"pt-region": "PT",
> > 								"pt-saft-tax-rate": "NOR"
> > 							},
> > 							"base": "200.00",
> > 							"percent": "23.0%",
> > 							"amount": "46.00"
> > 						}
> > 					],
> > 					"amount": "46.00"
> > 				}
> > 			],
> > 			"sum": "46.00"
> > 		},
> > 		"tax": "46.00",
> > 		"total_with_tax": "246.00",
> > 		"payable": "246.00",
> > 		"advance": "246.00",
> > 		"due": "0.00"
> > 	}
> > }
> > ```
> >
> > **Simplified invoice-receipt** (no customer):
> >
> > ```json AT Simplified Invoice-Receipt (minimal) theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"$tags": [
> > 		"simplified"
> > 	],
> > 	"type": "standard",
> > 	"series": "FR SERIES-A",
> > 	"issue_date": "2026-10-29",
> > 	"currency": "EUR",
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "504614240"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"num": "156",
> > 				"street": "Avenida da República",
> > 				"locality": "Lisboa",
> > 				"code": "1050-045",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "maria@example.com"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "150000.00",
> > 			"office": "CRC Lisboa",
> > 			"other": "sob NIF 770013813"
> > 		}
> > 	},
> > 	"lines": [
> > 		{
> > 			"quantity": "2",
> > 			"item": {
> > 				"name": "Room night",
> > 				"price": "100.00",
> > 				"unit": "h"
> > 			},
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"rate": "standard"
> > 				}
> > 			]
> > 		}
> > 	],
> > 	"payment": {
> > 		"advances": [
> > 			{
> > 				"date": "2026-10-20",
> > 				"key": "card",
> > 				"description": "Card deposit",
> > 				"amount": "100.00"
> > 			},
> > 			{
> > 				"date": "2026-10-29",
> > 				"key": "cash",
> > 				"description": "Cash at checkout",
> > 				"amount": "146.00"
> > 			}
> > 		]
> > 	}
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"$tags": [
> > 		"simplified"
> > 	],
> > 	"type": "standard",
> > 	"series": "FR SERIES-A",
> > 	"issue_date": "2026-10-29",
> > 	"value_date": "2026-10-29",
> > 	"currency": "EUR",
> > 	"tax": {
> > 		"ext": {
> > 			"pt-saft-invoice-type": "FR",
> > 			"pt-saft-source": "P"
> > 		}
> > 	},
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "504614240"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"num": "156",
> > 				"street": "Avenida da República",
> > 				"locality": "Lisboa",
> > 				"code": "1050-045",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "maria@example.com"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "150000.00",
> > 			"office": "CRC Lisboa",
> > 			"other": "sob NIF 770013813"
> > 		}
> > 	},
> > 	"lines": [
> > 		{
> > 			"i": 1,
> > 			"quantity": "2",
> > 			"item": {
> > 				"name": "Room night",
> > 				"price": "100.00",
> > 				"unit": "h",
> > 				"ext": {
> > 					"pt-saft-product-type": "S"
> > 				}
> > 			},
> > 			"sum": "200.00",
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"key": "standard",
> > 					"rate": "general",
> > 					"percent": "23.0%",
> > 					"ext": {
> > 						"pt-region": "PT",
> > 						"pt-saft-tax-rate": "NOR"
> > 					}
> > 				}
> > 			],
> > 			"total": "200.00"
> > 		}
> > 	],
> > 	"payment": {
> > 		"advances": [
> > 			{
> > 				"date": "2026-10-20",
> > 				"key": "card",
> > 				"description": "Card deposit",
> > 				"amount": "100.00",
> > 				"ext": {
> > 					"pt-saft-payment-means": "CC"
> > 				}
> > 			},
> > 			{
> > 				"date": "2026-10-29",
> > 				"key": "cash",
> > 				"description": "Cash at checkout",
> > 				"amount": "146.00",
> > 				"ext": {
> > 					"pt-saft-payment-means": "NU"
> > 				}
> > 			}
> > 		]
> > 	},
> > 	"totals": {
> > 		"sum": "200.00",
> > 		"total": "200.00",
> > 		"taxes": {
> > 			"categories": [
> > 				{
> > 					"code": "VAT",
> > 					"rates": [
> > 						{
> > 							"key": "standard",
> > 							"ext": {
> > 								"pt-region": "PT",
> > 								"pt-saft-tax-rate": "NOR"
> > 							},
> > 							"base": "200.00",
> > 							"percent": "23.0%",
> > 							"amount": "46.00"
> > 						}
> > 					],
> > 					"amount": "46.00"
> > 				}
> > 			],
> > 			"sum": "46.00"
> > 		},
> > 		"tax": "46.00",
> > 		"total_with_tax": "246.00",
> > 		"payable": "246.00",
> > 		"advance": "246.00",
> > 		"due": "0.00"
> > 	}
> > }
> > ```
>
> > [accordion] AT proforma invoice
> >
> > In this example, we're issuing a proforma (*pró-forma*): a non-fiscal document sent to a customer to request payment in advance of the final invoice.
> >
> > Notice:
> >
> > * proformas are built on the [`bill/invoice`](https://docs.gobl.org/draft-0/bill/invoice) schema rather than `bill/order`, since they mirror the invoice they anticipate; they are still reported to the AT under SAF-T's `WorkingDocuments` table and not `SalesInvoices`,
> > * the [`pt-saft-work-type`](https://docs.gobl.org/addons/pt-saft-v1#document-type) extension is derived from the addon from `type: proforma`,
> > * `type: proforma` is the only thing separating this from an ordinary invoice; drop it and the addon normalises the document to a standard invoice with [`pt-saft-invoice-type`](https://docs.gobl.org/addons/pt-saft-v1#invoice-type) `FT` instead,
> > * the `series` follows the `PF ` prefix convention and must be registered through the Supplier Portal, exactly as an invoice series is, and,
> > * a proforma settles no VAT: issue the corresponding `FT` invoice when the customer pays.
> >
> > ```json AT Proforma theme={"system"}
> > {
> >   "$schema": "https://gobl.org/draft-0/bill/invoice",
> >   "$regime": "PT",
> >   "$addons": [
> >     "pt-saft-v1"
> >   ],
> >   "type": "proforma",
> >   "series": "PF SERIES-A",
> >   "issue_date": "2024-12-23",
> >   "supplier": {
> >     "name": "Innovatech Lda",
> >     "tax_id": {
> >       "country": "PT",
> >       "code": "770013813"
> >     },
> >     "addresses": [
> >       {
> >         "street": "Rua das Flores 200 3º Esquerdo",
> >         "locality": "Porto",
> >         "code": "4050-265",
> >         "country": "PT"
> >       }
> >     ],
> >     "registration": {
> >       "capital": "100000.00",
> >       "office": "Porto"
> >     }
> >   },
> >   "customer": {
> >     "name": "Gusto Unipessoal Lda",
> >     "tax_id": {
> >       "country": "PT",
> >       "code": "514329874"
> >     }
> >   },
> >   "lines": [
> >     {
> >       "quantity": "1",
> >       "item": {
> >         "name": "Licença anual de software",
> >         "price": "1200.00",
> >         "unit": "item"
> >       },
> >       "taxes": [
> >         {
> >           "cat": "VAT",
> >           "rate": "general"
> >         }
> >       ]
> >     },
> >     {
> >       "quantity": "8",
> >       "item": {
> >         "name": "Serviços de implementação",
> >         "price": "75.00",
> >         "unit": "h"
> >       },
> >       "taxes": [
> >         {
> >           "cat": "VAT",
> >           "rate": "general"
> >         }
> >       ]
> >     }
> >   ],
> >   "payment": {
> >     "terms": {
> >       "key": "advanced"
> >     }
> >   }
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"type": "proforma",
> > 	"series": "PF SERIES-A",
> > 	"issue_date": "2024-12-23",
> > 	"value_date": "2024-12-23",
> > 	"currency": "EUR",
> > 	"tax": {
> > 		"ext": {
> > 			"pt-saft-source": "P",
> > 			"pt-saft-work-type": "PF"
> > 		}
> > 	},
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "770013813"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Rua das Flores 200 3º Esquerdo",
> > 				"locality": "Porto",
> > 				"code": "4050-265",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "100000.00",
> > 			"office": "Porto"
> > 		}
> > 	},
> > 	"customer": {
> > 		"name": "Gusto Unipessoal Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		}
> > 	},
> > 	"lines": [
> > 		{
> > 			"i": 1,
> > 			"quantity": "1",
> > 			"item": {
> > 				"name": "Licença anual de software",
> > 				"price": "1200.00",
> > 				"unit": "item",
> > 				"ext": {
> > 					"pt-saft-product-type": "S"
> > 				}
> > 			},
> > 			"sum": "1200.00",
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"key": "standard",
> > 					"rate": "general",
> > 					"percent": "23.0%",
> > 					"ext": {
> > 						"pt-region": "PT",
> > 						"pt-saft-tax-rate": "NOR"
> > 					}
> > 				}
> > 			],
> > 			"total": "1200.00"
> > 		},
> > 		{
> > 			"i": 2,
> > 			"quantity": "8",
> > 			"item": {
> > 				"name": "Serviços de implementação",
> > 				"price": "75.00",
> > 				"unit": "h",
> > 				"ext": {
> > 					"pt-saft-product-type": "S"
> > 				}
> > 			},
> > 			"sum": "600.00",
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"key": "standard",
> > 					"rate": "general",
> > 					"percent": "23.0%",
> > 					"ext": {
> > 						"pt-region": "PT",
> > 						"pt-saft-tax-rate": "NOR"
> > 					}
> > 				}
> > 			],
> > 			"total": "600.00"
> > 		}
> > 	],
> > 	"payment": {
> > 		"terms": {
> > 			"key": "advanced"
> > 		}
> > 	},
> > 	"totals": {
> > 		"sum": "1800.00",
> > 		"total": "1800.00",
> > 		"taxes": {
> > 			"categories": [
> > 				{
> > 					"code": "VAT",
> > 					"rates": [
> > 						{
> > 							"key": "standard",
> > 							"ext": {
> > 								"pt-region": "PT",
> > 								"pt-saft-tax-rate": "NOR"
> > 							},
> > 							"base": "1800.00",
> > 							"percent": "23.0%",
> > 							"amount": "414.00"
> > 						}
> > 					],
> > 					"amount": "414.00"
> > 				}
> > 			],
> > 			"sum": "414.00"
> > 		},
> > 		"tax": "414.00",
> > 		"total_with_tax": "2214.00",
> > 		"payable": "2214.00"
> > 	}
> > }
> > ```
>
> > [accordion] AT delivery note
> >
> > In this example, we're issuing a delivery note from a Portuguese supplier to another Portuguese receiver.
> >
> > Notice:
> >
> > * the first tab shows the minimal version containing only the essential fields required to create the delivery document; there are no totals or calculations,
> > * the [`pt-saft-v1`](https://docs.gobl.org/addons/pt-saft-v1) addon ensures the document will be validated and normalized using the SAF-T PT v1 rules built into the [GOBL](https://docs.gobl.org) library,
> > * the `supplier` and `series` fields are set to example values; you'll need to replace them with the details of supplier and series registered as per the previous sections. The series must be registered in the Supplier Portal and follow Portuguese naming conventions (see [Series management](https://docs.invopop.com/guides/pt-at-supplier.md#series-management) for details),
> > * this is a `note` document type with the [`pt-saft-movement-type`](https://docs.gobl.org/addons/pt-saft-v1#movement-type) extension set to `GR` (Guia de Remessa),
> > * when running `gobl build`, or uploading the document, the system automatically calculates totals, applies the standard VAT rate with the [`pt-saft-tax-rate`](https://docs.gobl.org/addons/pt-saft-v1#tax-rate-code) extension set to `NOR`, and normalizes all fields,
> > * the second tab shows the built version of the document with the calculated totals, line item sums, tax breakdowns, and automatically generated fields, and,
> > * the [`pt-region`](https://docs.gobl.org/regimes/pt#region-code) extension is automatically set to `PT`.
> >
> > ```json AT Delivery (minimal) theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/delivery",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 			"pt-saft-v1"
> > 	],
> > 	"type": "note",
> > 	"series": "GR SERIES-A",
> > 	"issue_date": "2026-04-01",
> > 	"currency": "EUR",
> > 	"despatch_date": "2026-04-02",
> > 	"receive_date": "2026-04-03",
> > 	"supplier": {
> > 			"name": "Innovatech Lda",
> > 			"tax_id": {
> > 					"country": "PT",
> > 					"code": "770013813"
> > 			},
> > 			"addresses": [
> > 					{
> > 							"street": "Rua das Flores 200 3º Esquerdo",
> > 							"locality": "Porto",
> > 							"code": "4050-265",
> > 							"country": "PT"
> > 					}
> > 			],
> > 			"registration": {
> > 					"capital": "100000.00",
> > 					"office": "Porto"
> > 			}
> > 	},
> > 	"customer": {
> > 			"name": "Gusto Unipessoal Lda",
> > 			"tax_id": {
> > 					"country": "PT",
> > 					"code": "514329874"
> > 			},
> > 			"addresses": [
> > 					{
> > 							"street": "Avenida da Liberdade 152 2º Direito",
> > 							"locality": "Lisboa",
> > 							"code": "1250-146",
> > 							"country": "PT"
> > 					}
> > 			]
> > 	},
> > 	"despatcher": {
> > 			"name": "Innovatech Logistics",
> > 			"addresses": [
> > 					{
> > 							"street": "Rua da Indústria 45",
> > 							"locality": "Porto",
> > 							"code": "4050-300",
> > 							"country": "PT"
> > 					}
> > 			]
> > 	},
> > 	"receiver": {
> > 			"name": "Gusto Armazém",
> > 			"addresses": [
> > 					{
> > 							"street": "Zona Industrial, Lote 23",
> > 							"locality": "Lisboa",
> > 							"code": "1300-300",
> > 							"country": "PT"
> > 					}
> > 			]
> > 	},
> > 	"lines": [
> > 			{
> > 					"quantity": "10",
> > 					"item": {
> > 							"name": "Product A",
> > 							"price": "5.00",
> > 							"unit": "unit",
> > 							"ext": {
> > 									"pt-saft-product-type": "P"
> > 							}
> > 					},
> > 					"taxes": [
> > 							{
> > 									"cat": "VAT",
> > 									"rate": "standard"
> > 							}
> > 					]
> > 			}
> > 	],
> > 	"notes": [
> > 			{
> > 					"text": "Delivery note for products"
> > 			}
> > 	]
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/delivery",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"type": "note",
> > 	"series": "GR SERIES-A",
> > 	"issue_date": "2026-04-01",
> > 	"currency": "EUR",
> > 	"despatch_date": "2026-04-02",
> > 	"receive_date": "2026-04-03",
> > 	"tax": {
> > 		"ext": {
> > 			"pt-saft-movement-type": "GR"
> > 		}
> > 	},
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "770013813"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Rua das Flores 200 3º Esquerdo",
> > 				"locality": "Porto",
> > 				"code": "4050-265",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "100000.00",
> > 			"office": "Porto"
> > 		}
> > 	},
> > 	"customer": {
> > 		"name": "Gusto Unipessoal Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Avenida da Liberdade 152 2º Direito",
> > 				"locality": "Lisboa",
> > 				"code": "1250-146",
> > 				"country": "PT"
> > 			}
> > 		]
> > 	},
> > 	"despatcher": {
> > 		"name": "Innovatech Logistics",
> > 		"addresses": [
> > 			{
> > 				"street": "Rua da Indústria 45",
> > 				"locality": "Porto",
> > 				"code": "4050-300",
> > 				"country": "PT"
> > 			}
> > 		]
> > 	},
> > 	"receiver": {
> > 		"name": "Gusto Armazém",
> > 		"addresses": [
> > 			{
> > 				"street": "Zona Industrial, Lote 23",
> > 				"locality": "Lisboa",
> > 				"code": "1300-300",
> > 				"country": "PT"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"i": 1,
> > 			"quantity": "10",
> > 			"item": {
> > 				"name": "Product A",
> > 				"price": "5.00",
> > 				"unit": "unit",
> > 				"ext": {
> > 					"pt-saft-product-type": "P"
> > 				}
> > 			},
> > 			"sum": "50.00",
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"key": "standard",
> > 					"rate": "general",
> > 					"percent": "23.0%",
> > 					"ext": {
> > 						"pt-region": "PT",
> > 						"pt-saft-tax-rate": "NOR"
> > 					}
> > 				}
> > 			],
> > 			"total": "50.00"
> > 		}
> > 	],
> > 	"totals": {
> > 		"sum": "50.00",
> > 		"total": "50.00",
> > 		"taxes": {
> > 			"categories": [
> > 				{
> > 					"code": "VAT",
> > 					"rates": [
> > 						{
> > 							"key": "standard",
> > 							"ext": {
> > 								"pt-region": "PT",
> > 								"pt-saft-tax-rate": "NOR"
> > 							},
> > 							"base": "50.00",
> > 							"percent": "23.0%",
> > 							"amount": "11.50"
> > 						}
> > 					],
> > 					"amount": "11.50"
> > 				}
> > 			],
> > 			"sum": "11.50"
> > 		},
> > 		"tax": "11.50",
> > 		"total_with_tax": "61.50",
> > 		"payable": "61.50"
> > 	},
> > 	"notes": [
> > 		{
> > 			"text": "Delivery note for products"
> > 		}
> > 	]
> > }
> > ```
>
> > [accordion] AT return guide
> >
> > A return guide (*Guia de Devolução*) records goods being returned to the supplier — for example, defective items, unsold stock, or any other scenario where previously delivered goods are sent back.
> >
> > Notice:
> >
> > * the document carries the `return` tag (`$tags: ["return"]`), which the [`pt-saft-v1`](https://docs.gobl.org/addons/pt-saft-v1) addon uses to automatically set the [`pt-saft-movement-type`](https://docs.gobl.org/addons/pt-saft-v1#movement-type) extension to `GD` (Guia de Devolução),
> > * the `series` follows the `GD ` prefix convention and must be registered through the Supplier Portal, and,
> > * the flow of goods is reversed compared to a delivery note: the `customer` is the party returning the goods, and the `supplier` is the one receiving them back.
> >
> > ```json AT Return guide (minimal) theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/delivery",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 			"pt-saft-v1"
> > 	],
> > 	"$tags": ["return"],
> > 	"type": "note",
> > 	"series": "GD SERIES-A",
> > 	"issue_date": "2026-04-03",
> > 	"currency": "EUR",
> > 	"despatch_date": "2026-04-03",
> > 	"receive_date": "2026-04-03",
> > 	"supplier": {
> > 			"name": "Innovatech Lda",
> > 			"tax_id": {
> > 					"country": "PT",
> > 					"code": "770013813"
> > 			},
> > 			"addresses": [
> > 					{
> > 							"street": "Rua das Flores 200 3º Esquerdo",
> > 							"locality": "Porto",
> > 							"code": "4050-265",
> > 							"country": "PT"
> > 					}
> > 			],
> > 			"registration": {
> > 					"capital": "100000.00",
> > 					"office": "Porto"
> > 			}
> > 	},
> > 	"customer": {
> > 			"name": "Gusto Unipessoal Lda",
> > 			"tax_id": {
> > 					"country": "PT",
> > 					"code": "514329874"
> > 			},
> > 			"addresses": [
> > 					{
> > 							"street": "Avenida da Liberdade 152 2º Direito",
> > 							"locality": "Lisboa",
> > 							"code": "1250-146",
> > 							"country": "PT"
> > 					}
> > 			]
> > 	},
> > 	"despatcher": {
> > 			"name": "Gusto Armazém",
> > 			"addresses": [
> > 					{
> > 							"street": "Zona Industrial, Lote 23",
> > 							"locality": "Lisboa",
> > 							"code": "1300-300",
> > 							"country": "PT"
> > 					}
> > 			]
> > 	},
> > 	"receiver": {
> > 			"name": "Innovatech Logistics",
> > 			"addresses": [
> > 					{
> > 							"street": "Rua da Indústria 45",
> > 							"locality": "Porto",
> > 							"code": "4050-300",
> > 							"country": "PT"
> > 					}
> > 			]
> > 	},
> > 	"lines": [
> > 			{
> > 					"quantity": "3",
> > 					"item": {
> > 							"name": "Product A",
> > 							"price": "5.00",
> > 							"unit": "unit",
> > 							"ext": {
> > 									"pt-saft-product-type": "P"
> > 							}
> > 					},
> > 					"taxes": [
> > 							{
> > 									"cat": "VAT",
> > 									"rate": "standard"
> > 							}
> > 					]
> > 			}
> > 	],
> > 	"notes": [
> > 			{
> > 					"text": "Goods returned by the customer."
> > 			}
> > 	]
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/delivery",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"$tags": [
> > 		"return"
> > 	],
> > 	"type": "note",
> > 	"series": "GD SERIES-A",
> > 	"issue_date": "2026-04-03",
> > 	"currency": "EUR",
> > 	"despatch_date": "2026-04-03",
> > 	"receive_date": "2026-04-03",
> > 	"tax": {
> > 		"ext": {
> > 			"pt-saft-movement-type": "GD"
> > 		}
> > 	},
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "770013813"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Rua das Flores 200 3º Esquerdo",
> > 				"locality": "Porto",
> > 				"code": "4050-265",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "100000.00",
> > 			"office": "Porto"
> > 		}
> > 	},
> > 	"customer": {
> > 		"name": "Gusto Unipessoal Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Avenida da Liberdade 152 2º Direito",
> > 				"locality": "Lisboa",
> > 				"code": "1250-146",
> > 				"country": "PT"
> > 			}
> > 		]
> > 	},
> > 	"despatcher": {
> > 		"name": "Gusto Armazém",
> > 		"addresses": [
> > 			{
> > 				"street": "Zona Industrial, Lote 23",
> > 				"locality": "Lisboa",
> > 				"code": "1300-300",
> > 				"country": "PT"
> > 			}
> > 		]
> > 	},
> > 	"receiver": {
> > 		"name": "Innovatech Logistics",
> > 		"addresses": [
> > 			{
> > 				"street": "Rua da Indústria 45",
> > 				"locality": "Porto",
> > 				"code": "4050-300",
> > 				"country": "PT"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"i": 1,
> > 			"quantity": "3",
> > 			"item": {
> > 				"name": "Product A",
> > 				"price": "5.00",
> > 				"unit": "unit",
> > 				"ext": {
> > 					"pt-saft-product-type": "P"
> > 				}
> > 			},
> > 			"sum": "15.00",
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"key": "standard",
> > 					"rate": "general",
> > 					"percent": "23.0%",
> > 					"ext": {
> > 						"pt-region": "PT",
> > 						"pt-saft-tax-rate": "NOR"
> > 					}
> > 				}
> > 			],
> > 			"total": "15.00"
> > 		}
> > 	],
> > 	"totals": {
> > 		"sum": "15.00",
> > 		"total": "15.00",
> > 		"taxes": {
> > 			"categories": [
> > 				{
> > 					"code": "VAT",
> > 					"rates": [
> > 						{
> > 							"key": "standard",
> > 							"ext": {
> > 								"pt-region": "PT",
> > 								"pt-saft-tax-rate": "NOR"
> > 							},
> > 							"base": "15.00",
> > 							"percent": "23.0%",
> > 							"amount": "3.45"
> > 						}
> > 					],
> > 					"amount": "3.45"
> > 				}
> > 			],
> > 			"sum": "3.45"
> > 		},
> > 		"tax": "3.45",
> > 		"total_with_tax": "18.45",
> > 		"payable": "18.45"
> > 	},
> > 	"notes": [
> > 		{
> > 			"text": "Goods returned by the customer."
> > 		}
> > 	]
> > }
> > ```
>
> > [accordion] AT global waybill
> >
> > For shipments where the specific recipient is not known upfront — for example, multi-stop delivery runs — issuers can emit a global waybill (*Guia de Transporte Global*) to cover the goods in transport.
> >
> > Notice:
> >
> > * the document `type` is set to `waybill`, which the [`pt-saft-v1`](https://docs.gobl.org/addons/pt-saft-v1) addon normalizes to the [`pt-saft-movement-type`](https://docs.gobl.org/addons/pt-saft-v1#movement-type) extension `GT` (Guia de Transporte),
> > * the `series` follows the `GT ` prefix convention required by the AT and must be registered through the Supplier Portal, and,
> > * the `customer` field is omitted: when no customer is provided on a `GT`, the SAF-T submission automatically uses the AT-prescribed generic final consumer entry.
> >
> > ```json AT Global waybill (minimal) theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/delivery",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 			"pt-saft-v1"
> > 	],
> > 	"type": "waybill",
> > 	"series": "GT SERIES-A",
> > 	"issue_date": "2026-04-01",
> > 	"currency": "EUR",
> > 	"despatch_date": "2026-04-02",
> > 	"supplier": {
> > 			"name": "Innovatech Lda",
> > 			"tax_id": {
> > 					"country": "PT",
> > 					"code": "770013813"
> > 			},
> > 			"addresses": [
> > 					{
> > 							"street": "Rua das Flores 200 3º Esquerdo",
> > 							"locality": "Porto",
> > 							"code": "4050-265",
> > 							"country": "PT"
> > 					}
> > 			],
> > 			"registration": {
> > 					"capital": "100000.00",
> > 					"office": "Porto"
> > 			}
> > 	},
> > 	"despatcher": {
> > 			"name": "Innovatech Logistics",
> > 			"addresses": [
> > 					{
> > 							"street": "Rua da Indústria 45",
> > 							"locality": "Porto",
> > 							"code": "4050-300",
> > 							"country": "PT"
> > 					}
> > 			]
> > 	},
> > 	"lines": [
> > 			{
> > 					"quantity": "100",
> > 					"item": {
> > 							"name": "Product A",
> > 							"price": "5.00",
> > 							"unit": "unit",
> > 							"ext": {
> > 									"pt-saft-product-type": "P"
> > 							}
> > 					},
> > 					"taxes": [
> > 							{
> > 									"cat": "VAT",
> > 									"rate": "standard"
> > 							}
> > 					]
> > 			}
> > 	],
> > 	"notes": [
> > 			{
> > 					"text": "Global waybill for multi-stop delivery"
> > 			}
> > 	]
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/delivery",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"type": "waybill",
> > 	"series": "GT SERIES-A",
> > 	"issue_date": "2026-04-01",
> > 	"currency": "EUR",
> > 	"despatch_date": "2026-04-02",
> > 	"tax": {
> > 		"ext": {
> > 			"pt-saft-movement-type": "GT"
> > 		}
> > 	},
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "770013813"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Rua das Flores 200 3º Esquerdo",
> > 				"locality": "Porto",
> > 				"code": "4050-265",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "100000.00",
> > 			"office": "Porto"
> > 		}
> > 	},
> > 	"despatcher": {
> > 		"name": "Innovatech Logistics",
> > 		"addresses": [
> > 			{
> > 				"street": "Rua da Indústria 45",
> > 				"locality": "Porto",
> > 				"code": "4050-300",
> > 				"country": "PT"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"i": 1,
> > 			"quantity": "100",
> > 			"item": {
> > 				"name": "Product A",
> > 				"price": "5.00",
> > 				"unit": "unit",
> > 				"ext": {
> > 					"pt-saft-product-type": "P"
> > 				}
> > 			},
> > 			"sum": "500.00",
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"key": "standard",
> > 					"rate": "general",
> > 					"percent": "23.0%",
> > 					"ext": {
> > 						"pt-region": "PT",
> > 						"pt-saft-tax-rate": "NOR"
> > 					}
> > 				}
> > 			],
> > 			"total": "500.00"
> > 		}
> > 	],
> > 	"totals": {
> > 		"sum": "500.00",
> > 		"total": "500.00",
> > 		"taxes": {
> > 			"categories": [
> > 				{
> > 					"code": "VAT",
> > 					"rates": [
> > 						{
> > 							"key": "standard",
> > 							"ext": {
> > 								"pt-region": "PT",
> > 								"pt-saft-tax-rate": "NOR"
> > 							},
> > 							"base": "500.00",
> > 							"percent": "23.0%",
> > 							"amount": "115.00"
> > 						}
> > 					],
> > 					"amount": "115.00"
> > 				}
> > 			],
> > 			"sum": "115.00"
> > 		},
> > 		"tax": "115.00",
> > 		"total_with_tax": "615.00",
> > 		"payable": "615.00"
> > 	},
> > 	"notes": [
> > 		{
> > 			"text": "Global waybill for multi-stop delivery"
> > 		}
> > 	]
> > }
> > ```
>
> > [accordion] AT delivery from global waybill
> >
> > Once the recipient of part of the goods covered by a global waybill is known, a concrete document — typically a `GR` (Guia de Remessa) — must be issued with the full transaction details, including the `customer` and a cross-reference back to the originating `GT` so the AT can correlate both records.
> >
> > Notice:
> >
> > * the `customer` is now populated with the actual recipient of the goods, and,
> > * the `preceding` array carries one entry with the `series`, `code`, and `issue_date` of the originating `GT`.
> >
> > ```json AT Delivery note from global waybill (minimal) theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/delivery",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 			"pt-saft-v1"
> > 	],
> > 	"type": "note",
> > 	"series": "GR SERIES-A",
> > 	"issue_date": "2026-04-02",
> > 	"currency": "EUR",
> > 	"despatch_date": "2026-04-02",
> > 	"receive_date": "2026-04-02",
> > 	"preceding": [
> > 			{
> > 					"series": "GT SERIES-A",
> > 					"code": "1",
> > 					"issue_date": "2026-04-01"
> > 			}
> > 	],
> > 	"supplier": {
> > 			"name": "Innovatech Lda",
> > 			"tax_id": {
> > 					"country": "PT",
> > 					"code": "770013813"
> > 			},
> > 			"addresses": [
> > 					{
> > 							"street": "Rua das Flores 200 3º Esquerdo",
> > 							"locality": "Porto",
> > 							"code": "4050-265",
> > 							"country": "PT"
> > 					}
> > 			],
> > 			"registration": {
> > 					"capital": "100000.00",
> > 					"office": "Porto"
> > 			}
> > 	},
> > 	"customer": {
> > 			"name": "Gusto Unipessoal Lda",
> > 			"tax_id": {
> > 					"country": "PT",
> > 					"code": "514329874"
> > 			},
> > 			"addresses": [
> > 					{
> > 							"street": "Avenida da Liberdade 152 2º Direito",
> > 							"locality": "Lisboa",
> > 							"code": "1250-146",
> > 							"country": "PT"
> > 					}
> > 			]
> > 	},
> > 	"despatcher": {
> > 			"name": "Innovatech Logistics",
> > 			"addresses": [
> > 					{
> > 							"street": "Rua da Indústria 45",
> > 							"locality": "Porto",
> > 							"code": "4050-300",
> > 							"country": "PT"
> > 					}
> > 			]
> > 	},
> > 	"receiver": {
> > 			"name": "Gusto Armazém",
> > 			"addresses": [
> > 					{
> > 							"street": "Zona Industrial, Lote 23",
> > 							"locality": "Lisboa",
> > 							"code": "1300-300",
> > 							"country": "PT"
> > 					}
> > 			]
> > 	},
> > 	"lines": [
> > 			{
> > 					"quantity": "10",
> > 					"item": {
> > 							"name": "Product A",
> > 							"price": "5.00",
> > 							"unit": "unit",
> > 							"ext": {
> > 									"pt-saft-product-type": "P"
> > 							}
> > 					},
> > 					"taxes": [
> > 							{
> > 									"cat": "VAT",
> > 									"rate": "standard"
> > 							}
> > 					]
> > 			}
> > 	],
> > 	"notes": [
> > 			{
> > 					"text": "Stop delivery from global waybill GT SERIES-A/1"
> > 			}
> > 	]
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/delivery",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"type": "note",
> > 	"series": "GR SERIES-A",
> > 	"issue_date": "2026-04-02",
> > 	"currency": "EUR",
> > 	"preceding": [
> > 		{
> > 			"issue_date": "2026-04-01",
> > 			"series": "GT SERIES-A",
> > 			"code": "1"
> > 		}
> > 	],
> > 	"despatch_date": "2026-04-02",
> > 	"receive_date": "2026-04-02",
> > 	"tax": {
> > 		"ext": {
> > 			"pt-saft-movement-type": "GR"
> > 		}
> > 	},
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "770013813"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Rua das Flores 200 3º Esquerdo",
> > 				"locality": "Porto",
> > 				"code": "4050-265",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "100000.00",
> > 			"office": "Porto"
> > 		}
> > 	},
> > 	"customer": {
> > 		"name": "Gusto Unipessoal Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Avenida da Liberdade 152 2º Direito",
> > 				"locality": "Lisboa",
> > 				"code": "1250-146",
> > 				"country": "PT"
> > 			}
> > 		]
> > 	},
> > 	"despatcher": {
> > 		"name": "Innovatech Logistics",
> > 		"addresses": [
> > 			{
> > 				"street": "Rua da Indústria 45",
> > 				"locality": "Porto",
> > 				"code": "4050-300",
> > 				"country": "PT"
> > 			}
> > 		]
> > 	},
> > 	"receiver": {
> > 		"name": "Gusto Armazém",
> > 		"addresses": [
> > 			{
> > 				"street": "Zona Industrial, Lote 23",
> > 				"locality": "Lisboa",
> > 				"code": "1300-300",
> > 				"country": "PT"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"i": 1,
> > 			"quantity": "10",
> > 			"item": {
> > 				"name": "Product A",
> > 				"price": "5.00",
> > 				"unit": "unit",
> > 				"ext": {
> > 					"pt-saft-product-type": "P"
> > 				}
> > 			},
> > 			"sum": "50.00",
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"key": "standard",
> > 					"rate": "general",
> > 					"percent": "23.0%",
> > 					"ext": {
> > 						"pt-region": "PT",
> > 						"pt-saft-tax-rate": "NOR"
> > 					}
> > 				}
> > 			],
> > 			"total": "50.00"
> > 		}
> > 	],
> > 	"totals": {
> > 		"sum": "50.00",
> > 		"total": "50.00",
> > 		"taxes": {
> > 			"categories": [
> > 				{
> > 					"code": "VAT",
> > 					"rates": [
> > 						{
> > 							"key": "standard",
> > 							"ext": {
> > 								"pt-region": "PT",
> > 								"pt-saft-tax-rate": "NOR"
> > 							},
> > 							"base": "50.00",
> > 							"percent": "23.0%",
> > 							"amount": "11.50"
> > 						}
> > 					],
> > 					"amount": "11.50"
> > 				}
> > 			],
> > 			"sum": "11.50"
> > 		},
> > 		"tax": "11.50",
> > 		"total_with_tax": "61.50",
> > 		"payable": "61.50"
> > 	},
> > 	"notes": [
> > 		{
> > 			"text": "Stop delivery from global waybill GT SERIES-A/1"
> > 		}
> > 	]
> > }
> > ```
>
> > [accordion] AT return from global waybill
> >
> > A return can also be linked back to a global waybill — for example, when surplus goods that were not delivered to any customer come back to the depot at the end of a delivery run.
> >
> > Notice:
> >
> > * as in the standalone return guide, the `return` tag drives the [`pt-saft-movement-type`](https://docs.gobl.org/addons/pt-saft-v1#movement-type) extension to `GD`,
> > * the `preceding` array references the originating `GT`, and,
> > * the `customer` is omitted, since the goods are returning to the issuer's own depot rather than to a specific party.
> >
> > ```json AT Return from global waybill (minimal) theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/delivery",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 			"pt-saft-v1"
> > 	],
> > 	"$tags": ["return"],
> > 	"type": "note",
> > 	"series": "GD SERIES-A",
> > 	"issue_date": "2026-04-03",
> > 	"currency": "EUR",
> > 	"preceding": [
> > 			{
> > 					"issue_date": "2026-04-01",
> > 					"series": "GT SERIES-A",
> > 					"code": "1"
> > 			}
> > 	],
> > 	"despatch_date": "2026-04-03",
> > 	"supplier": {
> > 			"name": "Innovatech Lda",
> > 			"tax_id": {
> > 					"country": "PT",
> > 					"code": "770013813"
> > 			},
> > 			"addresses": [
> > 					{
> > 							"street": "Rua das Flores 200 3º Esquerdo",
> > 							"locality": "Porto",
> > 							"code": "4050-265",
> > 							"country": "PT"
> > 					}
> > 			],
> > 			"registration": {
> > 					"capital": "100000.00",
> > 					"office": "Porto"
> > 			}
> > 	},
> > 	"despatcher": {
> > 			"name": "Innovatech Logistics",
> > 			"addresses": [
> > 					{
> > 							"street": "Rua da Indústria 45",
> > 							"locality": "Porto",
> > 							"code": "4050-300",
> > 							"country": "PT"
> > 					}
> > 			]
> > 	},
> > 	"receiver": {
> > 			"name": "Innovatech Depot",
> > 			"addresses": [
> > 					{
> > 							"street": "Rua da Indústria 45",
> > 							"locality": "Porto",
> > 							"code": "4050-300",
> > 							"country": "PT"
> > 					}
> > 			]
> > 	},
> > 	"lines": [
> > 			{
> > 					"quantity": "2",
> > 					"item": {
> > 							"name": "Product A",
> > 							"price": "5.00",
> > 							"unit": "unit",
> > 							"ext": {
> > 									"pt-saft-product-type": "P"
> > 							}
> > 					},
> > 					"taxes": [
> > 							{
> > 									"cat": "VAT",
> > 									"rate": "standard"
> > 							}
> > 					]
> > 			}
> > 	],
> > 	"notes": [
> > 			{
> > 					"text": "Surplus from global waybill GT SERIES-A/1 returned to depot."
> > 			}
> > 	]
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/delivery",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"$tags": [
> > 		"return"
> > 	],
> > 	"type": "note",
> > 	"series": "GD SERIES-A",
> > 	"issue_date": "2026-04-03",
> > 	"currency": "EUR",
> > 	"preceding": [
> > 		{
> > 			"issue_date": "2026-04-01",
> > 			"series": "GT SERIES-A",
> > 			"code": "1"
> > 		}
> > 	],
> > 	"despatch_date": "2026-04-03",
> > 	"tax": {
> > 		"ext": {
> > 			"pt-saft-movement-type": "GD"
> > 		}
> > 	},
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "770013813"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Rua das Flores 200 3º Esquerdo",
> > 				"locality": "Porto",
> > 				"code": "4050-265",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "100000.00",
> > 			"office": "Porto"
> > 		}
> > 	},
> > 	"despatcher": {
> > 		"name": "Innovatech Logistics",
> > 		"addresses": [
> > 			{
> > 				"street": "Rua da Indústria 45",
> > 				"locality": "Porto",
> > 				"code": "4050-300",
> > 				"country": "PT"
> > 			}
> > 		]
> > 	},
> > 	"receiver": {
> > 		"name": "Innovatech Depot",
> > 		"addresses": [
> > 			{
> > 				"street": "Rua da Indústria 45",
> > 				"locality": "Porto",
> > 				"code": "4050-300",
> > 				"country": "PT"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"i": 1,
> > 			"quantity": "2",
> > 			"item": {
> > 				"name": "Product A",
> > 				"price": "5.00",
> > 				"unit": "unit",
> > 				"ext": {
> > 					"pt-saft-product-type": "P"
> > 				}
> > 			},
> > 			"sum": "10.00",
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"key": "standard",
> > 					"rate": "general",
> > 					"percent": "23.0%",
> > 					"ext": {
> > 						"pt-region": "PT",
> > 						"pt-saft-tax-rate": "NOR"
> > 					}
> > 				}
> > 			],
> > 			"total": "10.00"
> > 		}
> > 	],
> > 	"totals": {
> > 		"sum": "10.00",
> > 		"total": "10.00",
> > 		"taxes": {
> > 			"categories": [
> > 				{
> > 					"code": "VAT",
> > 					"rates": [
> > 						{
> > 							"key": "standard",
> > 							"ext": {
> > 								"pt-region": "PT",
> > 								"pt-saft-tax-rate": "NOR"
> > 							},
> > 							"base": "10.00",
> > 							"percent": "23.0%",
> > 							"amount": "2.30"
> > 						}
> > 					],
> > 					"amount": "2.30"
> > 				}
> > 			],
> > 			"sum": "2.30"
> > 		},
> > 		"tax": "2.30",
> > 		"total_with_tax": "12.30",
> > 		"payable": "12.30"
> > 	},
> > 	"notes": [
> > 		{
> > 			"text": "Surplus from global waybill GT SERIES-A/1 returned to depot."
> > 		}
> > 	]
> > }
> > ```
>
> > [accordion] AT payment receipt
> >
> > In this example, we're issuing a payment receipt from a Portuguese supplier to another Portuguese business.
> >
> > Notice:
> >
> > * the minimal version in the first tab contains only the essential fields required to create the payment document,
> > * the [`pt-saft-v1`](https://docs.gobl.org/addons/pt-saft-v1) addon ensures the document will be validated and normalized using the SAF-T PT v1 rules built into the [GOBL](https://docs.gobl.org) library,
> > * the `supplier` and `series` fields are set to example values; you'll need to replace them with the details of supplier and series registered as per the previous sections. The series must be registered in the Supplier Portal and follow Portuguese naming conventions (see [Series management](https://docs.invopop.com/guides/pt-at-supplier.md#series-management) for details),
> > * this is a single `receipt` payment that bundles **multiple payment methods**: 30,00 EUR in cash plus 31,50 EUR by card, summing to the document total of 61,50 EUR. Each method gets its own [`pt-saft-payment-means`](https://docs.gobl.org/addons/pt-saft-v1#payment-means) extension auto-assigned (`NU` for cash, `CC` for card),
> > * when running `gobl build`, the system automatically assigns the [`pt-saft-payment-type`](https://docs.gobl.org/addons/pt-saft-v1#payment-type) extension to `RG` and the [`pt-saft-source`](https://docs.gobl.org/addons/pt-saft-v1#document-source) extension to `P`,
> > * the built version in the second tab shows the normalized document with all automatically generated fields and extensions properly set,
> > * the payment lines reference the original invoice being paid, though a single receipt can reference multiple invoices if needed,
> > * this receipt could represent either a full or partial payment of the referenced invoice; it simply records the amounts and taxes being paid, so the total may or may not cover the full invoice amount, and,
> > * there are no calculations in the minimal version; all normalizations will be made automatically when uploading.
> >
> > ```json AT Payment (minimal) theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/payment",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"type": "receipt",
> > 	"series": "RG SERIES-A",
> > 	"issue_date": "2024-12-23",
> > 	"currency": "EUR",
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "770013813"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Rua das Flores 200 3º Esquerdo",
> > 				"locality": "Porto",
> > 				"code": "4050-265",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "100000.00",
> > 			"office": "Porto"
> > 		}
> > 	},
> > 	"customer": {
> > 		"name": "Gusto Unipessoal Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Avenida da Liberdade 152 2º Direito",
> > 				"locality": "Lisboa",
> > 				"code": "1250-146",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "gusto@example.com"
> > 			}
> > 		],
> > 		"websites": [
> > 			{
> > 				"url": "https://gusto.example.com"
> > 			}
> > 		],
> > 		"telephones": [
> > 			{
> > 				"num": "+351912345678"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"document": {
> > 				"issue_date": "2024-12-23",
> > 				"series": "FT SERIES-A",
> > 				"code": "1",
> > 				"description": "Invoice 1"
> > 			},
> > 			"amount": "61.50",
> > 			"tax": {
> > 				"categories": [
> > 					{
> > 						"code": "VAT",
> > 						"rates": [
> > 							{
> > 								"key": "standard",
> > 								"ext": {
> > 									"pt-region": "PT",
> > 									"pt-saft-tax-rate": "NOR"
> > 								},
> > 								"base": "50.00",
> > 								"percent": "23.0%",
> > 								"amount": "11.50"
> > 							}
> > 						],
> > 						"amount": "11.50"
> > 					}
> > 				],
> > 				"sum": "11.50"
> > 			}
> > 		}
> > 	],
> > 	"methods": [
> > 		{
> > 			"key": "cash",
> > 			"description": "Cash portion",
> > 			"amount": "30.00"
> > 		},
> > 		{
> > 			"key": "card",
> > 			"description": "Card portion",
> > 			"amount": "31.50"
> > 		}
> > 	]
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/payment",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"type": "receipt",
> > 	"series": "RG SERIES-A",
> > 	"issue_date": "2024-12-23",
> > 	"currency": "EUR",
> > 	"ext": {
> > 		"pt-saft-payment-type": "RG",
> > 		"pt-saft-source": "P"
> > 	},
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "770013813"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Rua das Flores 200 3º Esquerdo",
> > 				"locality": "Porto",
> > 				"code": "4050-265",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "100000.00",
> > 			"office": "Porto"
> > 		}
> > 	},
> > 	"customer": {
> > 		"name": "Gusto Unipessoal Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Avenida da Liberdade 152 2º Direito",
> > 				"locality": "Lisboa",
> > 				"code": "1250-146",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "gusto@example.com"
> > 			}
> > 		],
> > 		"websites": [
> > 			{
> > 				"url": "https://gusto.example.com"
> > 			}
> > 		],
> > 		"telephones": [
> > 			{
> > 				"num": "+351912345678"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"i": 1,
> > 			"document": {
> > 				"issue_date": "2024-12-23",
> > 				"series": "FT SERIES-A",
> > 				"code": "1",
> > 				"description": "Invoice 1"
> > 			},
> > 			"amount": "61.50",
> > 			"tax": {
> > 				"categories": [
> > 					{
> > 						"code": "VAT",
> > 						"rates": [
> > 							{
> > 								"key": "standard",
> > 								"ext": {
> > 									"pt-region": "PT",
> > 									"pt-saft-tax-rate": "NOR"
> > 								},
> > 								"base": "50.00",
> > 								"percent": "23.0%",
> > 								"amount": "11.50"
> > 							}
> > 						],
> > 						"amount": "11.50"
> > 					}
> > 				],
> > 				"sum": "11.50"
> > 			}
> > 		}
> > 	],
> > 	"methods": [
> > 		{
> > 			"key": "cash",
> > 			"description": "Cash portion",
> > 			"amount": "30.00",
> > 			"ext": {
> > 				"pt-saft-payment-means": "NU"
> > 			}
> > 		},
> > 		{
> > 			"key": "card",
> > 			"description": "Card portion",
> > 			"amount": "31.50",
> > 			"ext": {
> > 				"pt-saft-payment-means": "CC"
> > 			}
> > 		}
> > 	],
> > 	"total": "61.50"
> > }
> > ```
>
> > [accordion] AT Cash VAT receipt
> >
> > In this example, we're issuing a payment receipt for a supplier under the **Cash VAT scheme** (*regime de IVA de Caixa*). For these suppliers, the receipt is the document that actually triggers the VAT becoming due, so the AT distinguishes it from an ordinary receipt.
> >
> > Notice:
> >
> > * the document carries the `cash-vat` tag (`$tags: ["cash-vat"]`), exactly as the Cash VAT invoice does,
> > * on a `receipt`, that tag drives the [`pt-saft-payment-type`](https://docs.gobl.org/addons/pt-saft-v1#payment-type) extension to `RC` (*Recibo no âmbito do regime de IVA de Caixa*) instead of the default `RG` (*Outro Recibo*) you'd get on the ordinary AT payment receipt above,
> > * the `series` follows the `RC ` prefix convention and must be registered through the Supplier Portal,
> > * the payment line references the original invoice being settled, carrying its VAT breakdown so the AT can match the now-due tax to the issued invoice, and,
> > * as with any receipt, the [`pt-saft-payment-means`](https://docs.gobl.org/addons/pt-saft-v1#payment-means) extension is auto-assigned per method (`TB` for the bank transfer) and the [`pt-saft-source`](https://docs.gobl.org/addons/pt-saft-v1#document-source) extension is set to `P`.
> >
> > ```json AT Cash VAT receipt (minimal) theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/payment",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"$tags": [
> > 		"cash-vat"
> > 	],
> > 	"type": "receipt",
> > 	"series": "RC SERIES-A",
> > 	"issue_date": "2024-12-23",
> > 	"currency": "EUR",
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "770013813"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Rua das Flores 200 3º Esquerdo",
> > 				"locality": "Porto",
> > 				"code": "4050-265",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "100000.00",
> > 			"office": "Porto"
> > 		}
> > 	},
> > 	"customer": {
> > 		"name": "Gusto Unipessoal Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Avenida da Liberdade 152 2º Direito",
> > 				"locality": "Lisboa",
> > 				"code": "1250-146",
> > 				"country": "PT"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"document": {
> > 				"issue_date": "2024-12-23",
> > 				"series": "FT SERIES-A",
> > 				"code": "1",
> > 				"description": "Invoice 1"
> > 			},
> > 			"amount": "61.50",
> > 			"tax": {
> > 				"categories": [
> > 					{
> > 						"code": "VAT",
> > 						"rates": [
> > 							{
> > 								"key": "standard",
> > 								"ext": {
> > 									"pt-region": "PT",
> > 									"pt-saft-tax-rate": "NOR"
> > 								},
> > 								"base": "50.00",
> > 								"percent": "23.0%",
> > 								"amount": "11.50"
> > 							}
> > 						],
> > 						"amount": "11.50"
> > 					}
> > 				],
> > 				"sum": "11.50"
> > 			}
> > 		}
> > 	],
> > 	"methods": [
> > 		{
> > 			"key": "credit-transfer",
> > 			"description": "Bank transfer",
> > 			"amount": "61.50"
> > 		}
> > 	]
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/payment",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"$tags": [
> > 		"cash-vat"
> > 	],
> > 	"type": "receipt",
> > 	"series": "RC SERIES-A",
> > 	"issue_date": "2024-12-23",
> > 	"currency": "EUR",
> > 	"ext": {
> > 		"pt-saft-payment-type": "RC",
> > 		"pt-saft-source": "P"
> > 	},
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "770013813"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Rua das Flores 200 3º Esquerdo",
> > 				"locality": "Porto",
> > 				"code": "4050-265",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "100000.00",
> > 			"office": "Porto"
> > 		}
> > 	},
> > 	"customer": {
> > 		"name": "Gusto Unipessoal Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Avenida da Liberdade 152 2º Direito",
> > 				"locality": "Lisboa",
> > 				"code": "1250-146",
> > 				"country": "PT"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"i": 1,
> > 			"document": {
> > 				"issue_date": "2024-12-23",
> > 				"series": "FT SERIES-A",
> > 				"code": "1",
> > 				"description": "Invoice 1"
> > 			},
> > 			"amount": "61.50",
> > 			"tax": {
> > 				"categories": [
> > 					{
> > 						"code": "VAT",
> > 						"rates": [
> > 							{
> > 								"key": "standard",
> > 								"ext": {
> > 									"pt-region": "PT",
> > 									"pt-saft-tax-rate": "NOR"
> > 								},
> > 								"base": "50.00",
> > 								"percent": "23.0%",
> > 								"amount": "11.50"
> > 							}
> > 						],
> > 						"amount": "11.50"
> > 					}
> > 				],
> > 				"sum": "11.50"
> > 			}
> > 		}
> > 	],
> > 	"methods": [
> > 		{
> > 			"key": "credit-transfer",
> > 			"description": "Bank transfer",
> > 			"amount": "61.50",
> > 			"ext": {
> > 				"pt-saft-payment-means": "TB"
> > 			}
> > 		}
> > 	],
> > 	"total": "61.50"
> > }
> > ```
>
> > [accordion] AT Portugal invoice
> >
> > ```json AT Invoice theme={"system"}
> > {
> >   "$schema": "https://gobl.org/draft-0/bill/invoice",
> >   "$regime": "PT",
> >   "$addons": [
> >     "pt-saft-v1"
> >   ],
> >   "series": "FT SERIES-A",
> >   "issue_date": "2024-12-23",
> >   "supplier": {
> >     "name": "Innovatech Lda",
> >     "tax_id": {
> >       "country": "PT",
> >       "code": "770013813"
> >     },
> >     "registration": {
> >       "capital": "100000.00",
> >       "office": "Porto"
> >     }
> >   },
> >   "customer": {
> >     "name": "Gusto Unipessoal Lda",
> >     "tax_id": {
> >       "country": "PT",
> >       "code": "514329874"
> >     },
> >     "addresses": [
> >       {
> >         "street": "Avenida da Liberdade 152 2º Direito",
> >         "locality": "Lisboa",
> >         "code": "1250-146",
> >         "country": "PT"
> >       }
> >     ],
> >     "telephones": [
> >       {
> >         "num": "+351912345678"
> >       }
> >     ]
> >   },
> >   "lines": [
> >     {
> >       "quantity": "1",
> >       "item": {
> >         "name": "Development services",
> >         "price": "50.00",
> >         "unit": "item"
> >       },
> >       "taxes": [
> >         {
> >           "cat": "VAT",
> >           "rate": "general"
> >         }
> >       ]
> >     }
> >   ],
> >   "payment": {
> >     "terms": {
> >       "key": "advanced"
> >     },
> >     "advances": [
> >       {
> >         "date": "2024-12-18",
> >         "description": "Transferência bancária",
> >         "amount": "50.00"
> >       }
> >     ]
> >   }
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"type": "standard",
> > 	"series": "FT SERIES-A",
> > 	"issue_date": "2024-12-23",
> > 	"value_date": "2024-12-23",
> > 	"currency": "EUR",
> > 	"tax": {
> > 		"ext": {
> > 			"pt-saft-invoice-type": "FT",
> > 			"pt-saft-source": "P"
> > 		}
> > 	},
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "770013813"
> > 		},
> > 		"registration": {
> > 			"capital": "100000.00",
> > 			"office": "Porto"
> > 		}
> > 	},
> > 	"customer": {
> > 		"name": "Gusto Unipessoal Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Avenida da Liberdade 152 2º Direito",
> > 				"locality": "Lisboa",
> > 				"code": "1250-146",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"telephones": [
> > 			{
> > 				"num": "+351912345678"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"i": 1,
> > 			"quantity": "1",
> > 			"item": {
> > 				"name": "Development services",
> > 				"price": "50.00",
> > 				"unit": "item",
> > 				"ext": {
> > 					"pt-saft-product-type": "S"
> > 				}
> > 			},
> > 			"sum": "50.00",
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"key": "standard",
> > 					"rate": "general",
> > 					"percent": "23.0%",
> > 					"ext": {
> > 						"pt-region": "PT",
> > 						"pt-saft-tax-rate": "NOR"
> > 					}
> > 				}
> > 			],
> > 			"total": "50.00"
> > 		}
> > 	],
> > 	"payment": {
> > 		"terms": {
> > 			"key": "advanced"
> > 		},
> > 		"advances": [
> > 			{
> > 				"date": "2024-12-18",
> > 				"description": "Transferência bancária",
> > 				"amount": "50.00"
> > 			}
> > 		]
> > 	},
> > 	"totals": {
> > 		"sum": "50.00",
> > 		"total": "50.00",
> > 		"taxes": {
> > 			"categories": [
> > 				{
> > 					"code": "VAT",
> > 					"rates": [
> > 						{
> > 							"key": "standard",
> > 							"ext": {
> > 								"pt-region": "PT",
> > 								"pt-saft-tax-rate": "NOR"
> > 							},
> > 							"base": "50.00",
> > 							"percent": "23.0%",
> > 							"amount": "11.50"
> > 						}
> > 					],
> > 					"amount": "11.50"
> > 				}
> > 			],
> > 			"sum": "11.50"
> > 		},
> > 		"tax": "11.50",
> > 		"total_with_tax": "61.50",
> > 		"payable": "61.50",
> > 		"advance": "50.00",
> > 		"due": "11.50"
> > 	}
> > }
> > ```
>
> > [accordion] AT Portugal credit note
> >
> > ```json AT Credit Note theme={"system"}
> > {
> >   "$schema": "https://gobl.org/draft-0/bill/invoice",
> >   "$regime": "PT",
> >   "$addons": [
> >     "pt-saft-v1"
> >   ],
> >   "type": "credit-note",
> >   "series": "NC SERIES-A",
> >   "issue_date": "2024-12-23",
> >   "preceding": [
> >     {
> >       "type": "standard",
> >       "issue_date": "2024-08-03",
> >       "series": "FT SERIES-A",
> >       "code": "1",
> >       "reason": "Reimbursement"
> >     }
> >   ],
> >   "supplier": {
> >     "name": "Innovatech Lda",
> >     "tax_id": {
> >       "country": "PT",
> >       "code": "770013813"
> >     },
> >     "addresses": [
> >       {
> >         "street": "Rua das Flores 200 3º Esquerdo",
> >         "locality": "Porto",
> >         "code": "4050-265",
> >         "country": "PT"
> >       }
> >     ],
> >     "registration": {
> >       "capital": "100000.00",
> >       "office": "Porto"
> >     }
> >   },
> >   "customer": {
> >     "name": "Gusto Unipessoal Lda",
> >     "tax_id": {
> >       "country": "PT",
> >       "code": "514329874"
> >     },
> >     "addresses": [
> >       {
> >         "street": "Avenida da Liberdade 152 2º Direito",
> >         "locality": "Lisboa",
> >         "code": "1250-146",
> >         "country": "PT"
> >       }
> >     ],
> >     "emails": [
> >       {
> >         "addr": "gusto@example.com"
> >       }
> >     ],
> >     "websites": [
> >       {
> >         "url": "https://gusto.example.com"
> >       }
> >     ],
> >     "telephones": [
> >       {
> >         "num": "+351912345678"
> >       }
> >     ]
> >   },
> >   "lines": [
> >     {
> >       "quantity": "1",
> >       "item": {
> >         "name": "Development services",
> >         "price": "50.00",
> >         "unit": "item"
> >       },
> >       "taxes": [
> >         {
> >           "cat": "VAT",
> >           "rate": "general"
> >         }
> >       ]
> >     }
> >   ]
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"type": "credit-note",
> > 	"series": "NC SERIES-A",
> > 	"issue_date": "2024-12-23",
> > 	"value_date": "2024-12-23",
> > 	"currency": "EUR",
> > 	"preceding": [
> > 		{
> > 			"type": "standard",
> > 			"issue_date": "2024-08-03",
> > 			"series": "FT SERIES-A",
> > 			"code": "1",
> > 			"reason": "Reimbursement"
> > 		}
> > 	],
> > 	"tax": {
> > 		"ext": {
> > 			"pt-saft-invoice-type": "NC",
> > 			"pt-saft-source": "P"
> > 		}
> > 	},
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "770013813"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Rua das Flores 200 3º Esquerdo",
> > 				"locality": "Porto",
> > 				"code": "4050-265",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "100000.00",
> > 			"office": "Porto"
> > 		}
> > 	},
> > 	"customer": {
> > 		"name": "Gusto Unipessoal Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Avenida da Liberdade 152 2º Direito",
> > 				"locality": "Lisboa",
> > 				"code": "1250-146",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "gusto@example.com"
> > 			}
> > 		],
> > 		"websites": [
> > 			{
> > 				"url": "https://gusto.example.com"
> > 			}
> > 		],
> > 		"telephones": [
> > 			{
> > 				"num": "+351912345678"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"i": 1,
> > 			"quantity": "1",
> > 			"item": {
> > 				"name": "Development services",
> > 				"price": "50.00",
> > 				"unit": "item",
> > 				"ext": {
> > 					"pt-saft-product-type": "S"
> > 				}
> > 			},
> > 			"sum": "50.00",
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"key": "standard",
> > 					"rate": "general",
> > 					"percent": "23.0%",
> > 					"ext": {
> > 						"pt-region": "PT",
> > 						"pt-saft-tax-rate": "NOR"
> > 					}
> > 				}
> > 			],
> > 			"total": "50.00"
> > 		}
> > 	],
> > 	"totals": {
> > 		"sum": "50.00",
> > 		"total": "50.00",
> > 		"taxes": {
> > 			"categories": [
> > 				{
> > 					"code": "VAT",
> > 					"rates": [
> > 						{
> > 							"key": "standard",
> > 							"ext": {
> > 								"pt-region": "PT",
> > 								"pt-saft-tax-rate": "NOR"
> > 							},
> > 							"base": "50.00",
> > 							"percent": "23.0%",
> > 							"amount": "11.50"
> > 						}
> > 					],
> > 					"amount": "11.50"
> > 				}
> > 			],
> > 			"sum": "11.50"
> > 		},
> > 		"tax": "11.50",
> > 		"total_with_tax": "61.50",
> > 		"payable": "61.50"
> > 	}
> > }
> > ```
>
> > [accordion] AT Portugal order
> >
> > ```json AT Order theme={"system"}
> > {
> >   "$schema": "https://gobl.org/draft-0/bill/order",
> >   "$regime": "PT",
> >   "$addons": [
> >     "pt-saft-v1"
> >   ],
> >   "series": "NE SERIES-A",
> >   "issue_date": "2024-12-23",
> >   "supplier": {
> >     "name": "Innovatech Lda",
> >     "tax_id": {
> >       "country": "PT",
> >       "code": "770013813"
> >     },
> >     "addresses": [
> >       {
> >         "street": "Rua das Flores 200 3º Esquerdo",
> >         "locality": "Porto",
> >         "code": "4050-265",
> >         "country": "PT"
> >       }
> >     ],
> >     "registration": {
> >       "capital": "100000.00",
> >       "office": "Porto"
> >     }
> >   },
> >   "customer": {
> >     "name": "Gusto Unipessoal Lda",
> >     "tax_id": {
> >       "country": "PT",
> >       "code": "514329874"
> >     },
> >     "addresses": [
> >       {
> >         "street": "Avenida da Liberdade 152 2º Direito",
> >         "locality": "Lisboa",
> >         "code": "1250-146",
> >         "country": "PT"
> >       }
> >     ],
> >     "emails": [
> >       {
> >         "addr": "gusto@example.com"
> >       }
> >     ],
> >     "websites": [
> >       {
> >         "url": "https://gusto.example.com"
> >       }
> >     ],
> >     "telephones": [
> >       {
> >         "num": "+351912345678"
> >       }
> >     ]
> >   },
> >   "lines": [
> >     {
> >       "quantity": "1",
> >       "order": "PO-2024-001",
> >       "item": {
> >         "name": "Development services",
> >         "price": "50.00"
> >       },
> >       "discounts": [
> >         {
> >           "percent": "15.0%"
> >         }
> >       ],
> >       "taxes": [
> >         {
> >           "cat": "VAT",
> >           "rate": "general"
> >         }
> >       ]
> >     }
> >   ]
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/order",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"type": "purchase",
> > 	"series": "NE SERIES-A",
> > 	"issue_date": "2024-12-23",
> > 	"value_date": "2024-12-23",
> > 	"currency": "EUR",
> > 	"tax": {
> > 		"ext": {
> > 			"pt-saft-work-type": "NE"
> > 		}
> > 	},
> > 	"supplier": {
> > 		"name": "Innovatech Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "770013813"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Rua das Flores 200 3º Esquerdo",
> > 				"locality": "Porto",
> > 				"code": "4050-265",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"registration": {
> > 			"capital": "100000.00",
> > 			"office": "Porto"
> > 		}
> > 	},
> > 	"customer": {
> > 		"name": "Gusto Unipessoal Lda",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Avenida da Liberdade 152 2º Direito",
> > 				"locality": "Lisboa",
> > 				"code": "1250-146",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "gusto@example.com"
> > 			}
> > 		],
> > 		"websites": [
> > 			{
> > 				"url": "https://gusto.example.com"
> > 			}
> > 		],
> > 		"telephones": [
> > 			{
> > 				"num": "+351912345678"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"i": 1,
> > 			"quantity": "1",
> > 			"order": "PO-2024-001",
> > 			"item": {
> > 				"name": "Development services",
> > 				"price": "50.00",
> > 				"unit": "one",
> > 				"ext": {
> > 					"pt-saft-product-type": "S"
> > 				}
> > 			},
> > 			"sum": "50.00",
> > 			"discounts": [
> > 				{
> > 					"percent": "15.0%",
> > 					"amount": "7.50"
> > 				}
> > 			],
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"key": "standard",
> > 					"rate": "general",
> > 					"percent": "23.0%",
> > 					"ext": {
> > 						"pt-region": "PT",
> > 						"pt-saft-tax-rate": "NOR"
> > 					}
> > 				}
> > 			],
> > 			"total": "42.50"
> > 		}
> > 	],
> > 	"totals": {
> > 		"sum": "42.50",
> > 		"total": "42.50",
> > 		"taxes": {
> > 			"categories": [
> > 				{
> > 					"code": "VAT",
> > 					"rates": [
> > 						{
> > 							"key": "standard",
> > 							"ext": {
> > 								"pt-region": "PT",
> > 								"pt-saft-tax-rate": "NOR"
> > 							},
> > 							"base": "42.50",
> > 							"percent": "23.0%",
> > 							"amount": "9.78"
> > 						}
> > 					],
> > 					"amount": "9.78"
> > 				}
> > 			],
> > 			"sum": "9.78"
> > 		},
> > 		"tax": "9.78",
> > 		"total_with_tax": "52.28",
> > 		"payable": "52.28"
> > 	}
> > }
> > ```
>
> > [accordion] AT Portugal invoice with IRS withholding
> >
> > ```json AT Withholding Invoice (minimal) theme={"system"}
> > {
> > 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> > 	"$regime": "PT",
> > 	"$addons": [
> > 		"pt-saft-v1"
> > 	],
> > 	"type": "standard",
> > 	"series": "FT SERIES-A",
> > 	"issue_date": "2024-08-03",
> > 	"currency": "EUR",
> > 	"tax": {
> > 		"notes": [
> > 			{
> > 				"cat": "IRS",
> > 				"text": "Art. 101.º CIRS"
> > 			}
> > 		]
> > 	},
> > 	"supplier": {
> > 		"name": "João Silva, Trabalhador Independente",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "545259045"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Rua das Flores",
> > 				"locality": "Lisboa",
> > 				"code": "1000-000",
> > 				"country": "PT"
> > 			}
> > 		],
> > 		"emails": [
> > 			{
> > 				"addr": "joao.silva@example.com"
> > 			}
> > 		]
> > 	},
> > 	"customer": {
> > 		"name": "Empresa Cliente, Lda.",
> > 		"tax_id": {
> > 			"country": "PT",
> > 			"code": "514329874"
> > 		},
> > 		"addresses": [
> > 			{
> > 				"street": "Avenida da Liberdade 152 2º Direito",
> > 				"locality": "Lisboa",
> > 				"code": "1250-146",
> > 				"country": "PT"
> > 			}
> > 		]
> > 	},
> > 	"lines": [
> > 		{
> > 			"quantity": "1",
> > 			"item": {
> > 				"name": "Serviços de consultoria",
> > 				"price": "1000.00",
> > 				"unit": "h"
> > 			},
> > 			"taxes": [
> > 				{
> > 					"cat": "VAT",
> > 					"rate": "standard"
> > 				},
> > 				{
> > 					"cat": "IRS",
> > 					"percent": "25%"
> > 				}
> > 			]
> > 		}
> > 	]
> > }
> > ```
> >
> > ```json Built version theme={"system"}
> > {
> >   "$schema": "https://gobl.org/draft-0/bill/invoice",
> >   "$regime": "PT",
> >   "$addons": [
> >     "pt-saft-v1"
> >   ],
> >   "type": "standard",
> >   "series": "FT SERIES-A",
> >   "issue_date": "2024-08-03",
> >   "value_date": "2024-08-03",
> >   "currency": "EUR",
> >   "tax": {
> >     "ext": {
> >       "pt-saft-invoice-type": "FT",
> >       "pt-saft-source": "P"
> >     },
> >     "notes": [
> >       {
> >         "cat": "IRS",
> >         "text": "Art. 101.º CIRS"
> >       }
> >     ]
> >   },
> >   "supplier": {
> >     "name": "João Silva, Trabalhador Independente",
> >     "tax_id": {
> >       "country": "PT",
> >       "code": "545259045"
> >     },
> >     "addresses": [
> >       {
> >         "street": "Rua das Flores",
> >         "locality": "Lisboa",
> >         "code": "1000-000",
> >         "country": "PT"
> >       }
> >     ],
> >     "emails": [
> >       {
> >         "addr": "joao.silva@example.com"
> >       }
> >     ]
> >   },
> >   "customer": {
> >     "name": "Empresa Cliente, Lda.",
> >     "tax_id": {
> >       "country": "PT",
> >       "code": "514329874"
> >     },
> >     "addresses": [
> >       {
> >         "street": "Avenida da Liberdade 152 2º Direito",
> >         "locality": "Lisboa",
> >         "code": "1250-146",
> >         "country": "PT"
> >       }
> >     ]
> >   },
> >   "lines": [
> >     {
> >       "i": 1,
> >       "quantity": "1",
> >       "item": {
> >         "name": "Serviços de consultoria",
> >         "price": "1000.00",
> >         "unit": "h",
> >         "ext": {
> >           "pt-saft-product-type": "S"
> >         }
> >       },
> >       "sum": "1000.00",
> >       "taxes": [
> >         {
> >           "cat": "VAT",
> >           "key": "standard",
> >           "rate": "general",
> >           "percent": "23.0%",
> >           "ext": {
> >             "pt-region": "PT",
> >             "pt-saft-tax-rate": "NOR"
> >           }
> >         },
> >         {
> >           "cat": "IRS",
> >           "percent": "25%"
> >         }
> >       ],
> >       "total": "1000.00"
> >     }
> >   ],
> >   "totals": {
> >     "sum": "1000.00",
> >     "total": "1000.00",
> >     "taxes": {
> >       "categories": [
> >         {
> >           "code": "VAT",
> >           "rates": [
> >             {
> >               "key": "standard",
> >               "ext": {
> >                 "pt-region": "PT",
> >                 "pt-saft-tax-rate": "NOR"
> >               },
> >               "base": "1000.00",
> >               "percent": "23.0%",
> >               "amount": "230.00"
> >             }
> >           ],
> >           "amount": "230.00"
> >         },
> >         {
> >           "code": "IRS",
> >           "retained": true,
> >           "rates": [
> >             {
> >               "base": "1000.00",
> >               "percent": "25%",
> >               "amount": "250.00"
> >             }
> >           ],
> >           "amount": "250.00"
> >         }
> >       ],
> >       "sum": "230.00",
> >       "retained": "250.00"
> >     },
> >     "tax": "230.00",
> >     "total_with_tax": "1230.00",
> >     "retained_tax": "250.00",
> >     "payable": "980.00"
> >   }
> > }
> > ```
>
> > [accordion] AT Portugal supplier
> >
> > A Portuguese company with its NIF and the commercial registration details required on invoices.
> >
> > > [!NOTE]
> > >
> > > This example only shows the shape of the supplier JSON. Both sandbox and live workspaces require the details of a real Portuguese company, and you will need access to its account on the AT's [Portal das Finanças](https://www.portaldasfinancas.gov.pt) to complete registration. See the [supplier onboarding guide](https://docs.invopop.com/guides/pt-at-supplier.md) for the full process.
> >
> > ```json Portugal AT supplier example theme={"system"}
> > {
> >     "$schema": "https://gobl.org/draft-0/org/party",
> >     "name": "Innovatech Lda",
> >     "tax_id": {
> >         "country": "PT",
> >         "code": "504614240"
> >     },
> >     "addresses": [
> >         {
> >             "num": "156",
> >             "street": "Avenida da República",
> >             "locality": "Lisboa",
> >             "code": "1050-045",
> >             "country": "PT"
> >         }
> >     ],
> >     "emails": [
> >         {
> >             "addr": "maria@example.com"
> >         }
> >     ],
> >     "registration": {
> >         "capital": "150000.00",
> >         "office": "CRC Lisboa",
> >         "other": "sob NIF 770013813"
> >     }
> > }
> > ```
>
> > [accordion] AT Portugal self-employed supplier
> >
> > A self-employed individual (*trabalhador independente*) identified by their personal NIF, full name and address.
> >
> > > [!NOTE]
> > >
> > > The `registration` block is not required for self-employed individuals, as they have no commercial registry details or share capital to report.
> >
> > ```json Portugal AT self-employed supplier example theme={"system"}
> > {
> >     "$schema": "https://gobl.org/draft-0/org/party",
> >     "name": "João Silva Santos",
> >     "tax_id": {
> >         "country": "PT",
> >         "code": "123456789"
> >     },
> >     "addresses": [
> >         {
> >             "num": "27",
> >             "street": "Rua de Santa Catarina",
> >             "locality": "Porto",
> >             "code": "4000-447",
> >             "country": "PT"
> >         }
> >     ],
> >     "emails": [
> >         {
> >             "addr": "joao@example.com"
> >         }
> >     ]
> > }
> > ```
>
> > [accordion] AT Portugal customer
> >
> > A Portuguese business customer identified by NIF with a full address.
> >
> > ```json Portugal customer example theme={"system"}
> > {
> >     "$schema": "https://gobl.org/draft-0/org/party",
> >     "name": "Cliente Exemplo Lda",
> >     "tax_id": {
> >         "country": "PT",
> >         "code": "502757191"
> >     },
> >     "addresses": [
> >         {
> >             "num": "23",
> >             "street": "Rua Augusta",
> >             "locality": "Lisboa",
> >             "code": "1100-053",
> >             "country": "PT"
> >         }
> >     ],
> >     "emails": [
> >         {
> >             "addr": "compras@clienteexemplo.pt"
> >         }
> >     ]
> > }
> > ```
>
> Copy and paste these documents into the [GOBL builder](https://build.gobl.org) in order to preview and verify them.

***

> [accordion] 🇵🇹 Invopop resources for Portugal
>
> | | |
> | - | - |
> | Compliance | [Invoicing compliance in Portugal](https://docs.invopop.com/compliance/portugal.md)   [Compliance timeline](https://docs.invopop.com/timelines/portugal.md) |
> | Apps | [AT Portugal](https://docs.invopop.com/apps/at-portugal.md) |
> | Guides | [Supplier registration](https://docs.invopop.com/guides/pt-at-supplier.md)   [Issuing invoices](https://docs.invopop.com/guides/pt-at.md) |
> | FAQ | [Portugal FAQ](https://docs.invopop.com/faq/portugal.md) |
> | GOBL | [Portugal Tax Regime](https://docs.gobl.org/regimes/pt)   [Portugal SAF-T addon](https://docs.gobl.org/addons/pt-saft-v1) |

> [card] [Participate in our community](https://community.invopop.com)
>
> Ask and answer questions about AT Portugal App →


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.