API > Listado facturas TicketBAI

Listado facturas TicketBAI

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

Este método devuelve el listado de facturas TicketBAI generadas entre dos fechas. El número máximo de resultados es de 250, en caso de que haya más se deberá usar el parámetro de paginado.

PARÁMETROS

fecha_inicio string obligatorio
Fecha inicio desde la cual realizar la consulta en formato DD/MM/YYYY
01/10/2021
fecha_fin string obligatorio
Fecha fin hasta la cual realizar la consulta en formato DD/MM/YYYY
31/12/2021
serie string opcional
Facturas de una serie concreta
A2023
pagina integer opcional
Página para ir recorriendo los resultados paginados
1
json_orig boolean opcional
Incluir en los resultados el JSON de la solicitud de la factura
false
xml_request boolean opcional
Incluir en los resultados el XML generado en la solicitud a la hacienda foral
false
pedido boolean opcional
Incluir en los resultados el XML el número de pedido (variable: pedido) realizada en el envío del JSON la factura
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 guzzlehttp/guzzle
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-test.ticketbaiws.eus/tbai-list/', [
  'body' => '{"fecha_inicio": "01\/10\/2021","fecha_fin": "31\/12\/2021","pagina":1}',
  'headers' => [
    'Accept' => 'application/json',
    'Content-Type' => 'application/json',
    'Token' => 'xxx',
    'Nif' => '00000014Z'
  ],
]);

echo $response->getBody();
$ 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,
            "msg" : null
		},
		{
            "status" : "OK",
			"serie" : "A",
			"numero" : "2021000123",
			"fecha" : "01\/10\/2021",
			"fecha_factura" : "01\/10\/2021",
			"nif" : "B01000012",
			"importe" : 132.10,
            "msg" : null
		},
		{
            "status" : "OK",
			"serie" : "A",
			"numero" : "2021000123",
			"fecha" : "01\/10\/2021",
			"fecha_factura" : "01\/10\/2021",
			"nif" : "B01000012",
			"importe" : 132.10,
            "msg" : null
		},
		{
            "status" : "OK",
			"serie" : "A",
			"numero" : "2021000123",
			"fecha" : "01\/10\/2021",
			"fecha_factura" : "01\/10\/2021",
			"nif" : "B01000012",
			"importe" : 132.10,
            "msg" : null
		}
	],
	"msg": "Showing 251 to 500 of 785"
}