Here you will find the TicketBai API documentation, the system analogous to VeriFactu for the Basque Country.
GET /ticketbai/healthAPI Status
This endpoint returns the API key status.
| Status | Description |
|---|---|
200 | API Status |
GET /ticketbai/statusRecord Status
This endpoint allows checking the current status of a previously submitted invoicing record.
| Status | Description |
|---|---|
200 | Record Status |
404 | Record not found |
500 | Server error |
POST /ticketbai/statusInvoice Status
This endpoint allows querying the status of an invoice as registered in our system.
| Field | Type | Required | Description |
|---|---|---|---|
serie | string | yes | Invoice series. |
numero | string | yes | Invoice number. |
fecha_expedicion | string | yes | Invoice issue date. Cannot be a date later than the current date. |
| Status | Description |
|---|---|
200 | Invoice Status |
500 | Server error |
POST /ticketbai/createCreate New Invoice
This endpoint creates a new invoicing record.
| Field | Type | Required | Description |
|---|---|---|---|
serie | string | yes | Invoice series. |
numero | string | yes | Invoice number. |
fecha_expedicion | string | yes | Invoice issue date. Cannot be a date later than the current date. |
descripcion | string | yes | Invoice description. |
simplificada | boolean | no | Indicates whether the invoice is simplified. |
nif | string | no | NIF of the client to whom the invoice is issued. |
id_otro | object | no | Identifier for an individual or legal entity other than the NIF. |
nombre | string | no | Full name or company name of the client to whom the invoice is issued. |
validar_destinatario | boolean | no | If 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. |
cp | string | no | Postal code of the client to whom the invoice is issued. |
direccion | string | no | Address of the client to whom the invoice is issued. |
sustitucion_simplificada | boolean | no | Indicates whether the invoice is issued as a replacement for a simplified invoice. |
tipo_operacion | string | no | Operation type. The different operation types are: <ol style="list-style: disc;"> <li>servicios: provision of services</li> <li>bienes: delivery of goods</li> |
lineas | array | yes | Invoice line items. |
desglose_iva | array | no | VAT breakdown. |
detalle_renta | array | no | Allowed and required only for individuals in Vizcaya. |
importe_total | string | yes | Total invoice amount. |
fecha_operacion | string | no | Operation date. |
rectificativa | object | no | Field containing the necessary data in case of a corrective invoice. |
rectificadas_sustituidas | array | no | Rectified or replaced invoices. |
no_sujeta | object | no | Indicates whether the invoice is not subject to VAT. |
exenta | object | no | Indicates whether the invoice is exempt. |
especial | object | no | This section contains additional optional fields. |
| Status | Description |
|---|---|
200 | Invoice created |
500 | Server error |
PUT /ticketbai/modifyModify 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.
| Field | Type | Required | Description |
|---|---|---|---|
accion | string | yes | Action 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. |
serie | string | yes | Invoice series. |
numero | string | yes | Invoice number. |
fecha_expedicion | string | yes | Invoice issue date. Cannot be a date later than the current date. |
descripcion | string | yes | Invoice description. |
simplificada | boolean | no | Indicates whether the invoice is simplified. |
nif | string | no | NIF of the client to whom the invoice is issued. |
id_otro | object | no | Identifier for an individual or legal entity other than the NIF. |
nombre | string | no | Full name or company name of the client to whom the invoice is issued. |
validar_destinatario | boolean | no | If 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. |
cp | string | no | Postal code of the client to whom the invoice is issued. |
direccion | string | no | Address of the client to whom the invoice is issued. |
sustitucion_simplificada | boolean | no | Indicates whether the invoice is issued as a replacement for a simplified invoice. |
tipo_operacion | string | no | Operation type. The different operation types are: <ol style="list-style: disc;"> <li>servicios: provision of services</li> <li>bienes: delivery of goods</li> |
lineas | array | yes | Invoice line items. |
desglose_iva | array | no | VAT breakdown. |
importe_total | string | yes | Total invoice amount. |
fecha_operacion | string | no | Operation date. |
rectificativa | object | no | Field containing the necessary data in case of a corrective invoice. |
rectificadas_sustituidas | array | no | Rectified or replaced invoices. |
no_sujeta | object | no | Indicates whether the invoice is not subject to VAT. |
exenta | object | no | Indicates whether the invoice is exempt. |
especial | object | no | This section contains additional optional fields. |
| Status | Description |
|---|---|
200 | Invoice modified |
500 | Server error |
POST /ticketbai/cancelCancel Invoice
This endpoint allows cancelling existing invoices.
| Field | Type | Required | Description |
|---|---|---|---|
serie | string | yes | Invoice series. |
numero | string | yes | Invoice number. |
fecha_expedicion | string | yes | Invoice issue date. Cannot be a date later than the current date. |
rechazo_previo | boolean | no | Parameter only available in Álava and Guipúzcoa indicating whether the invoice to be cancelled was previously rejected. |
| Status | Description |
|---|---|
200 | Invoice cancelled |
500 | Server error |
POST /ticketbai/listList 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.
| Field | Type | Required | Description |
|---|---|---|---|
rango_fecha_expedicion | object | yes | Date range of the invoice issue dates to query. |
serie | string | no | Invoice series. |
pagina | integer | no | This endpoint returns a maximum of 200 invoices per page. |
| Status | Description |
|---|---|
200 | Invoice list |
POST /ticketbai/exportExport XMLs
This endpoint allows exporting XML files in batches, both request and response, of invoices submitted to the tax authority.
| Field | Type | Required | Description |
|---|---|---|---|
ejercicio | string | yes | Fiscal year of the date on which the invoicing record was generated. |
periodo | string | yes | Period of the date on which the invoicing record was generated. |
token | string | no | Pagination token. |
| Status | Description |
|---|---|
200 | XML file list. |
POST /ticketbai/downloadXMLDownload XML
This endpoint allows downloading the XML files of invoices submitted through TicketBai.
| Field | Type | Required | Description |
|---|---|---|---|
serie | string | yes | Invoice series. |
numero | string | yes | Invoice number. |
| Status | Description |
|---|---|
200 | XML files |
500 | Server error |