API > Download in FacturaE format

Download in FacturaE format

GET  https://{entorno}.ticketbaiws.eus/facturae/

This method returns, in FacturaE v3.2 format (Base64-encoded), an invoice previously sent to TicketBAI through Ticketbai WS. For the invoice to be digitally signed, a valid digital certificate of the company must be provided to sign it.

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

serie string required
Invoice series
A
numero string required
Invoice number
2022000123
cod_organo_gestor string optional
Managing body code (órgano gestor)
A01021700
cod_unidad_tramitadora string optional
Processing unit code (unidad tramitadora)
A01021700
cod_oficina_contable string optional
Accounting office code (oficina contable)
A01021700

GET https://{entorno}.ticketbaiws.eus/facturae/
$ curl --request GET \
     --url https://api.ticketbaiws.eus/facturae/ \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'Token: xxx' \
     --header 'Nif: 00000014Z'
	 --data '{"serie":"A","numero":"2021000123"}'
$ composer require ticketbaiws/ticketbaiws-php
<?php
// Installation: composer require ticketbaiws/ticketbaiws-php
require 'vendor/autoload.php';

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

$r = $tbai->facturae('A', '2021000123');

if ($r->isError()) {
    echo $r->getMessageText();
} else {
    file_put_contents('facturae.xml', base64_decode($r->getData()));
}
$ python -m pip install requests
import requests

url = "https://api.ticketbaiws.eus/facturae/"
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.ticketbaiws.eus/facturae/");

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.ticketbaiws.eus/facturae/?serie=A&numero=2021000123")
  .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": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGZlOkZhY3R1cmFlIHhtbG5zOmRzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjIiB4bWxuczpmZT0iaHR0cDovL3d3dy5mYWN0dXJhZS5lcy9GYWN0dXJhZS8yMDA5L3YzLjIvRmFjdHV ...", 
	"msg": null 
}

TicketBAI / Verifactu methods

Representation document

BATUZ BIZKAIA specific methods

SII (AEAT)

Customers and products (invoicing tool)

Other methods