TicketBai API Documentation

  Here you will find the TicketBai API documentation, the system analogous to VeriFactu for the Basque Country.

Other

GET /ticketbai/health

API Status

This endpoint returns the API key status.

Responses

StatusDescription
200API Status

GET /ticketbai/status

Record Status

This endpoint allows checking the current status of a previously submitted invoicing record.

Responses

StatusDescription
200Record Status
404Record not found
500Server error

POST /ticketbai/status

Invoice Status

This endpoint allows querying the status of an invoice as registered in our system.

Request body

FieldTypeRequiredDescription
seriestringyesInvoice series.
numerostringyesInvoice number.
fecha_expedicionstringyesInvoice issue date. Cannot be a date later than the current date.

Responses

StatusDescription
200Invoice Status
500Server error

POST /ticketbai/create

Create New Invoice

This endpoint creates a new invoicing record.

Request body

FieldTypeRequiredDescription
seriestringyesInvoice series.
numerostringyesInvoice number.
fecha_expedicionstringyesInvoice issue date. Cannot be a date later than the current date.
descripcionstringyesInvoice description.
simplificadabooleannoIndicates whether the invoice is simplified.
nifstringnoNIF of the client to whom the invoice is issued.
id_otroobjectnoIdentifier for an individual or legal entity other than the NIF.
nombrestringnoFull name or company name of the client to whom the invoice is issued.
validar_destinatariobooleannoIf the `nif` field is included, we validate by default that it is registered at the AEAT, since if it is not, the Basque Regional Tax Authority will reject the submission.
cpstringnoPostal code of the client to whom the invoice is issued.
direccionstringnoAddress of the client to whom the invoice is issued.
sustitucion_simplificadabooleannoIndicates whether the invoice is issued as a replacement for a simplified invoice.
tipo_operacionstringnoOperation type. The different operation types are: <ol style="list-style: disc;"> <li>servicios: provision of services</li> <li>bienes: delivery of goods</li>
lineasarrayyesInvoice line items.
desglose_ivaarraynoVAT breakdown.
detalle_rentaarraynoAllowed and required only for individuals in Vizcaya.
importe_totalstringyesTotal invoice amount.
fecha_operacionstringnoOperation date.
rectificativaobjectnoField containing the necessary data in case of a corrective invoice.
rectificadas_sustituidasarraynoRectified or replaced invoices.
no_sujetaobjectnoIndicates whether the invoice is not subject to VAT.
exentaobjectnoIndicates whether the invoice is exempt.
especialobjectnoThis section contains additional optional fields.

Responses

StatusDescription
200Invoice created
500Server error

PUT /ticketbai/modify

Modify or Rectify Invoice

This endpoint has been enabled by the Basque tax authorities of Álava and Guipúzcoa for submitting information corresponding to the TicketBAI file that has been rejected and/or received with error warnings for not meeting the requirements and conditions established in the regulations governing the TicketBAI obligation.

Request body

FieldTypeRequiredDescription
accionstringyesAction to perform. The possible values are: <ol style="list-style: disc;"> <li> SUBSANAR: when needing to correct an invoice that has not been previously received by the corresponding tax authority in the system due to a creation error.
seriestringyesInvoice series.
numerostringyesInvoice number.
fecha_expedicionstringyesInvoice issue date. Cannot be a date later than the current date.
descripcionstringyesInvoice description.
simplificadabooleannoIndicates whether the invoice is simplified.
nifstringnoNIF of the client to whom the invoice is issued.
id_otroobjectnoIdentifier for an individual or legal entity other than the NIF.
nombrestringnoFull name or company name of the client to whom the invoice is issued.
validar_destinatariobooleannoIf the `nif` field is included, we validate by default that it is registered at the AEAT, since if it is not, the Basque Regional Tax Authority will reject the submission.
cpstringnoPostal code of the client to whom the invoice is issued.
direccionstringnoAddress of the client to whom the invoice is issued.
sustitucion_simplificadabooleannoIndicates whether the invoice is issued as a replacement for a simplified invoice.
tipo_operacionstringnoOperation type. The different operation types are: <ol style="list-style: disc;"> <li>servicios: provision of services</li> <li>bienes: delivery of goods</li>
lineasarrayyesInvoice line items.
desglose_ivaarraynoVAT breakdown.
importe_totalstringyesTotal invoice amount.
fecha_operacionstringnoOperation date.
rectificativaobjectnoField containing the necessary data in case of a corrective invoice.
rectificadas_sustituidasarraynoRectified or replaced invoices.
no_sujetaobjectnoIndicates whether the invoice is not subject to VAT.
exentaobjectnoIndicates whether the invoice is exempt.
especialobjectnoThis section contains additional optional fields.

Responses

StatusDescription
200Invoice modified
500Server error

POST /ticketbai/cancel

Cancel Invoice

This endpoint allows cancelling existing invoices.

Request body

FieldTypeRequiredDescription
seriestringyesInvoice series.
numerostringyesInvoice number.
fecha_expedicionstringyesInvoice issue date. Cannot be a date later than the current date.
rechazo_previobooleannoParameter only available in Álava and Guipúzcoa indicating whether the invoice to be cancelled was previously rejected.

Responses

StatusDescription
200Invoice cancelled
500Server error

POST /ticketbai/list

List Invoices

The Basque Country tax authorities have not enabled an invoice query service via API, therefore, this endpoint allows querying invoices submitted to the corresponding tax authority as they are recorded in our system.

Request body

FieldTypeRequiredDescription
rango_fecha_expedicionobjectyesDate range of the invoice issue dates to query.
seriestringnoInvoice series.
paginaintegernoThis endpoint returns a maximum of 200 invoices per page.

Responses

StatusDescription
200Invoice list

POST /ticketbai/export

Export XMLs

This endpoint allows exporting XML files in batches, both request and response, of invoices submitted to the tax authority.

Request body

FieldTypeRequiredDescription
ejerciciostringyesFiscal year of the date on which the invoicing record was generated.
periodostringyesPeriod of the date on which the invoicing record was generated.
tokenstringnoPagination token.

Responses

StatusDescription
200XML file list.

POST /ticketbai/downloadXML

Download XML

This endpoint allows downloading the XML files of invoices submitted through TicketBai.

Request body

FieldTypeRequiredDescription
seriestringyesInvoice series.
numerostringyesInvoice number.

Responses

StatusDescription
200XML files
500Server error