Skip to main content
Key: es-sii-v1 Module: github.com/invopop/gobl

Sources

Correction Definitions

Auto-generation of corrective invoices or credit and debit notes is supported.

Extension Keys

One or all of the following extensions may be required as part of the correction options. See the Extensions section for possible values.
  • es-sii-doc-type

Scenarios

bill/invoice

Filters:
  • Types: standard
Output:
  • Extensions: es-sii-doc-type:F1
Filters:
  • Types: standard
  • Tags: simplified
Output:
  • Extensions: es-sii-doc-type:F2
Filters:
  • Types: standard
  • Tags: replacement
Output:
  • Extensions: es-sii-doc-type:F3
Filters:
  • Types: corrective, credit-note, debit-note
  • Tags: simplified
Output:
  • Extensions: es-sii-doc-type:R5

Extensions

Invoice Type

Code used to identify the type of invoice being sent or received. This will be determined automatically by GOBL during normalization according to the scenario definitions. The following codes are not covered by GOBL’s scenarios and will need to be set manually if needed: F4, F5, F6, R2, R3, R4, AJ, LC. Maps to the TipoFactura field. Values correspond to the L2_EMI (issued invoices) and L2_RECI (received invoices) lists.

Corrective Invoice Type

Correction type code used to identify the type of correction being made. Code is determined automatically according to the invoice type: Maps to the TipoRectificativa field. Values correspond to the L5 list.

Exemption Reason

Exemption code used to explain why the operation is exempt from taxes. The follow mappings will be made automatically by GOBL during normalization: Maps to the field CausaExencion. Values correspond to the L9 list. Note: This extension is mutually exclusive with es-sii-outside-scope.

Type of Operation Outside Scope

Type of operation not subject to VAT. This extension is used to determine which tax amount field should be reported in the SII payload:
  • other will set the ImportePorArticulos7_14_Otros field.
  • location will set the ImporteTAIReglasLocalizacion field.
GOBL will attempt to automatically assign operation type codes based on tax key: Doesn’t map directly to any field. Used internally to determine how to report the tax amount. Note: This extension is mutually exclusive with es-sii-exempt.

Special Regime or Relevance Key

Identify the regime applied to the operation. The regime key must be assigned for each tax combo. If no regime key is provided, GOBL will try to assign a code from the following tax combo contexts: Maps to the field ClaveRegimenEspecialOTrascendencia. Values correspond to the L3.1 (issued invoices) and L3.2 (received invoices) lists.

Identification Type

Identity code used to identify the type of identity document used by the customer. The regular Party Tax Identity is preferred over using a specific identity type code, and will be mapped automatically as follows:
  • Spanish Tax IDs will be mapped to the NIF field.
  • EU Tax IDs will be mapped to the IDOtro\IDType field with code 02.
  • Non-EU Tax IDs will be mapped to the IDOtro\IDType field with code 04.
SII will perform validation on both Spanish and EU Tax IDs, so it is important to provide the correct details. The following identity key values will be mapped automatically to an extension by the addon: The 07 “not registered in census” code is not mapped automatically, but can be provided directly if needed. Example identity of a UK passport:
Will be normalized to:
Maps to the field IDOtro\IDType. Values correspond to the L4 list.

Simplified Invoice Art. 7.2 and 7.3, RD 1619/2012

This extension covers a specific use-case when the customer specifically requests that the invoice includes their fiscal details, but they are not registered for tax. Can only be true when the invoice type (TipoFactura) is one of: F1, F3, R1, R2, R3, or R4. Maps to the FacturaSimplificadaArticulos7.2_7.3 field. Values correspond to the L26 list.

Issued by Third Party or Recipient

Indicates whether the invoice is issued by a third party or by the customer themselves. The default value is N (No). The self-billed tag will automatically set this extension in the invoice to S (Yes). If the issuer field is set in the invoice’s ordering section, then this extension will be set to S (Yes) too. Maps to the field EmitidaPorTercerosODestinatario. Values correspond to the L10 list.

Product Type

Product type code used to differentiate between goods and services for the purpose of reporting breakdowns in the SII format. This extension is used to determine the type of operation breakdown when generating the SII report. When provided, the value will be used to generate the DesgloseTipoOperacion field, selecting between PrestacionServices (provision of services) or Entrega (delivery of goods). This extension is optional; if not provided, the breakdown will use DesgloseFactura instead of DesgloseTipoOperacion. Doesn’t map directly to any field. Used internally to structure the breakdown data.

Validation Rules