API > List TicketBAI invoices

List TicketBAI invoices

GET  https://{entorno}.ticketbaiws.eus/tbai-list/

This method returns the list of TicketBAI invoices generated between two dates. The maximum number of results is 250; if there are more, use the pagination parameter.

GET methods accept the parameters either in the body as a JSON payload or as a query string in the URL, as shown in the cURL example.

PARAMETERS

fecha_inicio string required
Start date of the query range, in DD/MM/YYYY format
01/10/2021
fecha_fin string required
End date of the query range, in DD/MM/YYYY format
31/12/2021
serie string optional
Only invoices from a specific series
A2023
pagina integer optional
Page number for iterating through paginated results. Results are limited
to 250 per page. The count parameter always returns the total number of results found, and the pagina parameter lets you page through and retrieve all of them
1
json_orig boolean optional
Include the invoice request JSON in the results
false
xml_request boolean optional
Include in the results the XML generated for the request to the provincial tax authority (Hacienda Foral)
false
pedido boolean optional
Include in the results the order number (variable: pedido) sent in the invoice JSON
false

GET https://{entorno}.ticketbaiws.eus/tbai-list/
$ curl --request GET \
     --url https://api-test.ticketbaiws.eus/tbai-list/ \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'Token: xxx' \
     --header 'Nif: 00000014Z'
	 --data '{"fecha_inicio": "01\/10\/2021","fecha_fin": "31\/12\/2021","pagina":1}'
$ composer require ticketbaiws/ticketbaiws-php
<?php
// Installation: composer require ticketbaiws/ticketbaiws-php
require 'vendor/autoload.php';

$tbai = new \TicketbaiWS\Client('xxx', '00000014Z', ['entorno' => 'test']);

$r = $tbai->listarFacturas([
    'fecha_inicio' => '01/10/2021',
    'fecha_fin'    => '31/12/2021',
    'pagina'       => 1,
]);

if ($r->isError()) {
    echo $r->getMessageText();
} else {
    print_r($r->getData());
}
$ python -m pip install requests
import requests

url = "https://api-test.ticketbaiws.eus/tbai-list/?fecha_inicio=01/01/2022&fecha_fin=31/12/2022&pagina=1"
headers = {"Accept": "application/json", "Token" : "xxx", "Nif" : "00000014Z"}
response = requests.request("GET", url, headers=headers)
print(response.text)
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-test.ticketbaiws.eus/tbai-list/?fecha_inicio=01/01/2022&fecha_fin=31/12/2022&pagina=1");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-test.ticketbaiws.eus/tbai-list/?fecha_inicio=01/01/2022&fecha_fin=31/12/2022&pagina=1")
  .get()
  .addHeader("Accept", "application/json")
  .addHeader("Token", "xxx")
  .addHeader("Nif", "00000014Z")
  .build();
  
Response response = client.newCall(request).execute();
{ } Response JSON
HTTP/1.1 200 OK
{ 
	"result": "OK", 
	"return": [
		{
            "status" : "OK",
			"serie" : "A",
			"numero" : "2021000123",
			"fecha" : "01\/10\/2021",
			"fecha_factura" : "01\/10\/2021",
			"nif" : "B01000012",
			"importe" : 132.10,
            "zuzendu" : false
		},
		{
            "status" : "OK",
			"serie" : "A",
			"numero" : "2021000123",
			"fecha" : "01\/10\/2021",
			"fecha_factura" : "01\/10\/2021",
			"nif" : "B01000012",
			"importe" : 132.10,
            "zuzendu" : false
		},
		{
            "status" : "OK",
			"serie" : "A",
			"numero" : "2021000123",
			"fecha" : "01\/10\/2021",
			"fecha_factura" : "01\/10\/2021",
			"nif" : "B01000012",
			"importe" : 132.10,
            "zuzendu" : false
		},
		{
            "status" : "OK",
			"serie" : "A",
			"numero" : "2021000123",
			"fecha" : "01\/10\/2021",
			"fecha_factura" : "01\/10\/2021",
			"nif" : "B01000012",
			"importe" : 132.10,
            "zuzendu" : false
		}
	],
    "msg": "Showing 1 to 250 of 292",
    "count": "292"
}

TicketBAI / Verifactu methods

Representation document

BATUZ BIZKAIA specific methods

SII (AEAT)

Customers and products (invoicing tool)

Other methods