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

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-tbai-correction

Extensions

TicketBAI Region Code

Region codes are used by TicketBAI to differentiate between the different subdivisions of the Basque Country. This is used to determine the correct API endpoint to use when submitting documents.

TicketBAI Product Key

Product keys are used by TicketBAI to differentiate between -exported- goods and services. It may be useful to classify all products regardless of wether they are exported or not. There is an additional exception case for goods that are resold without modification when the supplier is in the simplified tax regime. For must purposes this special case can be ignored. If no product key is provided, the default is “services”.

TicketBAI Exemption code

Codes used by TicketBAI for both “exempt”, “not-subject”, and reverse charge transactions. In the TicketBAI format these are separated, but in order to simplify GOBL and be more closely aligned with other countries we’ve combined them into one. The follow mappings will be made automatically by GOBL during normalization.

TicketBAI Rectification Type Code

Corrected or rectified invoices that need to be sent in the TicketBAI format require a specific type code to be defined alongside the preceding invoice data.

TicketBAI VAT Regime Key

Identifies the VAT regime or operation classification applied to the transaction. Maps to the ClaveRegimenIvaOpTrascendencia field, with values taken from the TicketBAI XSD. The regime code is normally assigned per tax combo. If no regime code is provided, GOBL will try to assign a code from the following contexts:

Activity Code (Bizkaia)

Economic activity code (epígrafe) for individual issuers submitting through Bizkaia’s LROE Modelo 140 register. Not required for organisations, who file through Modelo 240.
Pattern: ^\d{1,7}$

Identity Type Code

Identity code used to identify the type of identity document used by the customer when there is no tax identifier available. Maps to the IDType value under IDOtro in the TicketBAI XML. 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 field with code 02.
  • Non-EU Tax IDs will be mapped to the IDOtro field with code 04.
The following identity key values will be mapped automatically to an extension by the addon: Example identity of a UK passport:
Will be normalized to:

TicketBAI Simplified Invoice Flag

Flag that maps to the FacturaSimplificada field in TicketBAI documents. Set automatically to S by GOBL during normalization when the simplified tag is present. When absent, the invoice is treated as N (not simplified).

Validation Rules