> ## 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.

# Spain

> Manage all Spanish tax-agency integrations.

<Note>We're progressively moving towards a country-based approach to our apps, which is why you will find these steps under the "Spain" app. You can expect our current VERI\*FACTU functionality to be grouped under this app in the future. We will ensure no changes will be required for your existing workflows.</Note>

<Tabs>
  <Tab title="Description">
    <Columns cols="3">
      <div>
        <Card horizontal title="TicketBAI Invoicing" icon="https://assets.invopop.com/apps/ticketbai/icon.svg" href="/guides/es-ticketbai">
          View guide ›
        </Card>

        <Card title="SII Invoicing" icon="https://assets.invopop.com/apps/sii/icon.svg" href="/guides/es-sii" horizontal>
          View guide ›
        </Card>

        <Card title="NO VERI*FACTU Invoicing Guide" icon="https://assets.invopop.com/apps/verifactu/icon.svg" href="/guides/es-noverifactu" horizontal>
          View guide ›
        </Card>

        <Card title="Facturae" icon="https://assets.invopop.com/apps/facturae/icon.svg" href="/guides/es-facturae" horizontal>
          View guide ›
        </Card>
      </div>

      <div>
        <Card horizontal title="TicketBAI Suppliers" icon="https://assets.invopop.com/apps/ticketbai/icon.svg" href="/guides/es-ticketbai-supplier">
          View guide ›
        </Card>

        <Card title="SII Suppliers" icon="https://assets.invopop.com/apps/sii/icon.svg" href="/guides/es-sii-supplier" horizontal>
          View guide ›
        </Card>

        <Card title="Tax ID Lookup" icon="https://assets.invopop.com/apps/gov-es/icon.svg" href="/guides/es-lookup" horizontal>
          View guide ›
        </Card>

        <Card title="NO VERI*FACTU Suppliers" icon="https://assets.invopop.com/apps/verifactu/icon.svg" href="/guides/es-noverifactu-supplier" horizontal>
          View guide ›
        </Card>
      </div>

      |           |                                |
      | --------- | ------------------------------ |
      | Developer | [Invopop](https://invopop.com) |
      | Category  | Government                     |
      | Scope     | B2B                            |
      | Country   | [Spain](/compliance/spain)     |
    </Columns>

    Invopop's **Spain app** provides comprehensive integration with Spanish tax agencies, centralizing all compliance requirements for electronic invoicing and tax reporting in Spain.

    | Feature                   | TicketBAI                                 | SII                                                                      |
    | ------------------------- | ----------------------------------------- | ------------------------------------------------------------------------ |
    | **Scope**                 | Basque Country (Álava, Gipuzkoa, Bizkaia) | Rest of Spain (AEAT)                                                     |
    | **Workflow automation**   | Issue invoices and onboard suppliers      | Report invoices and onboard suppliers                                    |
    | **Compliant documents**   | XML generation and PDF with QR codes      | Invoice reporting to AEAT via SII API ([with limitations](#limitations)) |
    | **Supplier registration** | Registration wizard and agreement signing | Registration wizard and agreement signing                                |
    | **White-label**           | Issue on behalf of clients or directly    | Report on behalf of clients or directly                                  |
    | **Tax ID verification**   | Via AEAT Lookup                           | Via AEAT Lookup                                                          |

    Check out the guides below to get started:

    * [TicketBAI invoicing guide](/guides/es-ticketbai) · [TicketBAI supplier onboarding](/guides/es-ticketbai-supplier)
    * [NO VERI\*FACTU invoicing guide](/guides/es-noverifactu) · [NO VERI\*FACTU supplier onboarding](/guides/es-noverifactu-supplier)
    * [SII invoicing guide](/guides/es-sii) · [SII supplier onboarding](/guides/es-sii-supplier)
    * [Spanish Tax ID Lookup guide](/guides/es-lookup) · [Facturae guide](/guides/es-facturae)

    ## FAQ

    Invoicing questions

    <AccordionGroup>
      <Accordion title="Should I send credit notes with positive or negative values?">
        You should send the credit note with the same sign as the original invoice.

        In Spain, unlike other countries, credit notes must be submitted to Hacienda with inverse values. Invopop handles this conversion automatically before transforming the credit note into a "factura rectificativa" (corrective invoice).

        This means you only need to send the credit note following international standards (with same sign as the invoice). Invopop will automatically adapt it when submitting to Hacienda.

        For reference, see the [GOBL Invoice](https://docs.gobl.org/draft-0/bill/invoice) documentation with `type` set to `credit-note`.
      </Accordion>

      <Accordion title="Where do I find Spain-specific GOBL documentation?">
        See the [Spain tax regime in GOBL](https://docs.gobl.org/regimes/es) for tax categories, NIF rules, and Spanish-specific extensions. Subsystem-specific addons live alongside: [`es-verifactu-v1`](https://docs.gobl.org/addons/es-verifactu-v1), [`es-tbai-v1`](https://docs.gobl.org/addons/es-tbai-v1), [`es-facturae-v3`](https://docs.gobl.org/addons/es-facturae-v3).
      </Accordion>

      <Accordion title="What is the deadline for submitting invoices to SII?">
        Issued invoices must be reported within 4 calendar days from the date of issuance — and always before the 16th day of the month following the one in which the VAT liability arises. Saturdays, Sundays, and national holidays are excluded from the count. Received invoices follow the same 4-day rule but starting from the date the invoice is recorded in the books.
      </Accordion>

      <Accordion title="How do I correct an invoice already submitted to SII?">
        SII corrections are submitted as modification records (`A1`) referencing the original entry, rather than by deleting and re-sending. In practice, after fixing the underlying [GOBL](https://docs.gobl.org) document, run the SII workflow again — Invopop detects that a previous submission exists for the same invoice and emits the modification record automatically.
      </Accordion>

      <Accordion title="What's the workflow for issuing TicketBAI invoices?">
        Build a GOBL invoice with the `es-tbai-v1` addon, send it through the TicketBAI Issue Invoice workflow. Invopop signs with its *sello de empresa* certificate, generates the chained XML, and submits to the relevant Diputación Foral (Bizkaia, Gipuzkoa, or Álava).
      </Accordion>

      <Accordion title="Why don't TicketBAI QR codes work in the sandbox environment?">
        This is expected. QR codes generated in the TicketBAI sandbox environment are intentionally non-functional to prevent sandbox invoices from being mistaken for real ones.

        To verify that a sandbox QR code is correct, upload the PDF or a QR image to the foral tax authority's test verification page: [pruebatuz.bizkaia.eus](https://pruebatuz.bizkaia.eus/B4PEQR0C/testQr.xhtml?idioma=es).
      </Accordion>
    </AccordionGroup>

    Registering supplier questions

    <AccordionGroup>
      <Accordion title="What are the most common reasons for failing supplier approval?">
        We reject agreements when:

        * The uploaded document is not signed (they upload the unsigned template).
        * Users upload a handwritten signature without and ID.
        * The electronic signature is made with an FNMT certificate.
        * The agreement is missing a date or location.
        * The name is entered as an email address.

        The job will state the reason for rejection.
      </Accordion>

      <Accordion title="What happens if a supplier does not complete their registration within the allotted wait time?">
        A KO will be triggered and the supplier will be labelled with the `Error` state. We currently recommend sending a reminder to the supplier through a webhook.

        The registration link will not expire and the entity will still be able to upload their registration documents which will be validated. Should you choose to run this workflow again using this supplier, the supplier will be accepted or rejected immediately because the required documentation has already been provided and validated.
      </Accordion>

      <Accordion title="What happens if a supplier validation is rejected?">
        If the uploaded agreement documents were rejected, a KO will be triggered and the supplier will be labelled with the `Error` state. We currently recommend sending a notification to the supplier through a webhook within the **Error Handling** section.

        Afterwards, if you wish to re-register the supplier with new documents, you must:

        1. Unregister the supplier using the **Unregister Supplier workflow**.
        2. Re-run the Register supplier workflow.

        This will restart the entire registration process. When uploading documents, the previously submitted agreement will appear selected by default. Simply choose a new file and click `Continue` to override the old one. See the image below for reference:

        <Frame caption="Overriding the previously submitted agreement">
          <img width="600" src="https://mintcdn.com/invopop/fWniCD0icTwRKXxR/assets/guides/es-verifactu-update-agreement.png?fit=max&auto=format&n=fWniCD0icTwRKXxR&q=85&s=a20bb8dd02df632d114e0519f4d34899" alt="Overriding the previously submitted agreement" data-path="assets/guides/es-verifactu-update-agreement.png" />
        </Frame>
      </Accordion>

      <Accordion title="What is the minimum information required to register a supplier?">
        In order to complete the representation agreement you will need to provide the following information:

        **Company**

        1. Name
        2. NIF
        3. Address

        **Legal representative**

        1. Full name
        2. Government ID type and number
        3. Address

        ```json Spain supplier example theme={"system"}
        {
          "$schema": "https://gobl.org/draft-0/org/party",
          "name": "Invopop S.L.",
          "tax_id": {
            "country": "ES",
            "code": "B85905495"
          },
            "people": [
                {
                    "name": {
                        "given": "Juan",
                        "surname": "Pérez González"
                    },
                    "identities": [
                        {
                            "key": "national",
                            "code": "123456789A"
                        }
                    ],
                    "addresses": [
                        {
                            "num": "10",
                            "street": "Calle Ejemplo",
                            "locality": "Madrid",
                            "region": "Madrid",
                            "code": "28020",
                            "country": "ES"
                        }
                    ]
                }
            ],
          "addresses": [
            {
              "num": "42",
              "street": "Calle Pradillo",
              "locality": "Madrid",
              "region": "Madrid",
              "code": "28002",
              "country": "ES"
            }
          ],
          "emails": [
            {
              "addr": "billing@example.com"
            }
          ]
        }
        ```

        If the entity is an self-employed individual (*autónomo*), only the information requested in in the **Legal representative** section is required.

        ```json Spain autónomo supplier example theme={"system"}
        {
          "$schema": "https://gobl.org/draft-0/org/party",
          "name": "Juan Pérez González",
          "tax_id": {
            "country": "ES",
            "code": "B85905495"
          },
          "addresses": [
            {
              "num": "42",
              "street": "Calle Pradillo",
              "locality": "Madrid",
              "region": "Madrid",
              "code": "28002",
              "country": "ES"
            }
          ],
          "emails": [
            {
              "addr": "autonomo@example.com"
            }
          ]
        }
        ```
      </Accordion>

      <Accordion title="What methods are available to sign the PDF supplier agreements?">
        The supplier can add their electronic signature to the PDF document ([instructions](https://helpx.adobe.com/acrobat/using/signing-pdfs.html)), or sign with a handwritten signature (we recommend using [Adobe's online service](https://www.adobe.com/acrobat/online/sign-pdf.html).
      </Accordion>

      <Accordion title="What is the file size limit for the documents provided in the supplier registration flow">
        Individual documents are limited to a maximum size of 10MB. Uploads exceeding this size will result in an error.
      </Accordion>

      <Accordion title="How do I register a supplier with SII?">
        Run the SII Register Supplier workflow. The supplier signs the representation agreement and Invopop registers as their *colaborador social* with AEAT. Invopop's own certificate is then used for SII submissions on their behalf.
      </Accordion>

      <Accordion title="What certificates does SII require to authenticate a supplier?">
        SII web services accept any AEAT-recognized certificate. Invopop signs submissions with its *certificado de representante de persona jurídica*, acting under the colaborador social arrangement — suppliers do not upload their own certificates.
      </Accordion>

      <Accordion title="How do I register a supplier with TicketBAI?">
        Run the TicketBAI Register Supplier workflow. The legal representative signs the agreement (electronic or handwritten + ID); the supplier's foral territory determines which Diputación Foral endpoint Invopop will submit to.
      </Accordion>

      <Accordion title="What certificates does TicketBAI require to authenticate a supplier?">
        None — Invopop uses its own *certificado sello de empresa* (one of the three TicketBAI-permitted types). Suppliers do not need to register with the foral tax authority or upload any certificate.
      </Accordion>
    </AccordionGroup>

    Reporting questions

    <AccordionGroup>
      <Accordion title="How often must I submit SII reports?">
        Continuously, every issued or received invoice must be reported within 4 calendar days (excluding weekends and holidays), and always before the 16th of the following month. There is no daily cadence; submissions happen as documents are processed.
      </Accordion>

      <Accordion title="What format does SII expect for periodic reports?">
        SOAP web services with XML payloads — distinct schemas for issued (`SuministroFactEmitidas`), received (`SuministroFactRecibidas`), investment goods, and intra-EU operations. Each call carries up to 10,000 records signed with the issuer's (or representative's) certificate.
      </Accordion>
    </AccordionGroup>

    More answers in our [Spain FAQ](/faq/spain) section
  </Tab>

  <Tab title="Limitations">
    ### SII implementation scope

    <Note>Our SII implementation is under active development and focuses on core functionality for the most common use cases. If these limitations affect your business requirements, please contact us to discuss your specific needs and our implementation roadmap.</Note>

    The current SII integration provides a foundational implementation covering the primary VAT registry books required for most businesses operating in Spain. Understanding what is and isn't supported will help you determine if this solution meets your compliance needs.

    #### Supported Registry Books

    We currently support the two most commonly used VAT registry books:

    * ***Libro de Registro de Facturas Expedidas*** (Issued Invoices Registry)
    * ***Libro de Registro de Facturas Recibidas*** (Received Invoices Registry) - [with specific limitations](#received-invoices-limitations)

    #### Unsupported Registry Books

    The following VAT registry books are **not supported** at the moment:

    * ***Libro de Registro de Bienes de Inversión*** (Investment Goods Registry)
    * ***Libro de Registro de Determinadas Operaciones Intracomunitarias*** (Specific Intra-Community Operations Registry)
    * Other registries such as cash payments (*pagos en metálico*), travel agency operations (*operaciones de agencias de viajes*), etc.

    #### Received Invoices Limitations

    When reporting to the **Libro de Registro de Facturas Recibidas**, the following key limitations apply:

    1. **Deductible VAT matching:** The deductible VAT amount (*cuota deducible*) always equals the charged VAT amount (*cuota repercutida*). Invoices where the deductible VAT is lower than the charged VAT cannot be reported.

    2. **Investment goods flag:** Invoices cannot be marked as investment goods (*bienes de inversión*) within the received invoices registry.

    3. **Deduction period alignment:** The deduction period must match the settlement period. Deduction periods that differ from the liquidation periods cannot be specified.

    These represent the primary limitations in the current implementation.

    #### Regional Endpoints

    Currently, only the **AEAT (Agencia Estatal de Administración Tributaria)** endpoint is supported for SII reporting. This covers businesses operating under the standard Spanish tax framework.

    Support for the **Canary Islands**, **Navarra** and the **Basque Country** regional endpoints is coming soon.
  </Tab>

  <Tab title="Actions">
    The following workflow actions will be available once you install and enable this app:

    AEAT Lookup actions

    <Card title="Verify Spanish Tax ID" icon="https://assets.invopop.com/apps/gov-es/icon.svg" horizontal>
      <div class="pop-count"><Icon icon="https://assets.invopop.com/icons/pops.svg" /> 1</div>
      Verify that a Spanish tax ID (NIF/CIF) exists in the AEAT census. For companies, this confirms the tax ID is valid. For individuals, it also verifies that the name matches the tax ID on record.
    </Card>

    <Card title="Verify & correct tax details" icon="https://assets.invopop.com/apps/gov-es/icon.svg" horizontal>
      <div class="pop-count"><Icon icon="https://assets.invopop.com/icons/pops.svg" /> 1</div>
      Verify the tax ID and normalize names using AEAT data. For companies, it sets the official name; for individuals, it applies the AEAT-returned format.
    </Card>

    Facturae actions

    <Card title="Generate Facturae XML" icon="https://assets.invopop.com/apps/facturae/icon.svg" horizontal>
      <div class="pop-count"><Icon icon="https://assets.invopop.com/icons/pops.svg" /> 1</div>
      Convert GOBL invoices into Spanish Facturae 3.2.2 XML files.
    </Card>

    TicketBAI actions

    <Card title="Send invoice to TicketBAI" icon="https://assets.invopop.com/apps/ticketbai/icon.svg" horizontal>
      <div class="pop-count"><Icon icon="https://assets.invopop.com/icons/pops.svg" /> 1</div>
      Convert GOBL Invoices into TicketBAI XML format and send to the tax agency in Spain.
    </Card>

    <Card title="Generate TicketBAI XML" icon="https://assets.invopop.com/apps/ticketbai/icon.svg" horizontal>
      <div class="pop-count"><Icon icon="https://assets.invopop.com/icons/pops.svg" /> 1</div>
      Generate a TicketBAI XML document from a GOBL invoice.
    </Card>

    <Card title="Cancel invoice in TicketBAI" icon="https://assets.invopop.com/apps/ticketbai/icon.svg" horizontal>
      Send a cancel request for a previously sent TicketBAI invoice.
    </Card>

    <Card title="Register supplier with TicketBAI" icon="https://assets.invopop.com/apps/ticketbai/icon.svg" horizontal>
      Register TicketBAI parties before issuing invoices on their behalf.
    </Card>

    <Card title="Wait for TicketBAI supplier agreement upload" icon="https://assets.invopop.com/apps/ticketbai/icon.svg" horizontal>
      Block the job while waiting for the end-user to complete their registration steps.
    </Card>

    <Card title="Wait for TicketBAI supplier approval" icon="https://assets.invopop.com/apps/ticketbai/icon.svg" horizontal>
      Wait for approval that the uploaded documentation is correct.
    </Card>

    <Card title="Unregister supplier with TicketBAI" icon="https://assets.invopop.com/apps/ticketbai/icon.svg" horizontal>
      Disables a previously registered party from issuing invoices.
    </Card>

    SII actions

    <Card title="Record Issued Invoice with SII" icon="https://assets.invopop.com/apps/sii/icon.svg" horizontal>
      <div class="pop-count"><Icon icon="https://assets.invopop.com/icons/pops.svg" /> 2</div>
      Record issued invoices in the SII system.
    </Card>

    <Card title="Record Received Invoice with SII" icon="https://assets.invopop.com/apps/sii/icon.svg" horizontal>
      <div class="pop-count"><Icon icon="https://assets.invopop.com/icons/pops.svg" /> 2</div>
      Record received invoices in the SII system.
    </Card>

    <Card title="Register supplier with SII" icon="https://assets.invopop.com/apps/sii/icon.svg" horizontal>
      Register SII parties before reporting invoices on their behalf.
    </Card>

    <Card title="Wait for SII supplier agreement upload" icon="https://assets.invopop.com/apps/sii/icon.svg" horizontal>
      Block the job while waiting for the end-user to complete their registration steps.
    </Card>

    <Card title="Wait for SII supplier approval" icon="https://assets.invopop.com/apps/sii/icon.svg" horizontal>
      Wait for approval that the uploaded documentation is correct.
    </Card>

    <Card title="Unregister supplier with SII" icon="https://assets.invopop.com/apps/sii/icon.svg" horizontal>
      Disables a previously registered party from reporting invoices.
    </Card>

    NO VERI\*FACTU actions

    <Card title="Generate invoice for NO VERI*FACTU" icon="https://assets.invopop.com/apps/verifactu/icon.svg" horizontal>
      Generate and digitally sign an invoicing record XML from a GOBL invoice.
    </Card>

    <Card title="Generate cancellation for NO VERI*FACTU" icon="https://assets.invopop.com/apps/verifactu/icon.svg" horizontal>
      Generate and digitally sign a cancellation record for a previously recorded invoice.
    </Card>

    <Card title="Generate event for NO VERI*FACTU" icon="https://assets.invopop.com/apps/verifactu/icon.svg" horizontal>
      Generate and digitally sign an event record XML from a GOBL status.
    </Card>

    <Card title="Record for NO VERI*FACTU" icon="https://assets.invopop.com/apps/verifactu/icon.svg" horizontal>
      Persist a signed record in the database for regulatory compliance.
    </Card>

    <Card title="Build status for NO VERI*FACTU" icon="https://assets.invopop.com/apps/verifactu/icon.svg" horizontal>
      Build a GOBL status event document and upload it as a silo entry.
    </Card>

    <Card title="Register supplier with NO VERI*FACTU" icon="https://assets.invopop.com/apps/verifactu/icon.svg" horizontal>
      Register a party for NO VERI\*FACTU mode.
    </Card>

    <Card title="Unregister supplier from NO VERI*FACTU" icon="https://assets.invopop.com/apps/verifactu/icon.svg" horizontal>
      Remove a party's NO VERI\*FACTU registration.
    </Card>
  </Tab>

  <Tab title="Workflows">
    TicketBAI invoice workflows

    <AccordionGroup>
      <Accordion title="TicketBAI issue invoice">
        ```json Example TicketBAI invoice workflow theme={"system"}
        {
          "name": "TicketBAI issue invoice",
          "description": "Issue a TicketBAI invoice and generate PDF with QR",
          "schema": "bill/invoice",
          "steps": [
            {
              "id": "dd319d60-8bc1-11ef-96af-b55bf69bb0b8",
              "name": "Add sequential code",
              "config": {
                "name": "TicketBAI Invoice",
                "start": 1,
                "prefix": "F",
                "padding": 6
              },
              "summary": "Dynamic · TicketBAI · F000001",
              "provider": "sequence.enumerate"
            },
            {
              "id": "ba77d5b0-7b3a-11ef-bffc-d9a10ebf9f89",
              "name": "Set state",
              "config": {
                "state": "processing"
              },
              "summary": "Set state to `processing`{.state .processing}",
              "provider": "silo.state"
            },
            {
              "id": "fc75e4f0-8721-11ef-a962-73e3f2037a52",
              "name": "Sign envelope",
              "provider": "silo.close"
            },
            {
              "id": "fc618ea0-a757-11ef-8377-c15ac3014ffb",
              "name": "Generate TicketBAI XML",
              "provider": "gov-es.ticketbai.generate"
            },
            {
              "id": "0448df60-a758-11ef-8377-c15ac3014ffb",
              "name": "Send invoice to TicketBAI",
              "provider": "gov-es.ticketbai.send"
            },
            {
              "id": "c61adaa0-7b55-11ef-bffc-d9a10ebf9f89",
              "name": "Generate PDF",
              "config": {
                "locale": "es",
                "date_format": "%Y-%m-%d",
                "logo_height": 40
              },
              "summary": "Spanish · A4",
              "provider": "pdf"
            },
            {
              "id": "d8693d70-7b3a-11ef-bffc-d9a10ebf9f89",
              "name": "Set state",
              "config": {
                "state": "sent"
              },
              "summary": "Set state to `sent`{.state .sent}",
              "provider": "silo.state"
            }
          ],
          "rescue": [
            {
              "id": "dd889490-7b3a-11ef-bffc-d9a10ebf9f89",
              "name": "Set state",
              "config": {
                "state": "error"
              },
              "summary": "Set state to `error`{.state .error}",
              "provider": "silo.state"
            }
          ]
        }
        ```
      </Accordion>

      <Accordion title="TicketBAI cancel invoice">
        ```json Example TicketBAI cancel invoice workflow theme={"system"}
        {
            "name": "TicketBAI cancel invoice",
            "description": "Cancel an invoice via TicketBAI",
            "schema": "bill/invoice",
            "steps": [
                {
                    "id": "2f897e30-3c9c-11f0-8690-a921c0418914",
                    "name": "Cancel invoice in TicketBAI",
                    "provider": "gov-es.ticketbai.cancel"
                },
                {
                    "id": "334ffc10-3c9c-11f0-8690-a921c0418914",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `void`{.state .void}",
                    "config": {
                        "state": "void"
                    }
                }
            ],
            "rescue": [
                {
                    "id": "384cfe20-3c9c-11f0-8690-a921c0418914",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `error`{.state .error}",
                    "config": {
                        "state": "error"
                    }
                }
            ]
        }

        ```
      </Accordion>
    </AccordionGroup>

    TicketBAI party workflows

    <AccordionGroup>
      <Accordion title="TicketBAI register party">
        ```json Example TicketBAI register supplier workflow theme={"system"}
        {
            "name": "TicketBAI register supplier",
            "description": "Register a supplier with TicketBAI",
            "schema": "org/party",
            "steps": [
                {
                    "id": "554c7040-66d7-11f0-a392-dfb6c99d6698",
                    "name": "Register supplier with TicketBAI",
                    "provider": "gov-es.ticketbai.register"
                },
                {
                    "id": "62148880-66d7-11f0-a392-dfb6c99d6698",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `processing`{.state .processing}",
                    "config": {
                        "state": "processing"
                    }
                },
                {
                    "id": "5b924600-66d7-11f0-a392-dfb6c99d6698",
                    "name": "Wait for TicketBAI supplier agreement upload",
                    "provider": "gov-es.ticketbai.wait.upload"
                },
                {
                    "id": "6bec1080-66d7-11f0-a392-dfb6c99d6698",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `registered`{.state .registered}",
                    "config": {
                        "state": "registered"
                    }
                },
                {
                    "id": "670d1dc0-66d7-11f0-a392-dfb6c99d6698",
                    "name": "Wait for TicketBAI supplier approval",
                    "provider": "gov-es.ticketbai.wait.approval"
                }
            ],
            "rescue": [
                {
                    "id": "76c13260-66d7-11f0-a392-dfb6c99d6698",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `error`{.state .error}",
                    "config": {
                        "state": "error"
                    }
                }
            ]
        }
        ```
      </Accordion>

      <Accordion title="TicketBAI unregister party">
        ```json Example TicketBAI unregister supplier workflow theme={"system"}
        {
            "name": "TicketBAI unregister supplier",
            "description": "Unregister a supplier from TicketBAI",
            "schema": "org/party",
            "steps": [
                {
                    "id": "8a613610-67ba-11f0-bcaf-170efff782a9",
                    "name": "Unregister supplier from TicketBAI",
                    "provider": "gov-es.ticketbai.unregister"
                },
                {
                    "id": "96a6b0d0-67ba-11f0-bcaf-170efff782a9",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `void`{.state .void}",
                    "config": {
                        "state": "void"
                    }
                }
            ],
            "rescue": [
                {
                    "id": "e8d2a6b0-67bb-11f0-bcaf-170efff782a9",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `error`{.state .error}",
                    "config": {
                        "state": "error"
                    }
                }
            ]
        }
        ```
      </Accordion>
    </AccordionGroup>

    Facturae workflows

    <AccordionGroup>
      <Accordion title="Facturae generate invoice">
        ```json Example Facturae invoice workflow theme={"system"}
        {
            "name": "Facturae generate invoice",
            "description": "Generate a Facturae XML invoice",
            "schema": "bill/invoice",
            "steps": [
                {
                    "id": "dc2d4780-0be4-11f1-99f1-2d47ed7bc202",
                    "name": "Add sequential code",
                    "provider": "sequence.enumerate",
                    "summary": "Dynamic · Facturae · 000001",
                    "config": {
                        "name": "Facturae",
                        "padding": 6,
                        "start": 1
                    }
                },
                {
                    "id": "e2d8e3f0-0be4-11f1-99f1-2d47ed7bc202",
                    "name": "Sign envelope",
                    "provider": "silo.close"
                },
                {
                    "id": "ef9897c0-0be4-11f1-99f1-2d47ed7bc202",
                    "name": "Generate Facturae XML",
                    "provider": "gov-es.facturae.generate"
                }
            ],
            "rescue": []
        }
        ```
      </Accordion>
    </AccordionGroup>

    SII invoice workflows

    <AccordionGroup>
      <Accordion title="SII issue invoice">
        ```json Example SII issue invoice workflow theme={"system"}
        {
          "name": "SII issue invoice",
          "description": "Record an issued invoice with SII and generate PDF",
          "schema": "bill/invoice",
          "steps": [
            {
              "id": "59f4dee0-bc8f-11ef-8ca1-573cbe7db4cd",
              "name": "Set state",
              "provider": "silo.state",
              "summary": "Set state to `processing`{.state .processing}",
              "config": {
                "state": "processing"
              }
            },
            {
              "id": "ec41cce0-0fc3-11f0-8a81-7911b3ecee3c",
              "name": "Add sequential code",
              "provider": "sequence.enumerate",
              "summary": "Dynamic · SII · 000001",
              "config": {
                "name": "SII",
                "padding": 6,
                "start": 1
              }
            },
            {
              "id": "fc75e4f0-8721-11ef-a962-73e3f2037a52",
              "name": "Sign envelope",
              "provider": "silo.close"
            },
            {
              "id": "61661540-bc8f-11ef-8ca1-573cbe7db4cd",
              "name": "Record issued invoice in SII",
              "provider": "gov-es.sii.record.issued"
            },
            {
              "id": "65312700-bc8f-11ef-8ca1-573cbe7db4cd",
              "name": "Generate PDF",
              "provider": "pdf",
              "summary": "Spanish · A4",
              "config": {
                "date_format": "%Y-%m-%d",
                "layout": "A4",
                "locale": "es",
                "logo_height": 60
              }
            },
            {
              "id": "6abb4de0-bc8f-11ef-8ca1-573cbe7db4cd",
              "name": "Set state",
              "provider": "silo.state",
              "summary": "Set state to `sent`{.state .sent}",
              "config": {
                "state": "sent"
              }
            }
          ],
          "rescue": [
            {
              "id": "798b1d00-bc8f-11ef-8ca1-573cbe7db4cd",
              "name": "Set state",
              "provider": "silo.state",
              "summary": "Set state to `error`{.state .error}",
              "config": {
                "state": "error"
              }
            }
          ]
        }
        ```
      </Accordion>

      <Accordion title="SII record received invoice">
        ```json Example SII record received invoice workflow theme={"system"}
        {
          "name": "SII record received invoice",
          "description": "Record a received invoice with SII",
          "schema": "bill/invoice",
          "steps": [
            {
              "id": "59f4dee0-bc8f-11ef-8ca1-573cbe7db4cd",
              "name": "Set state",
              "provider": "silo.state",
              "summary": "Set state to `processing`{.state .processing}",
              "config": {
                "state": "processing"
              }
            },
            {
              "id": "ec41cce0-0fc3-11f0-8a81-7911b3ecee3c",
              "name": "Add sequential code",
              "provider": "sequence.enumerate",
              "summary": "Dynamic · SII · 000001",
              "config": {
                "name": "SII",
                "padding": 6,
                "start": 1
              }
            },
            {
              "id": "fc75e4f0-8721-11ef-a962-73e3f2037a52",
              "name": "Sign envelope",
              "provider": "silo.close"
            },
            {
              "id": "61661540-bc8f-11ef-8ca1-573cbe7db4cd",
              "name": "Record received invoice in SII",
              "provider": "gov-es.sii.record.received"
            },
            {
              "id": "6abb4de0-bc8f-11ef-8ca1-573cbe7db4cd",
              "name": "Set state",
              "provider": "silo.state",
              "summary": "Set state to `sent`{.state .sent}",
              "config": {
                "state": "sent"
              }
            }
          ],
          "rescue": [
            {
              "id": "798b1d00-bc8f-11ef-8ca1-573cbe7db4cd",
              "name": "Set state",
              "provider": "silo.state",
              "summary": "Set state to `error`{.state .error}",
              "config": {
                "state": "error"
              }
            }
          ]
        }
        ```
      </Accordion>
    </AccordionGroup>

    SII party workflows

    <AccordionGroup>
      <Accordion title="SII register party">
        ```json Example SII register supplier workflow theme={"system"}
        {
            "name": "SII register supplier",
            "description": "Register a supplier with SII",
            "schema": "org/party",
            "steps": [
                {
                    "id": "52f5d190-831c-11f0-9ba3-7d4deb7b9d0e",
                    "name": "Register supplier with SII",
                    "provider": "gov-es.sii.register"
                },
                {
                    "id": "5bfc9c10-831c-11f0-9ba3-7d4deb7b9d0e",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `processing`{.state .processing}",
                    "config": {
                        "state": "processing"
                    }
                },
                {
                    "id": "627c94a0-831c-11f0-9ba3-7d4deb7b9d0e",
                    "name": "Wait for SII supplier agreement upload",
                    "provider": "gov-es.sii.wait.upload"
                },
                {
                    "id": "6f84ea30-831c-11f0-9ba3-7d4deb7b9d0e",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `registered`{.state .registered}",
                    "config": {
                        "state": "registered"
                    }
                },
                {
                    "id": "78dabf10-831c-11f0-9ba3-7d4deb7b9d0e",
                    "name": "Wait for SII supplier approval",
                    "provider": "gov-es.sii.wait.approval"
                }
            ],
            "rescue": [
                {
                    "id": "846415c0-831c-11f0-9ba3-7d4deb7b9d0e",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `rejected`{.state .rejected}",
                    "config": {
                        "state": "rejected"
                    }
                },
                {
                    "id": "d0e996c0-d9db-11f0-9b9a-5143ba8c831d",
                    "name": "Unregister supplier from SII",
                    "provider": "gov-es.sii.unregister"
                }
            ]
        }
        ```
      </Accordion>

      <Accordion title="SII unregister party">
        ```json Example SII unregister supplier workflow theme={"system"}
        {
            "name": "SII unregister supplier",
            "description": "Unregister a supplier from SII",
            "schema": "org/party",
            "steps": [
                {
                    "id": "8a613610-67ba-11f0-bcaf-170efff782a9",
                    "name": "Unregister supplier from SII",
                    "provider": "gov-es.sii.unregister"
                },
                {
                    "id": "96a6b0d0-67ba-11f0-bcaf-170efff782a9",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `void`{.state .void}",
                    "config": {
                        "state": "void"
                    }
                }
            ],
            "rescue": [
                {
                    "id": "e8d2a6b0-67bb-11f0-bcaf-170efff782a9",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `error`{.state .error}",
                    "config": {
                        "state": "error"
                    }
                }
            ]
        }
        ```
      </Accordion>
    </AccordionGroup>

    NO VERI\*FACTU invoice workflows

    <AccordionGroup>
      <Accordion title="NO VERI*FACTU issue invoice">
        ```json Example NO VERI*FACTU invoice workflow with states expandable theme={"system"}
        {
            "name": "NO VERI*FACTU issue invoice",
            "description": "Issue an invoice via NO VERI*FACTU and generate PDF",
            "schema": "bill/invoice",
            "steps": [
                {
                    "id": "a1b2c3d0-0001-11f1-a000-000000000001",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `processing`{.state .processing}",
                    "config": {
                        "state": "processing"
                    },
                    "next": []
                },
                {
                    "id": "a1b2c3d0-0001-11f1-a000-000000000002",
                    "name": "Add sequential code",
                    "provider": "sequence.enumerate",
                    "summary": "Dynamic · NO VERI*FACTU · 000001",
                    "config": {
                        "name": "NoVerifactu",
                        "padding": 6,
                        "start": 1
                    },
                    "next": []
                },
                {
                    "id": "a1b2c3d0-0001-11f1-a000-000000000003",
                    "name": "Sign envelope",
                    "provider": "silo.close",
                    "next": []
                },
                {
                    "id": "5bb35ae0-3ca4-11f1-90b7-0d81b4010093",
                    "name": "Generate invoice for NO VERI*FACTU",
                    "provider": "gov-es.noverifactu.generate.invoice",
                    "next": []
                },
                {
                    "id": "64c2d7f0-3ca4-11f1-90b7-0d81b4010093",
                    "name": "Record for NO VERI*FACTU",
                    "provider": "gov-es.noverifactu.record",
                    "next": []
                },
                {
                    "id": "a1b2c3d0-0001-11f1-a000-000000000006",
                    "name": "Generate PDF",
                    "provider": "pdf",
                    "summary": "Spanish · A4",
                    "config": {
                        "date_format": "%Y-%m-%d",
                        "layout": "A4",
                        "locale": "es",
                        "logo_height": 60
                    },
                    "next": []
                },
                {
                    "id": "a1b2c3d0-0001-11f1-a000-000000000007",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `registered`{.state .registered}",
                    "config": {
                        "state": "registered"
                    },
                    "next": []
                }
            ],
            "rescue": [
                {
                    "id": "a1b2c3d0-0001-11f1-a000-000000000008",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `error`{.state .error}",
                    "config": {
                        "state": "error"
                    },
                    "next": []
                }
            ]
        }
        ```
      </Accordion>

      <Accordion title="NO VERI*FACTU cancel invoice">
        ```json Example NO VERI*FACTU cancel workflow with states expandable theme={"system"}
        {
            "name": "NO VERI*FACTU cancel invoice",
            "description": "Cancel an invoice via NO VERI*FACTU",
            "schema": "bill/invoice",
            "steps": [
                {
                    "id": "b2c3d4e0-0002-11f1-a000-000000000005",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `processing`{.state .processing}",
                    "config": {
                        "state": "processing"
                    }
                },
                {
                    "id": "9f500280-3ca4-11f1-90b7-0d81b4010093",
                    "name": "Generate cancellation for NO VERI*FACTU",
                    "provider": "gov-es.noverifactu.generate.cancel"
                },
                {
                    "id": "a6eeb180-3ca4-11f1-90b7-0d81b4010093",
                    "name": "Record for NO VERI*FACTU",
                    "provider": "gov-es.noverifactu.record"
                },
                {
                    "id": "b2c3d4e0-0002-11f1-a000-000000000003",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `void`{.state .void}",
                    "config": {
                        "state": "void"
                    }
                }
            ],
            "rescue": [
                {
                    "id": "b2c3d4e0-0002-11f1-a000-000000000004",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `error`{.state .error}",
                    "config": {
                        "state": "error"
                    }
                }
            ]
        }
        ```
      </Accordion>
    </AccordionGroup>

    NO VERI\*FACTU party workflows

    <AccordionGroup>
      <Accordion title="NO VERI*FACTU register supplier">
        ```json Example NO VERI*FACTU register supplier workflow expandable theme={"system"}
        {
            "name": "NO VERI*FACTU register supplier",
            "description": "Register a supplier with NO VERI*FACTU, generate the start-of-mode event, and subscribe to summary events",
            "schema": "org/party",
            "steps": [
                {
                    "id": "c21b4130-3a65-11f1-a475-db4c42dd4e99",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `processing`{.state .processing}",
                    "config": {
                        "state": "processing"
                    },
                    "next": []
                },
                {
                    "id": "78e845e0-3ca3-11f1-90b7-0d81b4010093",
                    "name": "Register supplier with NO VERI*FACTU",
                    "provider": "gov-es.noverifactu.register",
                    "next": []
                },
                {
                    "id": "8857fe80-3ca3-11f1-90b7-0d81b4010093",
                    "name": "Build status for NO VERI*FACTU",
                    "provider": "gov-es.noverifactu.build.status",
                    "next": [],
                    "summary": "Build status: 01 - Start of NO VERI*FACTU mode",
                    "config": {
                        "event_type": "01"
                    }
                },
                {
                    "id": "d16d34a0-3a91-11f1-a472-21be9722e465",
                    "name": "Create a job",
                    "provider": "transform.job.create",
                    "summary": "Send to NO VERI*FACTU process event (bill/status)",
                    "config": {
                        "silo_entry_meta_key": "",
                        "workflow_id": ""
                    },
                    "next": []
                },
                {
                    "id": "03cb3000-3a92-11f1-a472-21be9722e465",
                    "name": "Subscribe to periodic execution",
                    "provider": "cron.subscribe",
                    "summary": "Every 6 hours",
                    "config": {
                        "workflow_id": "",
                        "interval": "hourly",
                        "factor": 6
                    },
                    "next": []
                },
                {
                    "id": "c3d4e5f0-0003-11f1-a000-000000000002",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `registered`{.state .registered}",
                    "config": {
                        "state": "registered"
                    },
                    "next": []
                }
            ],
            "rescue": [
                {
                    "id": "c3d4e5f0-0003-11f1-a000-000000000005",
                    "name": "Unregister supplier from NO VERI*FACTU",
                    "provider": "gov-es.noverifactu.unregister",
                    "next": []
                },
                {
                    "id": "c3d4e5f0-0003-11f1-a000-000000000006",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `rejected`{.state .rejected}",
                    "config": {
                        "state": "rejected"
                    },
                    "next": []
                }
            ]
        }
        ```
      </Accordion>

      <Accordion title="NO VERI*FACTU unregister supplier">
        ```json Example NO VERI*FACTU unregister supplier workflow expandable theme={"system"}
        {
            "name": "NO VERI*FACTU unregister supplier",
            "description": "Unregister a supplier from NO VERI*FACTU and generate the end-of-mode event",
            "schema": "org/party",
            "steps": [
                {
                    "id": "d4e5f6a0-0004-11f1-a000-000000000007",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `processing`{.state .processing}",
                    "config": {
                        "state": "processing"
                    }
                },
                {
                    "id": "3e4bd770-3a92-11f1-a472-21be9722e465",
                    "name": "Unsubscribe from periodic execution",
                    "provider": "cron.unsubscribe"
                },
                {
                    "id": "f46dfa20-3ca3-11f1-90b7-0d81b4010093",
                    "name": "Build status for NO VERI*FACTU",
                    "provider": "gov-es.noverifactu.build.status",
                    "summary": "Build status: 02 - End of NO VERI*FACTU mode",
                    "config": {
                        "event_type": "02"
                    }
                },
                {
                    "id": "2fbe2590-3caf-11f1-ae77-65667068cb42",
                    "name": "Create a job",
                    "provider": "transform.job.create",
                    "summary": "Send to NO VERI*FACTU process event (bill/status)",
                    "config": {
                        "silo_entry_meta_key": "",
                        "workflow_id": ""
                    }
                },
                {
                    "id": "9a9235e0-3cb0-11f1-ae77-65667068cb42",
                    "name": "Unregister supplier from NO VERI*FACTU",
                    "provider": "gov-es.noverifactu.unregister"
                },
                {
                    "id": "d4e5f6a0-0004-11f1-a000-000000000004",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `void`{.state .void}",
                    "config": {
                        "state": "void"
                    }
                }
            ],
            "rescue": [
                {
                    "id": "d4e5f6a0-0004-11f1-a000-000000000006",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `error`{.state .error}",
                    "config": {
                        "state": "error"
                    }
                }
            ]
        }
        ```
      </Accordion>
    </AccordionGroup>

    NO VERI\*FACTU event workflows

    <AccordionGroup>
      <Accordion title="NO VERI*FACTU process event">
        ```json Example NO VERI*FACTU event processing workflow expandable theme={"system"}
        {
            "name": "NO VERI*FACTU process event",
            "description": "Generate and store a NO VERI*FACTU event record",
            "schema": "bill/status",
            "steps": [
                {
                    "id": "e5f6a7b0-0005-11f1-a000-000000000004",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `processing`{.state .processing}",
                    "config": {
                        "state": "processing"
                    }
                },
                {
                    "id": "bbf19740-3a6b-11f1-9a44-6748aa5d4a91",
                    "name": "Modify silo entry",
                    "provider": "silo.modify",
                    "summary": "Default series to \"NVF\"",
                    "config": {
                        "jq": ".series //= \"NVF\"",
                        "merge_type": "application/jq",
                        "scope": "doc"
                    }
                },
                {
                    "id": "a1b2c3d0-0001-11f1-a000-000000000002",
                    "name": "Add sequential code",
                    "provider": "sequence.enumerate",
                    "summary": "Dynamic · NO VERI*FACTU · 000001",
                    "config": {
                        "name": "NoVerifactu",
                        "padding": 6,
                        "start": 1
                    }
                },
                {
                    "id": "e5f6a7b0-0005-11f1-a000-000000000006",
                    "name": "Sign envelope",
                    "provider": "silo.close"
                },
                {
                    "id": "f8df5470-3c97-11f1-8c73-6dd226144d30",
                    "name": "Generate event for NO VERI*FACTU",
                    "provider": "gov-es.noverifactu.generate.event"
                },
                {
                    "id": "050b05a0-3c98-11f1-8c73-6dd226144d30",
                    "name": "Record for NO VERI*FACTU",
                    "provider": "gov-es.noverifactu.record"
                },
                {
                    "id": "e5f6a7b0-0005-11f1-a000-000000000005",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `registered`{.state .registered}",
                    "config": {
                        "state": "registered"
                    }
                }
            ],
            "rescue": [
                {
                    "id": "e5f6a7b0-0005-11f1-a000-000000000003",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `error`{.state .error}",
                    "config": {
                        "state": "error"
                    }
                }
            ]
        }
        ```
      </Accordion>

      <Accordion title="NO VERI*FACTU summary event">
        ```json Example NO VERI*FACTU summary event cron workflow expandable theme={"system"}
        {
            "name": "NO VERI*FACTU summary event",
            "description": "Build a NO VERI*FACTU summary event (cron-driven)",
            "schema": "org/party",
            "steps": [
                {
                    "id": "f6a7b8c0-0006-11f1-a000-000000000001",
                    "name": "Build status for NO VERI*FACTU",
                    "provider": "gov-es.noverifactu.build.status",
                    "summary": "Build status: 10 - Summary event",
                    "config": {
                        "event_type": "10"
                    }
                },
                {
                    "id": "4f527c60-3a95-11f1-a472-21be9722e465",
                    "name": "Create a job",
                    "provider": "transform.job.create",
                    "summary": "Send to NO VERI*FACTU process event (bill/status)",
                    "config": {
                        "silo_entry_meta_key": "",
                        "workflow_id": ""
                    }
                }
            ],
            "rescue": [
                {
                    "id": "f6a7b8c0-0006-11f1-a000-000000000003",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `error`{.state .error}",
                    "config": {
                        "state": "error"
                    }
                }
            ]
        }
        ```
      </Accordion>
    </AccordionGroup>
  </Tab>

  <Tab title="Documents">
    <AccordionGroup>
      <Accordion title="Supplier">
        ```json Spain supplier example theme={"system"}
        {
          "$schema": "https://gobl.org/draft-0/org/party",
          "name": "Invopop S.L.",
          "tax_id": {
            "country": "ES",
            "code": "B85905495"
          },
            "people": [
                {
                    "name": {
                        "given": "Juan",
                        "surname": "Pérez González"
                    },
                    "identities": [
                        {
                            "key": "national",
                            "code": "123456789A"
                        }
                    ],
                    "addresses": [
                        {
                            "num": "10",
                            "street": "Calle Ejemplo",
                            "locality": "Madrid",
                            "region": "Madrid",
                            "code": "28020",
                            "country": "ES"
                        }
                    ]
                }
            ],
          "addresses": [
            {
              "num": "42",
              "street": "Calle Pradillo",
              "locality": "Madrid",
              "region": "Madrid",
              "code": "28002",
              "country": "ES"
            }
          ],
          "emails": [
            {
              "addr": "billing@example.com"
            }
          ]
        }
        ```
      </Accordion>
    </AccordionGroup>

    TicketBAI example documents

    <AccordionGroup>
      <Accordion title="B2B Invoice">
        In this example, we're issuing a standard B2B invoice from a Basque supplier to a customer in Madrid.

        Scenario details:

        * The supplier is based out of Bilbao in Bizkaia, using the sandbox data provided by TicketBAI.
        * The customer is in Madrid.
        * They're selling software development services with standard VAT.
        * The series for the invoice is "F1".

        Notice:

        * the minimal version (`ticketbai-b2b.min.mdx`) contains only the essential fields required to create the invoice,
        * we're applying the [`es-tbai-v1`](https://docs.gobl.org/addons/es-tbai-v1) addon to ensure GOBL's TicketBAI validation checks are applied,
        * there is no `currency` nor `issue_date`, as these will be assigned automatically,
        * there is no invoice `code` as this will be assigned by the workflow,
        * TicketBAI **requires** a general note, so we've added one at the bottom,
        * when running `gobl build`, the system automatically calculates totals, assigns the `$regime` to `ES`, sets the [`es-tbai-region`](https://docs.gobl.org/addons/es-tbai-v1#region-code) extension to `BI` (Bizkaia) based on the supplier's address, applies the standard VAT rate (21%), and assigns the [`es-tbai-product`](https://docs.gobl.org/addons/es-tbai-v1#ticketbai-product-key) extension to `services` based on the item unit,
        * the built version (`ticketbai-b2b.mdx`) shows the normalized document with calculated totals, line item sums, tax breakdowns, and automatically generated fields, and,
        * there are no totals or calculations in the minimal version; all these will be made automatically when uploading.

        <CodeGroup>
          ```json TicketBAI B2B Invoice theme={"system"}
          {
            "$schema": "https://gobl.org/draft-0/bill/invoice",
            "$addons": ["es-tbai-v1"],
            "series": "F1",
            "supplier": {
              "name": "HFPn5yhXZ9tdD4pHRbvwymaVPrGZQr",
              "tax_id": {
                "country": "ES",
                "code": "A99805194"
              },
              "addresses": [
                {
                  "num": "42",
                  "street": "San Frantzisko",
                  "locality": "Bilbo",
                  "region": "Bizkaia",
                  "code": "48003",
                  "country": "ES"
                }
              ],
              "emails": [
                {
                  "addr": "billing@example.com"
                }
              ]
            },
            "customer": {
              "name": "Receive One S.L.",
              "tax_id": {
                "country": "ES",
                "code": "B98602642"
              },
              "emails": [
                {
                  "addr": "billing@example.com"
                }
              ],
              "addresses": [
                {
                  "num": "42",
                  "street": "Calle Pradillo",
                  "locality": "Madrid",
                  "region": "Madrid",
                  "code": "28002",
                  "country": "ES"
                }
              ]
            },
            "lines": [
              {
                "quantity": "20",
                "item": {
                  "name": "Development services",
                  "price": "90.00",
                  "unit": "h"
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "rate": "standard"
                  }
                ]
              }
            ],
            "notes": [
              {
                "key": "general",
                "text": "Invoice for development services"
              }
            ]
          }
          ```

          ```json Built version theme={"system"}
          {
          	"$schema": "https://gobl.org/draft-0/bill/invoice",
          	"$regime": "ES",
          	"$addons": [
          		"es-tbai-v1"
          	],
          	"type": "standard",
          	"series": "F1",
          	"issue_date": "2026-07-08",
          	"currency": "EUR",
          	"tax": {
          		"ext": {
          			"es-tbai-region": "BI"
          		}
          	},
          	"supplier": {
          		"name": "HFPn5yhXZ9tdD4pHRbvwymaVPrGZQr",
          		"tax_id": {
          			"country": "ES",
          			"code": "A99805194"
          		},
          		"addresses": [
          			{
          				"num": "42",
          				"street": "San Frantzisko",
          				"locality": "Bilbo",
          				"region": "Bizkaia",
          				"code": "48003",
          				"country": "ES"
          			}
          		],
          		"emails": [
          			{
          				"addr": "billing@example.com"
          			}
          		]
          	},
          	"customer": {
          		"name": "Receive One S.L.",
          		"tax_id": {
          			"country": "ES",
          			"code": "B98602642"
          		},
          		"addresses": [
          			{
          				"num": "42",
          				"street": "Calle Pradillo",
          				"locality": "Madrid",
          				"region": "Madrid",
          				"code": "28002",
          				"country": "ES"
          			}
          		],
          		"emails": [
          			{
          				"addr": "billing@example.com"
          			}
          		]
          	},
          	"lines": [
          		{
          			"i": 1,
          			"quantity": "20",
          			"item": {
          				"name": "Development services",
          				"price": "90.00",
          				"unit": "h"
          			},
          			"sum": "1800.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "standard",
          					"rate": "general",
          					"percent": "21.0%",
          					"ext": {
          						"es-tbai-product": "services",
          						"es-tbai-regime": "01"
          					}
          				}
          			],
          			"total": "1800.00"
          		}
          	],
          	"totals": {
          		"sum": "1800.00",
          		"total": "1800.00",
          		"taxes": {
          			"categories": [
          				{
          					"code": "VAT",
          					"rates": [
          						{
          							"key": "standard",
          							"ext": {
          								"es-tbai-product": "services",
          								"es-tbai-regime": "01"
          							},
          							"base": "1800.00",
          							"percent": "21.0%",
          							"amount": "378.00"
          						}
          					],
          					"amount": "378.00"
          				}
          			],
          			"sum": "378.00"
          		},
          		"tax": "378.00",
          		"total_with_tax": "2178.00",
          		"payable": "2178.00"
          	},
          	"notes": [
          		{
          			"key": "general",
          			"text": "Invoice for development services"
          		}
          	]
          }
          ```
        </CodeGroup>
      </Accordion>

      <Accordion title="B2C Simplified Invoice">
        In this example, we're issuing a simplified B2C invoice from a Basque supplier for an in-person sale.

        Scenario details:

        * The supplier is based out of Bilbao in Bizkaia, using the sandbox data provided by TicketBAI.
        * There is no customer.
        * Physical goods are being sold with a standard VAT rate.
        * The series for the invoice is "FS1".

        Notice:

        * the minimal version (`ticketbai-b2c.min.mdx`) contains only the essential fields required to create the simplified invoice,
        * there is no `customer` object,
        * the `tax` object contains the `prices_include` value set to `VAT`, which will ensure all totals will be calculated assuming that prices include VAT,
        * the line item includes a [`es-tbai-product`](https://docs.gobl.org/addons/es-tbai-v1#ticketbai-product-key) extension with the value `goods`,
        * TicketBAI **requires** a general note, in this case we've added a generic message,
        * when running `gobl build`, the system automatically calculates the tax-included totals (splitting the €25.10 price into €20.74 base + €4.36 VAT), assigns the `$regime` to `ES`, sets the [`es-tbai-region`](https://docs.gobl.org/addons/es-tbai-v1#region-code) extension to `BI` (Bizkaia), applies the standard VAT rate (21%), and normalizes all fields,
        * the built version (`ticketbai-b2c.mdx`) shows the normalized document with calculated totals including tax-included calculations, line item sums, tax breakdowns, and automatically generated fields, and,
        * there are no totals or calculations in the minimal version; all these will be made automatically when uploading.

        <CodeGroup>
          ```json TicketBAI B2C Invoice theme={"system"}
          {
            "$schema": "https://gobl.org/draft-0/bill/invoice",
            "$addons": ["es-tbai-v1"],
            "$tags": ["simplified"],
            "series": "FS1",
            "tax": {
              "prices_include": "VAT"
            },
            "supplier": {
              "name": "HFPn5yhXZ9tdD4pHRbvwymaVPrGZQr",
              "tax_id": {
                "country": "ES",
                "code": "A99805194"
              },
              "addresses": [
                {
                  "num": "42",
                  "street": "San Frantzisko",
                  "locality": "Bilbo",
                  "region": "Bizkaia",
                  "code": "48003",
                  "country": "ES"
                }
              ],
              "emails": [
                {
                  "addr": "billing@example.com"
                }
              ]
            },
            "lines": [
              {
                "quantity": "1",
                "item": {
                  "name": "Advanced screwdriver set",
                  "price": "25.10",
                  "ext": {
                    "es-tbai-product": "goods"
                  }
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "rate": "standard"
                  }
                ]
              }
            ],
            "notes": [
              {
                "key": "general",
                "text": "In person sale"
              }
            ]
          }
          ```

          ```json Built version theme={"system"}
          {
          	"$schema": "https://gobl.org/draft-0/bill/invoice",
          	"$regime": "ES",
          	"$addons": [
          		"es-tbai-v1"
          	],
          	"$tags": [
          		"simplified"
          	],
          	"type": "standard",
          	"series": "FS1",
          	"issue_date": "2026-07-08",
          	"currency": "EUR",
          	"tax": {
          		"prices_include": "VAT",
          		"ext": {
          			"es-tbai-region": "BI",
          			"es-tbai-simplified": "S"
          		}
          	},
          	"supplier": {
          		"name": "HFPn5yhXZ9tdD4pHRbvwymaVPrGZQr",
          		"tax_id": {
          			"country": "ES",
          			"code": "A99805194"
          		},
          		"addresses": [
          			{
          				"num": "42",
          				"street": "San Frantzisko",
          				"locality": "Bilbo",
          				"region": "Bizkaia",
          				"code": "48003",
          				"country": "ES"
          			}
          		],
          		"emails": [
          			{
          				"addr": "billing@example.com"
          			}
          		]
          	},
          	"lines": [
          		{
          			"i": 1,
          			"quantity": "1",
          			"item": {
          				"name": "Advanced screwdriver set",
          				"price": "25.10",
          				"ext": {
          					"es-tbai-product": "goods"
          				}
          			},
          			"sum": "25.10",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "standard",
          					"rate": "general",
          					"percent": "21.0%",
          					"ext": {
          						"es-tbai-product": "services",
          						"es-tbai-regime": "01"
          					}
          				}
          			],
          			"total": "25.10"
          		}
          	],
          	"totals": {
          		"sum": "25.10",
          		"tax_included": "4.36",
          		"total": "20.74",
          		"taxes": {
          			"categories": [
          				{
          					"code": "VAT",
          					"rates": [
          						{
          							"key": "standard",
          							"ext": {
          								"es-tbai-product": "services",
          								"es-tbai-regime": "01"
          							},
          							"base": "20.74",
          							"percent": "21.0%",
          							"amount": "4.36"
          						}
          					],
          					"amount": "4.36"
          				}
          			],
          			"sum": "4.36"
          		},
          		"tax": "4.36",
          		"total_with_tax": "25.10",
          		"payable": "25.10"
          	},
          	"notes": [
          		{
          			"key": "general",
          			"text": "In person sale"
          		}
          	]
          }
          ```
        </CodeGroup>
      </Accordion>
    </AccordionGroup>

    Facturae example documents

    <AccordionGroup>
      <Accordion title="Facturae B2B Invoice">
        A standard Facturae invoice from a Spanish supplier to a Spanish business customer.

        Notice:

        * the [`es-facturae-v3`](https://docs.gobl.org/addons/es-facturae-v3) addon is required,
        * the `es-facturae-doc-type` and `es-facturae-invoice-class` tax extensions must be set,
        * both supplier and customer must have full address details and valid Spanish tax IDs.

        ```json Facturae B2G Invoice theme={"system"}

        {
        	"$schema": "https://gobl.org/draft-0/bill/invoice",
        	"$regime": "ES",
        	"$addons": [
        		"es-facturae-v3"
        	],
        	"uuid": "01922b1e-e288-7ab9-82f3-0c8c8c7956bc",
        	"type": "standard",
        	"code": "TEST01001F",
        	"issue_date": "2021-12-08",
        	"currency": "EUR",
        	"tax": {
        		"ext": {
        			"es-facturae-doc-type": "FC",
        			"es-facturae-invoice-class": "OO"
        		}
        	},
        	"supplier": {
        		"name": "Hypeprop Sl",
        		"alias": "Hypeprop",
        		"tax_id": {
        			"country": "ES",
        			"code": "B23103039"
        		},
        		"people": [
        			{
        				"name": {
        					"given": "Paloma",
        					"surname": "Araujo"
        				}
        			}
        		],
        		"addresses": [
        			{
        				"num": "74",
        				"street": "Campo Real",
        				"locality": "Torrejón De La Calzada",
        				"region": "Madrid",
        				"code": "28023",
        				"country": "ES"
        			}
        		],
        		"emails": [
        			{
        				"addr": "rxazy27xfc@iname.com"
        			}
        		],
        		"telephones": [
        			{
        				"label": "office",
        				"num": "+34910730028"
        			}
        		]
        	},
        	"customer": {
        		"name": "Moniward Sl",
        		"tax_id": {
        			"country": "ES",
        			"code": "B77436020"
        		},
        		"addresses": [
        			{
        				"num": "35",
        				"street": "Plaza Horno",
        				"locality": "Nombela",
        				"region": "Toledo",
        				"code": "45083",
        				"country": "ES"
        			}
        		],
        		"emails": [
        			{
        				"addr": "bfn25xf3p@lycos.co.uk"
        			}
        		]
        	},
        	"lines": [
        		{
        			"i": 1,
        			"quantity": "20",
        			"item": {
        				"name": "Operations and development - day rate",
        				"price": "200.00"
        			},
        			"sum": "4000.00",
        			"taxes": [
        				{
        					"cat": "VAT",
        					"rate": "standard",
        					"percent": "21.0%"
        				}
        			],
        			"total": "4000.00"
        		},
        		{
        			"i": 2,
        			"quantity": "2",
        			"item": {
        				"name": "Additional Overtime",
        				"price": "101.00"
        			},
        			"sum": "202.00",
        			"taxes": [
        				{
        					"cat": "VAT",
        					"rate": "standard",
        					"percent": "21.0%"
        				}
        			],
        			"total": "202.00"
        		}
        	],
        	"payment": {
        		"terms": {
        			"key": "due-date",
        			"due_dates": [
        				{
        					"date": "2021-12-30",
        					"amount": "5084.42",
        					"percent": "100%"
        				}
        			],
        			"notes": "Some kind of payment term note"
        		},
        		"instructions": {
        			"key": "credit-transfer",
        			"credit_transfer": [
        				{
        					"iban": "ES25 0188 2570 7185 4470 4761",
        					"name": "Bankrandom"
        				}
        			]
        		}
        	},
        	"totals": {
        		"sum": "4202.00",
        		"total": "4202.00",
        		"taxes": {
        			"categories": [
        				{
        					"code": "VAT",
        					"rates": [
        						{
        							"key": "standard",
        							"base": "4202.00",
        							"percent": "21.0%",
        							"amount": "882.42"
        						}
        					],
        					"amount": "882.42"
        				}
        			],
        			"sum": "882.42"
        		},
        		"tax": "882.42",
        		"total_with_tax": "5084.42",
        		"payable": "5084.42"
        	},
        	"notes": [
        		{
        			"key": "general",
        			"text": "Thank you for your custom!"
        		}
        	]
        }
        ```
      </Accordion>

      <Accordion title="Facturae Credit Note">
        A corrective invoice (credit note) referencing a previous Facturae invoice.

        Notice:

        * the `type` is set to `credit-note`,
        * a `preceding` entry references the original invoice with the `es-facturae-correction` code,
        * the `es-facturae-invoice-class` is set to `OR` (rectificativa).

        ```json Facturae Credit Note theme={"system"}
        {
        	"$schema": "https://gobl.org/draft-0/bill/invoice",
        	"$regime": "ES",
        	"$addons": [
        		"es-facturae-v3"
        	],
        	"uuid": "01922b1e-e283-7860-96aa-c57af9ffe67b",
        	"type": "credit-note",
        	"code": "TEST01001R",
        	"issue_date": "2021-12-08",
        	"currency": "EUR",
        	"preceding": [
        		{
        			"type": "standard",
        			"issue_date": "2021-12-08",
        			"code": "TEST01001F",
        			"ext": {
        				"es-facturae-correction": "01"
        			}
        		}
        	],
        	"tax": {
        		"ext": {
        			"es-facturae-doc-type": "FC",
        			"es-facturae-invoice-class": "OR"
        		}
        	},
        	"supplier": {
        		"name": "Hypeprop Sl",
        		"alias": "Hypeprop",
        		"tax_id": {
        			"country": "ES",
        			"code": "B23103039"
        		},
        		"people": [
        			{
        				"name": {
        					"given": "Paloma",
        					"surname": "Araujo"
        				}
        			}
        		],
        		"addresses": [
        			{
        				"num": "74",
        				"street": "Campo Real",
        				"locality": "Torrejón De La Calzada",
        				"region": "Madrid",
        				"code": "28023",
        				"country": "ES"
        			}
        		],
        		"emails": [
        			{
        				"addr": "rxazy27xfc@iname.com"
        			}
        		],
        		"telephones": [
        			{
        				"label": "office",
        				"num": "+34910730028"
        			}
        		]
        	},
        	"customer": {
        		"name": "Moniward Sl",
        		"tax_id": {
        			"country": "ES",
        			"code": "B77436020"
        		},
        		"addresses": [
        			{
        				"num": "35",
        				"street": "Plaza Horno",
        				"locality": "Nombela",
        				"region": "Toledo",
        				"code": "45083",
        				"country": "ES"
        			}
        		],
        		"emails": [
        			{
        				"addr": "bfn25xf3p@lycos.co.uk"
        			}
        		]
        	},
        	"lines": [
        		{
        			"i": 1,
        			"quantity": "20",
        			"item": {
        				"name": "Operations and development - day rate",
        				"price": "200.00"
        			},
        			"sum": "4000.00",
        			"taxes": [
        				{
        					"cat": "VAT",
        					"rate": "standard",
        					"percent": "21.0%"
        				}
        			],
        			"total": "4000.00"
        		},
        		{
        			"i": 2,
        			"quantity": "2",
        			"item": {
        				"name": "Additional Overtime",
        				"price": "101.00"
        			},
        			"sum": "202.00",
        			"taxes": [
        				{
        					"cat": "VAT",
        					"rate": "standard",
        					"percent": "21.0%"
        				}
        			],
        			"total": "202.00"
        		}
        	],
        	"totals": {
        		"sum": "4202.00",
        		"total": "4202.00",
        		"taxes": {
        			"categories": [
        				{
        					"code": "VAT",
        					"rates": [
        						{
        							"key": "standard",
        							"base": "4202.00",
        							"percent": "21.0%",
        							"amount": "882.42"
        						}
        					],
        					"amount": "882.42"
        				}
        			],
        			"sum": "882.42"
        		},
        		"tax": "882.42",
        		"total_with_tax": "5084.42",
        		"payable": "5084.42"
        	},
        	"notes": [
        		{
        			"key": "general",
        			"text": "Thank you for your custom!"
        		}
        	]
        }
        ```
      </Accordion>

      <Accordion title="Facturae FACe Invoice (with Administrative Centers)">
        An invoice addressed to a public administration via the FACe platform, including the three required DIR3 administrative centers.

        Notice:

        * the customer includes an identity with `scope: "tax"` for the **Oficina Contable** (DIR3 code `01`),
        * `delivery.receiver` includes the **Órgano Gestor** identity (DIR3 code `02`),
        * `ordering.buyer` includes the **Unidad Tramitadora** identity (DIR3 code `03`),
        * each public body publishes their DIR3 codes — look them up in the [DIR3 directory](https://administracionelectronica.gob.es/ctt/dir3).

        ```json Facturae FACe Invoice (B2G with Admin Centers) theme={"system"}
        {
        	"$schema": "https://gobl.org/draft-0/bill/invoice",
        	"$regime": "ES",
        	"$addons": [
        		"es-facturae-v3"
        	],
        	"type": "standard",
        	"code": "TEST01002F",
        	"issue_date": "2021-12-08",
        	"currency": "EUR",
        	"tax": {
        		"ext": {
        			"es-facturae-doc-type": "FC",
        			"es-facturae-invoice-class": "OO"
        		}
        	},
        	"supplier": {
        		"name": "Hypeprop Sl",
        		"alias": "Hypeprop",
        		"tax_id": {
        			"country": "ES",
        			"code": "B23103039"
        		},
        		"people": [
        			{
        				"name": {
        					"given": "Paloma",
        					"surname": "Araujo"
        				}
        			}
        		],
        		"addresses": [
        			{
        				"num": "74",
        				"street": "Campo Real",
        				"locality": "Torrejón De La Calzada",
        				"region": "Madrid",
        				"code": "28023",
        				"country": "ES"
        			}
        		],
        		"emails": [
        			{
        				"addr": "rxazy27xfc@iname.com"
        			}
        		],
        		"telephones": [
        			{
        				"label": "office",
        				"num": "+34910730028"
        			}
        		]
        	},
        	"customer": {
        		"name": "Ayuntamiento de Madrid",
        		"tax_id": {
        			"country": "ES",
        			"code": "P2807900B"
        		},
        		"identities": [
        			{
        				"scope": "tax",
        				"code": "L01280796"
        			}
        		],
        		"addresses": [
        			{
        				"num": "4",
        				"street": "Plaza de la Villa",
        				"locality": "Madrid",
        				"region": "Madrid",
        				"code": "28005",
        				"country": "ES"
        			}
        		],
        		"emails": [
        			{
        				"addr": "facturacion@madrid.es"
        			}
        		]
        	},
        	"delivery": {
        		"receiver": {
        			"name": "Concejalía de Hacienda",
        			"identities": [
        				{
        					"code": "LA0007407"
        				}
        			],
        			"addresses": [
        				{
        					"num": "3",
        					"street": "Calle Alcalá",
        					"locality": "Madrid",
        					"region": "Madrid",
        					"code": "28014",
        					"country": "ES"
        				}
        			]
        		}
        	},
        	"ordering": {
        		"buyer": {
        			"name": "Departamento de Compras",
        			"identities": [
        				{
        					"code": "LA0007408"
        				}
        			],
        			"addresses": [
        				{
        					"num": "10",
        					"street": "Gran Vía",
        					"locality": "Madrid",
        					"region": "Madrid",
        					"code": "28013",
        					"country": "ES"
        				}
        			]
        		}
        	},
        	"lines": [
        		{
        			"quantity": "20",
        			"item": {
        				"name": "Services rendered",
        				"price": "200.00"
        			},
        			"taxes": [
        				{
        					"cat": "VAT",
        					"rate": "standard"
        				}
        			]
        		}
        	],
        	"payment": {
        		"terms": {
        			"key": "due-date",
        			"due_dates": [
        				{
        					"date": "2021-12-30",
        					"amount": "4840.00",
        					"percent": "100%"
        				}
        			]
        		},
        		"instructions": {
        			"key": "credit-transfer",
        			"credit_transfer": [
        				{
        					"iban": "ES25 0188 2570 7185 4470 4761",
        					"name": "Bankrandom"
        				}
        			]
        		}
        	}
        }
        ```
      </Accordion>
    </AccordionGroup>

    SII example documents

    <AccordionGroup>
      <Accordion title="B2C Standard Invoice">
        Simplified invoices are used for B2C transactions when the customer is not a business. The transaction amount should be under €400 (VAT included) with some [exceptions](https://sede.agenciatributaria.gob.es/Sede/iva/facturacion-registro/facturacion-iva/tipos-factura.html) in which this threshold is increased to €3,000.

        Notice:

        * the minimal version (`sii-b2c.min.mdx`) contains only the essential fields required to create the simplified invoice,
        * to create a simplified SII invoice, include the `simplified` tag in your GOBL document with the [`es-sii-v1`](https://docs.gobl.org/addons/es-sii-v1) addon,
        * when running `gobl build`, the system automatically calculates totals, assigns the `$regime` to `ES`, sets the [`es-sii-doc-type`](https://docs.gobl.org/addons/es-sii-v1#invoice-type) extension to `F2` (Simplified invoice), applies the standard VAT rate (21%), and normalizes all fields,
        * the built version (`sii-b2c.mdx`) shows the normalized document with calculated totals, line item sums, tax breakdowns, and automatically generated fields, and,
        * there are no totals or calculations in the minimal version; all these will be made automatically when uploading.

        <CodeGroup>
          ```json SII B2C Invoice theme={"system"}
          {
            "$schema": "https://gobl.org/draft-0/bill/invoice",
            "$addons": [
              "es-sii-v1"
            ],
            "$tags": [
              "simplified"
            ],
            "series": "SAMPLE",
            "supplier": {
              "name": "Invopop S.L.",
              "tax_id": {
                "country": "ES",
                "code": "B85905495"
              },
              "addresses": [
                {
                  "num": "42",
                  "street": "Calle Pradillo",
                  "locality": "Madrid",
                  "region": "Madrid",
                  "code": "28002",
                  "country": "ES"
                }
              ],
              "emails": [
                {
                  "addr": "billing@example.com"
                }
              ]
            },
            "lines": [
              {
                "quantity": "20",
                "item": {
                  "name": "Development services",
                  "price": "90.00",
                  "unit": "h"
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "rate": "general"
                  }
                ]
              }
            ],
            "notes": [
              {
                "key": "general",
                "text": "This is a sample invoice with a standard tax"
              }
            ]
          }
          ```

          ```json Built version theme={"system"}
          {
          	"$schema": "https://gobl.org/draft-0/bill/invoice",
          	"$regime": "ES",
          	"$addons": [
          		"es-sii-v1"
          	],
          	"$tags": [
          		"simplified"
          	],
          	"type": "standard",
          	"series": "SAMPLE",
          	"issue_date": "2026-07-08",
          	"currency": "EUR",
          	"tax": {
          		"ext": {
          			"es-sii-doc-type": "F2"
          		}
          	},
          	"supplier": {
          		"name": "Invopop S.L.",
          		"tax_id": {
          			"country": "ES",
          			"code": "B85905495"
          		},
          		"addresses": [
          			{
          				"num": "42",
          				"street": "Calle Pradillo",
          				"locality": "Madrid",
          				"region": "Madrid",
          				"code": "28002",
          				"country": "ES"
          			}
          		],
          		"emails": [
          			{
          				"addr": "billing@example.com"
          			}
          		]
          	},
          	"lines": [
          		{
          			"i": 1,
          			"quantity": "20",
          			"item": {
          				"name": "Development services",
          				"price": "90.00",
          				"unit": "h"
          			},
          			"sum": "1800.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "standard",
          					"rate": "general",
          					"percent": "21.0%",
          					"ext": {
          						"es-sii-regime": "01"
          					}
          				}
          			],
          			"total": "1800.00"
          		}
          	],
          	"totals": {
          		"sum": "1800.00",
          		"total": "1800.00",
          		"taxes": {
          			"categories": [
          				{
          					"code": "VAT",
          					"rates": [
          						{
          							"key": "standard",
          							"ext": {
          								"es-sii-regime": "01"
          							},
          							"base": "1800.00",
          							"percent": "21.0%",
          							"amount": "378.00"
          						}
          					],
          					"amount": "378.00"
          				}
          			],
          			"sum": "378.00"
          		},
          		"tax": "378.00",
          		"total_with_tax": "2178.00",
          		"payable": "2178.00"
          	},
          	"notes": [
          		{
          			"key": "general",
          			"text": "This is a sample invoice with a standard tax"
          		}
          	]
          }
          ```
        </CodeGroup>
      </Accordion>

      <Accordion title="B2B Standard Invoice">
        Regular invoices are used for B2B transactions. Regular invoices must be issued when:

        * The customer is a registered business (has a tax identification number).
        * The transaction amount is €400 VAT included or above, or the customer requires a full invoice.
        * The customer needs a complete invoice with all tax details for accounting or tax purposes.

        Notice:

        * the minimal version (`sii-b2b.min.mdx`) contains only the essential fields required to create the standard B2B invoice,
        * to create a regular SII invoice, include the [`es-sii-v1`](https://docs.gobl.org/addons/es-sii-v1) addon and ensure the `customer` field contains valid tax identification details,
        * the `supplier` must be previously registered with the tax authority and the `customer` NIF or VAT ID must be valid,
        * when running `gobl build`, the system automatically calculates totals, assigns the `$regime` to `ES`, sets the [`es-sii-doc-type`](https://docs.gobl.org/addons/es-sii-v1#invoice-type) extension to `F1` (Standard invoice), applies the standard VAT rate (21%), and normalizes all fields,
        * the built version (`sii-b2b.mdx`) shows the normalized document with calculated totals, line item sums, tax breakdowns, and automatically generated fields, and,
        * there are no totals or calculations in the minimal version; all these will be made automatically when uploading.

        <CodeGroup>
          ```json SII B2B Invoice theme={"system"}
          {
            "$schema": "https://gobl.org/draft-0/bill/invoice",
            "$addons": [
              "es-sii-v1"
            ],
            "series": "SAMPLE",
            "supplier": {
              "name": "Invopop S.L.",
              "tax_id": {
                "country": "ES",
                "code": "B85905495"
              },
              "addresses": [
                {
                  "num": "42",
                  "street": "Calle Pradillo",
                  "locality": "Madrid",
                  "region": "Madrid",
                  "code": "28002",
                  "country": "ES"
                }
              ],
              "emails": [
                {
                  "addr": "billing@example.com"
                }
              ]
            },
            "customer": {
              "name": "Sample Consumer",
              "tax_id": {
                "country": "ES",
                "code": "B63272603"
              }
            },
            "lines": [
              {
                "quantity": "20",
                "item": {
                  "name": "Development services",
                  "price": "90.00",
                  "unit": "h"
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "rate": "general"
                  }
                ]
              }
            ]
          }
          ```

          ```json Built version theme={"system"}
          {
          	"$schema": "https://gobl.org/draft-0/bill/invoice",
          	"$regime": "ES",
          	"$addons": [
          		"es-sii-v1"
          	],
          	"type": "standard",
          	"series": "SAMPLE",
          	"issue_date": "2026-07-08",
          	"currency": "EUR",
          	"tax": {
          		"ext": {
          			"es-sii-doc-type": "F1"
          		}
          	},
          	"supplier": {
          		"name": "Invopop S.L.",
          		"tax_id": {
          			"country": "ES",
          			"code": "B85905495"
          		},
          		"addresses": [
          			{
          				"num": "42",
          				"street": "Calle Pradillo",
          				"locality": "Madrid",
          				"region": "Madrid",
          				"code": "28002",
          				"country": "ES"
          			}
          		],
          		"emails": [
          			{
          				"addr": "billing@example.com"
          			}
          		]
          	},
          	"customer": {
          		"name": "Sample Consumer",
          		"tax_id": {
          			"country": "ES",
          			"code": "B63272603"
          		}
          	},
          	"lines": [
          		{
          			"i": 1,
          			"quantity": "20",
          			"item": {
          				"name": "Development services",
          				"price": "90.00",
          				"unit": "h"
          			},
          			"sum": "1800.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "standard",
          					"rate": "general",
          					"percent": "21.0%",
          					"ext": {
          						"es-sii-regime": "01"
          					}
          				}
          			],
          			"total": "1800.00"
          		}
          	],
          	"totals": {
          		"sum": "1800.00",
          		"total": "1800.00",
          		"taxes": {
          			"categories": [
          				{
          					"code": "VAT",
          					"rates": [
          						{
          							"key": "standard",
          							"ext": {
          								"es-sii-regime": "01"
          							},
          							"base": "1800.00",
          							"percent": "21.0%",
          							"amount": "378.00"
          						}
          					],
          					"amount": "378.00"
          				}
          			],
          			"sum": "378.00"
          		},
          		"tax": "378.00",
          		"total_with_tax": "2178.00",
          		"payable": "2178.00"
          	}
          }
          ```
        </CodeGroup>
      </Accordion>

      <Accordion title="B2B Services EU Client (Reverse Charge)">
        Reverse charge invoices are used for B2B services provided to customers in other EU member states. Reverse charge must be applied when:

        * The customer is a registered business in another EU member state (has a valid EU VAT ID).
        * The service is provided to a business customer (B2B), not a consumer.
        * The service is subject to VAT but the customer accounts for the VAT in their own country.

        Notice:

        * the minimal version (`sii-b2b-services-eu.min.mdx`) contains only the essential fields required to create the reverse charge invoice,
        * to create a reverse charge SII invoice, use the tax key `reverse-charge` in your invoice lines,
        * you also need to set the items `key` to `services`, which will generate a breakdown by operation type required for this type of invoices,
        * with reverse charge, no VAT is charged by the supplier; the customer accounts for VAT in their own country,
        * the `supplier` must be previously registered with the tax authority and the `customer` VAT ID must be valid and registered in the EU VIES system,
        * when running `gobl build`, the system automatically sets the operation type to `S2` (Subject and Not Exempt - With reverse charge) when reporting the document to SII, applies the reverse charge tax treatment, and normalizes all fields,
        * the built version (`sii-b2b-services-eu.mdx`) shows the normalized document with the reverse charge configuration, operation type breakdown, and automatically generated fields, and,
        * there are no totals or calculations in the minimal version; all these will be made automatically when uploading.

        <CodeGroup>
          ```json SII B2B Invoice Services (EU) theme={"system"}
          {
            "$schema": "https://gobl.org/draft-0/bill/invoice",
            "$addons": [
              "es-sii-v1"
            ],
            "series": "SAMPLE",
            "supplier": {
              "name": "Invopop S.L.",
              "tax_id": {
                "country": "ES",
                "code": "B85905495"
              },
              "addresses": [
                {
                  "num": "42",
                  "street": "Calle Pradillo",
                  "locality": "Madrid",
                  "region": "Madrid",
                  "code": "28002",
                  "country": "ES"
                }
              ],
              "emails": [
                {
                  "addr": "billing@example.com"
                }
              ]
            },
            "customer": {
              "name": "Sample Consumer",
              "tax_id": {
                "country": "DE",
                "code": "111111125"
              }
            },
            "lines": [
              {
                "quantity": "20",
                "item": {
                  "key": "services",
                  "name": "Development services",
                  "price": "90.00",
                  "unit": "h"
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "key": "reverse-charge"
                  }
                ]
              }
            ],
            "notes": [
              {
                "key": "general",
                "text": "This is a sample invoice with reverse charge"
              }
            ]
          }
          ```

          ```json Built version theme={"system"}
          {
          	"$schema": "https://gobl.org/draft-0/bill/invoice",
          	"$regime": "ES",
          	"$addons": [
          		"es-sii-v1"
          	],
          	"type": "standard",
          	"series": "SAMPLE",
          	"issue_date": "2026-07-08",
          	"currency": "EUR",
          	"tax": {
          		"ext": {
          			"es-sii-doc-type": "F1"
          		}
          	},
          	"supplier": {
          		"name": "Invopop S.L.",
          		"tax_id": {
          			"country": "ES",
          			"code": "B85905495"
          		},
          		"addresses": [
          			{
          				"num": "42",
          				"street": "Calle Pradillo",
          				"locality": "Madrid",
          				"region": "Madrid",
          				"code": "28002",
          				"country": "ES"
          			}
          		],
          		"emails": [
          			{
          				"addr": "billing@example.com"
          			}
          		]
          	},
          	"customer": {
          		"name": "Sample Consumer",
          		"tax_id": {
          			"country": "DE",
          			"code": "111111125"
          		}
          	},
          	"lines": [
          		{
          			"i": 1,
          			"quantity": "20",
          			"item": {
          				"key": "services",
          				"name": "Development services",
          				"price": "90.00",
          				"unit": "h"
          			},
          			"sum": "1800.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "reverse-charge",
          					"ext": {
          						"es-sii-product": "services",
          						"es-sii-regime": "01"
          					}
          				}
          			],
          			"total": "1800.00"
          		}
          	],
          	"totals": {
          		"sum": "1800.00",
          		"total": "1800.00",
          		"taxes": {
          			"categories": [
          				{
          					"code": "VAT",
          					"rates": [
          						{
          							"key": "reverse-charge",
          							"ext": {
          								"es-sii-product": "services",
          								"es-sii-regime": "01"
          							},
          							"base": "1800.00",
          							"amount": "0.00"
          						}
          					],
          					"amount": "0.00"
          				}
          			],
          			"sum": "0.00"
          		},
          		"tax": "0.00",
          		"total_with_tax": "1800.00",
          		"payable": "1800.00"
          	},
          	"notes": [
          		{
          			"key": "general",
          			"text": "This is a sample invoice with reverse charge"
          		}
          	]
          }
          ```
        </CodeGroup>
      </Accordion>

      <Accordion title="B2B Goods EU Client (Intra-Community)">
        Intra-community supply invoices are used for B2B goods delivered to customers in other EU member states. Intra-community supplies must be applied when:

        * The customer is a registered business in another EU member state (has a valid EU VAT ID).
        * Goods are physically delivered to another EU member state.
        * The supply is exempt from VAT in the origin country (Spain) and subject to VAT in the destination country.

        Notice:

        * the minimal version (`sii-b2b-goods-eu.min.mdx`) contains only the essential fields required to create the intra-community supply invoice,
        * to create an intra-community supply SII invoice, use the tax key `intra-community` in your invoice lines,
        * you also need to set the items `key` to `goods`, which will report to SII a breakdown by operation type required for this type of invoices,
        * with intra-community supplies, no VAT is charged in Spain; the customer accounts for VAT in their destination country,
        * the `supplier` must be previously registered with the tax authority and the `customer` VAT ID must be valid and registered in the EU VIES system,
        * when running `gobl build`, the [`es-sii-v1`](https://docs.gobl.org/addons/es-sii-v1) addon automatically sets the [`es-sii-exempt`](https://docs.gobl.org/addons/es-sii-v1#exemption-reason) extension to `E5` ([Artículo 25 Ley de IVA](https://www.boe.es/eli/es/l/1992/12/28/37/con#a25)) and the [`es-sii-regime`](https://docs.gobl.org/addons/es-sii-v1#special-regime-or-relevance-key) extension to `02` (Export),
        * the built version (`sii-b2b-goods-eu.mdx`) shows the normalized document with the intra-community configuration, exemption codes, operation type breakdown, and automatically generated fields, and,
        * there are no totals or calculations in the minimal version; all these will be made automatically when uploading.

        <CodeGroup>
          ```json SII B2B Invoice Goods (EU) theme={"system"}
          {
            "$schema": "https://gobl.org/draft-0/bill/invoice",
            "$addons": [
              "es-sii-v1"
            ],
            "series": "SAMPLE",
            "supplier": {
              "name": "Invopop S.L.",
              "tax_id": {
                "country": "ES",
                "code": "B85905495"
              },
              "addresses": [
                {
                  "num": "42",
                  "street": "Calle Pradillo",
                  "locality": "Madrid",
                  "region": "Madrid",
                  "code": "28002",
                  "country": "ES"
                }
              ],
              "emails": [
                {
                  "addr": "billing@example.com"
                }
              ]
            },
            "customer": {
              "name": "Sample Consumer",
              "tax_id": {
                "country": "DE",
                "code": "111111125"
              }
            },
            "lines": [
              {
                "quantity": "20",
                "item": {
                  "key": "goods",
                  "name": "Goods",
                  "price": "90.00"
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "key": "intra-community",
                    "ext": {
                      "es-sii-regime": "02"
                    }
                  }
                ]
              }
            ],
            "notes": [
              {
                "key": "general",
                "text": "This is a sample invoice with a intra-community"
              }
            ]
          }

          ```

          ```json Built version theme={"system"}
          {
          	"$schema": "https://gobl.org/draft-0/bill/invoice",
          	"$regime": "ES",
          	"$addons": [
          		"es-sii-v1"
          	],
          	"type": "standard",
          	"series": "SAMPLE",
          	"issue_date": "2026-07-08",
          	"currency": "EUR",
          	"tax": {
          		"ext": {
          			"es-sii-doc-type": "F1"
          		}
          	},
          	"supplier": {
          		"name": "Invopop S.L.",
          		"tax_id": {
          			"country": "ES",
          			"code": "B85905495"
          		},
          		"addresses": [
          			{
          				"num": "42",
          				"street": "Calle Pradillo",
          				"locality": "Madrid",
          				"region": "Madrid",
          				"code": "28002",
          				"country": "ES"
          			}
          		],
          		"emails": [
          			{
          				"addr": "billing@example.com"
          			}
          		]
          	},
          	"customer": {
          		"name": "Sample Consumer",
          		"tax_id": {
          			"country": "DE",
          			"code": "111111125"
          		}
          	},
          	"lines": [
          		{
          			"i": 1,
          			"quantity": "20",
          			"item": {
          				"key": "goods",
          				"name": "Goods",
          				"price": "90.00"
          			},
          			"sum": "1800.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "intra-community",
          					"ext": {
          						"es-sii-exempt": "E5",
          						"es-sii-product": "goods",
          						"es-sii-regime": "02"
          					}
          				}
          			],
          			"total": "1800.00"
          		}
          	],
          	"totals": {
          		"sum": "1800.00",
          		"total": "1800.00",
          		"taxes": {
          			"categories": [
          				{
          					"code": "VAT",
          					"rates": [
          						{
          							"key": "intra-community",
          							"ext": {
          								"es-sii-exempt": "E5",
          								"es-sii-product": "goods",
          								"es-sii-regime": "02"
          							},
          							"base": "1800.00",
          							"amount": "0.00"
          						}
          					],
          					"amount": "0.00"
          				}
          			],
          			"sum": "0.00"
          		},
          		"tax": "0.00",
          		"total_with_tax": "1800.00",
          		"payable": "1800.00"
          	},
          	"notes": [
          		{
          			"key": "general",
          			"text": "This is a sample invoice with a intra-community"
          		}
          	]
          }
          ```
        </CodeGroup>
      </Accordion>

      <Accordion title="B2B Services No EU Client (Outside Scope)">
        Outside scope invoices are used for B2B services provided to customers outside the EU.

        Notice:

        * the minimal version (`sii-b2b-services-no-eu.min.mdx`) contains only the essential fields required to create the outside scope invoice,
        * to create an outside scope SII invoice, use the tax key `outside-scope` in your invoice lines,
        * services provided to non-EU customers are generally outside the scope of Spanish VAT,
        * the `supplier` must be previously registered with the tax authority; customer tax identification is optional but recommended for record-keeping purposes,
        * when running `gobl build`, the [`es-sii-v1`](https://docs.gobl.org/addons/es-sii-v1) addon automatically sets the [`es-sii-oot`](https://docs.gobl.org/addons/es-sii-v1#type-of-operation-outside-scope) extension to `location` and normalizes all fields,
        * the built version (`sii-b2b-services-no-eu.mdx`) shows the normalized document with the outside scope configuration and automatically generated fields, and,
        * there are no totals or calculations in the minimal version; all these will be made automatically when uploading.

        <CodeGroup>
          ```json Built example theme={"system"}
          {
            "$schema": "https://gobl.org/draft-0/bill/invoice",
            "$addons": [
              "es-sii-v1"
            ],
            "series": "SAMPLE",
            "supplier": {
              "name": "Invopop S.L.",
              "tax_id": {
                "country": "ES",
                "code": "B85905495"
              },
              "addresses": [
                {
                  "num": "42",
                  "street": "Calle Pradillo",
                  "locality": "Madrid",
                  "region": "Madrid",
                  "code": "28002",
                  "country": "ES"
                }
              ],
              "emails": [
                {
                  "addr": "billing@example.com"
                }
              ]
            },
            "customer": {
              "name": "Sample Consumer",
              "tax_id": {
                "country": "SG",
                "code": "201312345A"
              }
            },
            "lines": [
              {
                "quantity": "20",
                "item": {
                  "key": "services",
                  "name": "Development services",
                  "price": "90.00",
                  "unit": "h"
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "key": "outside-scope"
                  }
                ]
              }
            ],
            "notes": [
              {
                "key": "general",
                "text": "This is a sample invoice with a outside-scope tax"
              }
            ]
          }
          ```

          ```json Built version theme={"system"}
          {
          	"$schema": "https://gobl.org/draft-0/bill/invoice",
          	"$regime": "ES",
          	"$addons": [
          		"es-sii-v1"
          	],
          	"type": "standard",
          	"series": "SAMPLE",
          	"issue_date": "2026-07-08",
          	"currency": "EUR",
          	"tax": {
          		"ext": {
          			"es-sii-doc-type": "F1"
          		}
          	},
          	"supplier": {
          		"name": "Invopop S.L.",
          		"tax_id": {
          			"country": "ES",
          			"code": "B85905495"
          		},
          		"addresses": [
          			{
          				"num": "42",
          				"street": "Calle Pradillo",
          				"locality": "Madrid",
          				"region": "Madrid",
          				"code": "28002",
          				"country": "ES"
          			}
          		],
          		"emails": [
          			{
          				"addr": "billing@example.com"
          			}
          		]
          	},
          	"customer": {
          		"name": "Sample Consumer",
          		"tax_id": {
          			"country": "SG",
          			"code": "201312345A"
          		}
          	},
          	"lines": [
          		{
          			"i": 1,
          			"quantity": "20",
          			"item": {
          				"key": "services",
          				"name": "Development services",
          				"price": "90.00",
          				"unit": "h"
          			},
          			"sum": "1800.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "outside-scope",
          					"ext": {
          						"es-sii-outside-scope": "location",
          						"es-sii-product": "services",
          						"es-sii-regime": "01"
          					}
          				}
          			],
          			"total": "1800.00"
          		}
          	],
          	"totals": {
          		"sum": "1800.00",
          		"total": "1800.00",
          		"taxes": {
          			"categories": [
          				{
          					"code": "VAT",
          					"rates": [
          						{
          							"key": "outside-scope",
          							"ext": {
          								"es-sii-outside-scope": "location",
          								"es-sii-product": "services",
          								"es-sii-regime": "01"
          							},
          							"base": "1800.00",
          							"amount": "0.00"
          						}
          					],
          					"amount": "0.00"
          				}
          			],
          			"sum": "0.00"
          		},
          		"tax": "0.00",
          		"total_with_tax": "1800.00",
          		"payable": "1800.00"
          	},
          	"notes": [
          		{
          			"key": "general",
          			"text": "This is a sample invoice with a outside-scope tax"
          		}
          	]
          }
          ```
        </CodeGroup>
      </Accordion>

      <Accordion title="B2B Goods No EU Client (Export)">
        Export invoices are used for B2B goods delivered to customers outside the EU.

        Notice:

        * the minimal version (`sii-b2b-goods-no-eu.min.mdx`) contains only the essential fields required to create the export invoice,
        * to create an export SII invoice, use the tax key `export` in your invoice lines,
        * exported goods are exempt from Spanish VAT,
        * the `supplier` must be previously registered with the tax authority; customer tax identification is optional but recommended for record-keeping purposes,
        * when running `gobl build`, the [`es-sii-v1`](https://docs.gobl.org/addons/es-sii-v1) addon automatically sets the [`es-sii-exempt`](https://docs.gobl.org/addons/es-sii-v1#exemption-reason) extension to `E2` ([Artículo 21 Ley de IVA](https://www.boe.es/eli/es/l/1992/12/28/37/con#a21)) and the [`es-sii-regime`](https://docs.gobl.org/addons/es-sii-v1#special-regime-or-relevance-key) extension to `02` (Export),
        * the built version (`sii-b2b-goods-no-eu.mdx`) shows the normalized document with the export configuration, exemption codes, and automatically generated fields, and,
        * there are no totals or calculations in the minimal version; all these will be made automatically when uploading.

        <CodeGroup>
          ```json SII B2B Invoice Goods (No EU) theme={"system"}
          {
            "$schema": "https://gobl.org/draft-0/bill/invoice",
            "$addons": [
              "es-sii-v1"
            ],
            "series": "SAMPLE",
            "supplier": {
              "name": "Invopop S.L.",
              "tax_id": {
                "country": "ES",
                "code": "B85905495"
              },
              "addresses": [
                {
                  "num": "42",
                  "street": "Calle Pradillo",
                  "locality": "Madrid",
                  "region": "Madrid",
                  "code": "28002",
                  "country": "ES"
                }
              ],
              "emails": [
                {
                  "addr": "billing@example.com"
                }
              ]
            },
            "customer": {
              "name": "Sample Consumer",
              "tax_id": {
                "country": "SG",
                "code": "201312345A"
              }
            },
            "lines": [
              {
                "quantity": "20",
                "item": {
                  "key": "goods",
                  "name": "Goods",
                  "price": "90.00"
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "key": "export"
                  }
                ]
              }
            ],
            "notes": [
              {
                "key": "general",
                "text": "This is a sample invoice with an export"
              }
            ]
          }
          ```

          ```json Built version theme={"system"}
          {
          	"$schema": "https://gobl.org/draft-0/bill/invoice",
          	"$regime": "ES",
          	"$addons": [
          		"es-sii-v1"
          	],
          	"type": "standard",
          	"series": "SAMPLE",
          	"issue_date": "2026-07-08",
          	"currency": "EUR",
          	"tax": {
          		"ext": {
          			"es-sii-doc-type": "F1"
          		}
          	},
          	"supplier": {
          		"name": "Invopop S.L.",
          		"tax_id": {
          			"country": "ES",
          			"code": "B85905495"
          		},
          		"addresses": [
          			{
          				"num": "42",
          				"street": "Calle Pradillo",
          				"locality": "Madrid",
          				"region": "Madrid",
          				"code": "28002",
          				"country": "ES"
          			}
          		],
          		"emails": [
          			{
          				"addr": "billing@example.com"
          			}
          		]
          	},
          	"customer": {
          		"name": "Sample Consumer",
          		"tax_id": {
          			"country": "SG",
          			"code": "201312345A"
          		}
          	},
          	"lines": [
          		{
          			"i": 1,
          			"quantity": "20",
          			"item": {
          				"key": "goods",
          				"name": "Goods",
          				"price": "90.00"
          			},
          			"sum": "1800.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "export",
          					"ext": {
          						"es-sii-exempt": "E2",
          						"es-sii-product": "goods",
          						"es-sii-regime": "02"
          					}
          				}
          			],
          			"total": "1800.00"
          		}
          	],
          	"totals": {
          		"sum": "1800.00",
          		"total": "1800.00",
          		"taxes": {
          			"categories": [
          				{
          					"code": "VAT",
          					"rates": [
          						{
          							"key": "export",
          							"ext": {
          								"es-sii-exempt": "E2",
          								"es-sii-product": "goods",
          								"es-sii-regime": "02"
          							},
          							"base": "1800.00",
          							"amount": "0.00"
          						}
          					],
          					"amount": "0.00"
          				}
          			],
          			"sum": "0.00"
          		},
          		"tax": "0.00",
          		"total_with_tax": "1800.00",
          		"payable": "1800.00"
          	},
          	"notes": [
          		{
          			"key": "general",
          			"text": "This is a sample invoice with an export"
          		}
          	]
          }
          ```
        </CodeGroup>
      </Accordion>

      <Accordion title="B2B Exempt E1 Invoice">
        Exempt `E1` invoices are used for B2B transactions that are exempt from VAT pursuant ([Artículo 20 Ley de IVA](https://www.boe.es/eli/es/l/1992/12/28/37/con#a20)), which covers exemptions in internal operations.

        Notice:

        * the minimal version (`sii-exempt-E1.min.mdx`) contains only the essential fields required to create the exempt E1 invoice,
        * to create an exempt E1 SII invoice, use the tax key `exempt` in your invoice lines,
        * exempt operations are not subject to VAT but must still be reported,
        * the `supplier` must be previously registered with the tax authority and the `customer` NIF must be valid,
        * when running `gobl build`, the [`es-sii-v1`](https://docs.gobl.org/addons/es-sii-v1) addon automatically sets the [`es-sii-exempt`](https://docs.gobl.org/addons/es-sii-v1#exemption-reason) extension to `E1` and normalizes all fields,
        * the built version (`sii-exempt-E1.mdx`) shows the normalized document with the exempt E1 configuration and automatically generated fields, and,
        * there are no totals or calculations in the minimal version; all these will be made automatically when uploading.

        <CodeGroup>
          ```json SII B2B Exempt E1 Invoice theme={"system"}
          {
            "$schema": "https://gobl.org/draft-0/bill/invoice",
            "$addons": [
              "es-sii-v1"
            ],
            "series": "SAMPLE",
            "supplier": {
              "name": "Invopop S.L.",
              "tax_id": {
                "country": "ES",
                "code": "B85905495"
              },
              "addresses": [
                {
                  "num": "42",
                  "street": "Calle Pradillo",
                  "locality": "Madrid",
                  "region": "Madrid",
                  "code": "28002",
                  "country": "ES"
                }
              ],
              "emails": [
                {
                  "addr": "billing@example.com"
                }
              ]
            },
            "customer": {
              "name": "Sample Consumer",
              "tax_id": {
                "country": "ES",
                "code": "B63272603"
              }
            },
            "lines": [
              {
                "quantity": "20",
                "item": {
                  "name": "Development services",
                  "price": "90.00",
                  "unit": "h"
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "key": "exempt"
                  }
                ]
              }
            ],
            "notes": [
              {
                "key": "general",
                "text": "This is a sample invoice with a exempt tax"
              }
            ]
          }
          ```

          ```json Built version theme={"system"}
          {
          	"$schema": "https://gobl.org/draft-0/bill/invoice",
          	"$regime": "ES",
          	"$addons": [
          		"es-sii-v1"
          	],
          	"type": "standard",
          	"series": "SAMPLE",
          	"issue_date": "2026-07-08",
          	"currency": "EUR",
          	"tax": {
          		"ext": {
          			"es-sii-doc-type": "F1"
          		}
          	},
          	"supplier": {
          		"name": "Invopop S.L.",
          		"tax_id": {
          			"country": "ES",
          			"code": "B85905495"
          		},
          		"addresses": [
          			{
          				"num": "42",
          				"street": "Calle Pradillo",
          				"locality": "Madrid",
          				"region": "Madrid",
          				"code": "28002",
          				"country": "ES"
          			}
          		],
          		"emails": [
          			{
          				"addr": "billing@example.com"
          			}
          		]
          	},
          	"customer": {
          		"name": "Sample Consumer",
          		"tax_id": {
          			"country": "ES",
          			"code": "B63272603"
          		}
          	},
          	"lines": [
          		{
          			"i": 1,
          			"quantity": "20",
          			"item": {
          				"name": "Development services",
          				"price": "90.00",
          				"unit": "h"
          			},
          			"sum": "1800.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "exempt",
          					"ext": {
          						"es-sii-exempt": "E1",
          						"es-sii-regime": "01"
          					}
          				}
          			],
          			"total": "1800.00"
          		}
          	],
          	"totals": {
          		"sum": "1800.00",
          		"total": "1800.00",
          		"taxes": {
          			"categories": [
          				{
          					"code": "VAT",
          					"rates": [
          						{
          							"key": "exempt",
          							"ext": {
          								"es-sii-exempt": "E1",
          								"es-sii-regime": "01"
          							},
          							"base": "1800.00",
          							"amount": "0.00"
          						}
          					],
          					"amount": "0.00"
          				}
          			],
          			"sum": "0.00"
          		},
          		"tax": "0.00",
          		"total_with_tax": "1800.00",
          		"payable": "1800.00"
          	},
          	"notes": [
          		{
          			"key": "general",
          			"text": "This is a sample invoice with a exempt tax"
          		}
          	]
          }
          ```
        </CodeGroup>
      </Accordion>

      <Accordion title="B2C One-Stop-Shop Invoice">
        One-Stop-Shop (OSS) invoices are used for B2C distance sales of goods and services to consumers in other EU member states when the supplier is registered under the OSS scheme.

        Notice:

        * the minimal version (`sii-b2c-oss.min.mdx`) contains only the essential fields required to create the OSS invoice,
        * to create an OSS SII invoice, include the `simplified` tag in your GOBL document with the [`es-sii-v1`](https://docs.gobl.org/addons/es-sii-v1) addon,
        * OSS allows suppliers to register for VAT in one EU member state and account for VAT on all EU distance sales through that single registration,
        * the `supplier` must be previously registered with the tax authority and enrolled in the OSS scheme,
        * when running `gobl build`, the invoice will be treated as a simplified invoice ([`es-sii-doc-type`](https://docs.gobl.org/addons/es-sii-v1#invoice-type) extension set to `F2`) and VAT is accounted for through the OSS scheme in the destination country,
        * the built version (`sii-b2c-oss.mdx`) shows the normalized document with the OSS configuration and automatically generated fields, and,
        * there are no totals or calculations in the minimal version; all these will be made automatically when uploading.

        <CodeGroup>
          ```json SII B2C One Stop Shop Invoice theme={"system"}
          {
            "$schema": "https://gobl.org/draft-0/bill/invoice",
            "$addons": [
              "es-sii-v1"
            ],
            "$tags": [
              "simplified"
            ],
            "series": "SAMPLE",
            "supplier": {
              "name": "Invopop S.L.",
              "tax_id": {
                "country": "ES",
                "code": "B85905495"
              },
              "addresses": [
                {
                  "num": "42",
                  "street": "Calle Pradillo",
                  "locality": "Madrid",
                  "region": "Madrid",
                  "code": "28002",
                  "country": "ES"
                }
              ],
              "emails": [
                {
                  "addr": "billing@example.com"
                }
              ]
            },
            "lines": [
              {
                "quantity": "20",
                "item": {
                  "name": "Development services",
                  "price": "90.00",
                  "unit": "h"
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "rate": "general"
                  }
                ]
              }
            ],
            "notes": [
              {
                "key": "general",
                "text": "This is a sample invoice with a standard tax"
              }
            ]
          }
          ```

          ```json Built version theme={"system"}
          {
          	"$schema": "https://gobl.org/draft-0/bill/invoice",
          	"$regime": "ES",
          	"$addons": [
          		"es-sii-v1"
          	],
          	"$tags": [
          		"simplified"
          	],
          	"type": "standard",
          	"series": "SAMPLE",
          	"issue_date": "2026-07-08",
          	"currency": "EUR",
          	"tax": {
          		"ext": {
          			"es-sii-doc-type": "F2"
          		}
          	},
          	"supplier": {
          		"name": "Invopop S.L.",
          		"tax_id": {
          			"country": "ES",
          			"code": "B85905495"
          		},
          		"addresses": [
          			{
          				"num": "42",
          				"street": "Calle Pradillo",
          				"locality": "Madrid",
          				"region": "Madrid",
          				"code": "28002",
          				"country": "ES"
          			}
          		],
          		"emails": [
          			{
          				"addr": "billing@example.com"
          			}
          		]
          	},
          	"lines": [
          		{
          			"i": 1,
          			"quantity": "20",
          			"item": {
          				"name": "Development services",
          				"price": "90.00",
          				"unit": "h"
          			},
          			"sum": "1800.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "standard",
          					"rate": "general",
          					"percent": "21.0%",
          					"ext": {
          						"es-sii-regime": "01"
          					}
          				}
          			],
          			"total": "1800.00"
          		}
          	],
          	"totals": {
          		"sum": "1800.00",
          		"total": "1800.00",
          		"taxes": {
          			"categories": [
          				{
          					"code": "VAT",
          					"rates": [
          						{
          							"key": "standard",
          							"ext": {
          								"es-sii-regime": "01"
          							},
          							"base": "1800.00",
          							"percent": "21.0%",
          							"amount": "378.00"
          						}
          					],
          					"amount": "378.00"
          				}
          			],
          			"sum": "378.00"
          		},
          		"tax": "378.00",
          		"total_with_tax": "2178.00",
          		"payable": "2178.00"
          	},
          	"notes": [
          		{
          			"key": "general",
          			"text": "This is a sample invoice with a standard tax"
          		}
          	]
          }
          ```
        </CodeGroup>
      </Accordion>

      <Accordion title="B2C Hotel + IEET (Catalonia tourist tax)">
        The Catalan tourist tax (IEET, *Impost sobre les Estades en Establiments Turístics*) is a regional tax administered by the Agència Tributària de Catalunya — not the AEAT — so it is **not** reported as a tax to SII. Hotels declare it directly to the Generalitat through the quarterly Modelo 950.

        Notice:

        * model the IEET as a document-level [`charge`](https://docs.gobl.org/draft-0/bill/invoice#charge) with `key: "tax"`, which keeps it out of the VAT base while still appearing as a separate line on the guest's invoice as required by Art. 35 of Llei 5/2017,
        * do not model the IEET as a `VAT` tax line — it is a fixed amount per night, not a percentage, and the AEAT does not collect it,
        * the `reason` field on the charge is what the guest sees on the invoice; include the establishment type, location, nights, and rate so the breakdown is unambiguous,
        * accommodation is invoiced with reduced VAT (10%) on the room base; the IEET charge is added on top of `total_with_tax` to produce `payable`,
        * the quarterly Modelo 950 to the Generalitat is independent of individual invoices, but structuring the IEET as a typed charge lets hotels query their GOBL invoices for the data they need to file it.

        <CodeGroup>
          ```json B2C Hotel + IEET (Catalonia tourist tax) theme={"system"}
          {
            "$schema": "https://gobl.org/draft-0/bill/invoice",
            "$addons": [
              "es-sii-v1"
            ],
            "$tags": [
              "simplified"
            ],
            "series": "SAMPLE",
            "issue_date": "2026-05-06",
            "supplier": {
              "name": "Hotel Barcelona Example SL",
              "tax_id": {
                "country": "ES",
                "code": "B85905495"
              },
              "addresses": [
                {
                  "locality": "Barcelona",
                  "code": "08001",
                  "country": "ES"
                }
              ]
            },
            "lines": [
              {
                "quantity": "3",
                "item": {
                  "name": "Double room — 3 nights",
                  "price": "180.00",
                  "unit": "day"
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "rate": "reduced"
                  }
                ]
              }
            ],
            "charges": [
              {
                "key": "tax",
                "reason": "IEET — Hotel 4★, Barcelona city — 3 nights × 1 guest × €3.40",
                "amount": "10.20"
              }
            ]
          }
          ```

          ```json Built version theme={"system"}
          {
          	"$schema": "https://gobl.org/draft-0/bill/invoice",
          	"$regime": "ES",
          	"$addons": [
          		"es-sii-v1"
          	],
          	"$tags": [
          		"simplified"
          	],
          	"type": "standard",
          	"series": "SAMPLE",
          	"issue_date": "2026-05-06",
          	"currency": "EUR",
          	"tax": {
          		"ext": {
          			"es-sii-doc-type": "F2"
          		}
          	},
          	"supplier": {
          		"name": "Hotel Barcelona Example SL",
          		"tax_id": {
          			"country": "ES",
          			"code": "B85905495"
          		},
          		"addresses": [
          			{
          				"locality": "Barcelona",
          				"code": "08001",
          				"country": "ES"
          			}
          		]
          	},
          	"lines": [
          		{
          			"i": 1,
          			"quantity": "3",
          			"item": {
          				"name": "Double room — 3 nights",
          				"price": "180.00",
          				"unit": "day"
          			},
          			"sum": "540.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "standard",
          					"rate": "reduced",
          					"percent": "10.0%",
          					"ext": {
          						"es-sii-regime": "01"
          					}
          				}
          			],
          			"total": "540.00"
          		}
          	],
          	"charges": [
          		{
          			"i": 1,
          			"key": "tax",
          			"reason": "IEET — Hotel 4★, Barcelona city — 3 nights × 1 guest × €3.40",
          			"amount": "10.20"
          		}
          	],
          	"totals": {
          		"sum": "540.00",
          		"charge": "10.20",
          		"total": "550.20",
          		"taxes": {
          			"categories": [
          				{
          					"code": "VAT",
          					"rates": [
          						{
          							"key": "standard",
          							"ext": {
          								"es-sii-regime": "01"
          							},
          							"base": "540.00",
          							"percent": "10.0%",
          							"amount": "54.00"
          						}
          					],
          					"amount": "54.00"
          				}
          			],
          			"sum": "54.00"
          		},
          		"tax": "54.00",
          		"total_with_tax": "604.20",
          		"payable": "604.20"
          	}
          }
          ```
        </CodeGroup>
      </Accordion>
    </AccordionGroup>

    <AccordionGroup>
      <Accordion title="Credit Note">
        ```json SII Credit Note theme={"system"}
        {
          "$schema": "https://gobl.org/draft-0/bill/invoice",
          "$addons": [
            "es-sii-v1"
          ],
          "type": "credit-note",
          "series": "CN",
          "preceding": [
            {
              "type": "standard",
              "issue_date": "2025-11-13",
              "series": "SAMPLE",
              "code": "004"
            }
          ],
          "supplier": {
            "name": "Invopop S.L.",
            "tax_id": {
              "country": "ES",
              "code": "B85905495"
            },
            "addresses": [
              {
                "num": "42",
                "street": "Calle Pradillo",
                "locality": "Madrid",
                "region": "Madrid",
                "code": "28002",
                "country": "ES"
              }
            ],
            "emails": [
              {
                "addr": "billing@example.com"
              }
            ]
          },
          "customer": {
            "name": "Sample Consumer",
            "tax_id": {
              "country": "ES",
              "code": "B63272603"
            }
          },
          "lines": [
            {
              "quantity": "20",
              "item": {
                "name": "Development services",
                "price": "90.00",
                "unit": "h"
              },
              "taxes": [
                {
                  "cat": "VAT",
                  "rate": "general"
                }
              ]
            }
          ],
          "notes": [
            {
              "key": "general",
              "text": "This is a sample invoice with a standard tax"
            }
          ]
        }
        ```
      </Accordion>

      <Accordion title="Corrective Invoice">
        ```json SII Corrective Invoice theme={"system"}
        {
          "$schema": "https://gobl.org/draft-0/bill/invoice",
          "$addons": [
            "es-sii-v1"
          ],
          "type": "corrective",
          "series": "CO",
          "preceding": [
            {
              "type": "standard",
              "issue_date": "2024-11-13",
              "series": "SAMPLE",
              "code": "004",
              "tax": {
                "categories": [
                  {
                    "code": "VAT",
                    "rates": [
                      {
                        "key": "standard",
                        "ext": {
                          "es-sii-regime": "01"
                        },
                        "base": "1800.00",
                        "percent": "21.0%"
                      }
                    ]
                  }
                ]
              }
            }
          ],
          "supplier": {
            "name": "Invopop S.L.",
            "tax_id": {
              "country": "ES",
              "code": "B85905495"
            },
            "addresses": [
              {
                "num": "42",
                "street": "Calle Pradillo",
                "locality": "Madrid",
                "region": "Madrid",
                "code": "28002",
                "country": "ES"
              }
            ],
            "emails": [
              {
                "addr": "billing@example.com"
              }
            ]
          },
          "customer": {
            "name": "Sample Consumer",
            "tax_id": {
              "country": "ES",
              "code": "B63272603"
            }
          },
          "lines": [
            {
              "quantity": "20",
              "item": {
                "name": "Development services",
                "price": "90.00",
                "unit": "h"
              },
              "taxes": [
                {
                  "cat": "VAT",
                  "rate": "general"
                }
              ]
            }
          ],
          "notes": [
            {
              "key": "general",
              "text": "This is a sample invoice with a standard tax"
            }
          ]
        }
        ```
      </Accordion>
    </AccordionGroup>

    Copy and paste these documents into the [GOBL builder](https://build.gobl.org) in order to preview and verify them.
  </Tab>

  <Tab title="API Endpoints">
    The following API Endpoints are available when you enable this app:

    * [Verify Tax ID](/api-ref/apps/gov-es/lookup)
    * [Generate Agreement PDF](/api-ref/apps/gov-es/agreement-fetch)
    * [Upload Agreement PDF](/api-ref/apps/gov-es/agreement-upload)
    * [Upload Identity Image](/api-ref/apps/gov-es/identity-upload)
    * [Confirm](/api-ref/apps/gov-es/confirm)
  </Tab>
</Tabs>

***

<AccordionGroup>
  <Accordion title="🇪🇸 Invopop resources for Spain">
    |            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
    | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | Compliance | <Icon icon="https://assets.invopop.com/flags/es.svg" /> [Invoicing compliance in Spain](/compliance/spain)<br /> <Icon icon="timeline" /> [Compliance timeline](/timelines/spain)                                                                                                                                                                                                                                                                                                                   |
    | Apps       | <Icon icon="https://assets.invopop.com/apps/gov-es/icon.svg" /> [Spain](/apps/spain)<br /> <Icon icon="https://assets.invopop.com/apps/verifactu/icon.svg" /> [VERI\*FACTU Spain](/apps/verifactu-spain)<br /><Icon icon="https://assets.invopop.com/apps/ticketbai/icon.svg" /> [TicketBAI Spain](/apps/ticketbai-spain)                                                                                                                                                                           |
    | Guides     | <Icon icon="book" /> [Facturae Guide](/guides/es-facturae)<br /><Icon icon="book" /> [VERI\*FACTU Invoicing Guide](/guides/es-verifactu)<br /><Icon icon="book" /> [VERI\*FACTU Supplier Onboarding](/guides/es-verifactu-supplier)<br /><Icon icon="book" /> [SII Invoicing Guide](/guides/es-sii)<br /><Icon icon="book" /> [SII Supplier Onboarding](/guides/es-sii-supplier)<br /><Icon icon="book" /> [TicketBAI Guide](/guides/es-ticketbai)                                                  |
    | FAQ        | <Icon icon="square-question" /> [Spain FAQ](/faq/spain)                                                                                                                                                                                                                                                                                                                                                                                                                                             |
    | GOBL       | <Icon icon="https://assets.invopop.com/icons/gobl.svg" />  [Spain Tax Regime](https://docs.gobl.org/regimes/es)<br /> <Icon icon="https://assets.invopop.com/icons/gobl.svg" /> [VERI\*FACTU Addon](https://docs.gobl.org/addons/es-verifactu-v1)<br /> <Icon icon="https://assets.invopop.com/icons/gobl.svg" /> [Facturae Addon](https://docs.gobl.org/addons/es-facturae-v3)<br /> <Icon icon="https://assets.invopop.com/icons/gobl.svg" /> [SII Addon](https://docs.gobl.org/addons/es-sii-v1) |
    | GitHub     | <Icon icon="github" /> [gobl.facturae](https://github.com/invopop/gobl.facturae)<br /><Icon icon="github" /> [gobl.verifactu](https://github.com/invopop/gobl.verifactu)<br /> <Icon icon="github" /> [gobl.ticketbai](https://github.com/invopop/gobl.ticketbai)                                                                                                                                                                                                                                   |
  </Accordion>
</AccordionGroup>

<Card title="Participate in our community" icon="forumbee" href="https://community.invopop.com" arrow="true" horizontal>
  Ask and answer questions about the Spain App →
</Card>
