Representation document - Download template
GET https://{entorno}.ticketbaiws.eus/doc-representante/modelo/
Downloads the representation document (authorization to act on the company's behalf) that allows Ticketbai WS to send the company's invoices in production. The template depends on the company's territory:
- Verifactu: representation document before the AEAT (Spanish Tax Agency).
- Bizkaia: Batuz form 140 (individual) or 240 (legal entity).
- Gipuzkoa: TicketBAI representation authorization.
Returns the PDF file in base 64, with the company and representative details already filled in.
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.
Companies in Araba: this method is not available, because in Araba the authorization is given by registering the device certificate (see instructions). It returns an error:
{"result": "ERROR", "return": null, "msg": "El documento de representación no está disponible para empresas de Araba. Registra el certificado de dispositivo de Ticketbai WS en la sede de la Diputación Foral de Álava."}PARAMETERS
| nombre_representante string required only for legal entities (Verifactu, Bizkaia and Gipuzkoa) Full name of the company representative who will digitally sign the document. | Juan Martínez Pérez |
| nif_representante string required only for legal entities (Verifactu, Bizkaia and Gipuzkoa) NIF (Spanish tax ID) of the company representative who will digitally sign the document. It must match the NIF of the digital signature. | 12345678Z |
| poblacion_representante string required only for legal entities in Verifactu Town/city of the company representative who will digitally sign the document. | Madrid |
| direccion_representante string required only for legal entities in Verifactu Address of the company representative who will digitally sign the document. | Calle Falsa 123 |
Individuals do not need to send any parameters: the document is filled in with the company details. In Bizkaia and Gipuzkoa poblacion_representante and direccion_representante are not used; if sent, they are ignored.
$ curl --request GET \
--url https://api-test.ticketbaiws.eus/doc-representante/modelo/ \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Token: xxx' \
--header 'Nif: 00000014Z'
--data '{"nombre_representante" : "Persona Representante","nif_representante" : "12345678Z","poblacion_representante" : "Madrid","direccion_representante" : "Calle Falsa 123"}'
$ 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->modeloDocRepresentante([
'nombre_representante' => 'Persona Representante',
'nif_representante' => '12345678Z',
'poblacion_representante' => 'Madrid',
'direccion_representante' => 'Calle Falsa 123',
]);
if ($r->isError()) {
echo $r->getMessageText();
} else {
file_put_contents('representacion.pdf', base64_decode($r->getData()));
}
$ python -m pip install requests
import requests
url = "https://api-test.ticketbaiws.eus/doc-representante/modelo/?nombre_representante=Persona Representante&nif_representante=12345678Z&poblacion_representante=Madrid&direccion_representante=Calle Falsa 123"
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/doc-representante/modelo/?nombre_representante=Persona Representante&nif_representante=12345678Z&poblacion_representante=Madrid&direccion_representante=Calle Falsa 123");
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/doc-representante/modelo/?nombre_representante=Persona Representante&nif_representante=12345678Z&poblacion_representante=Madrid&direccion_representante=Calle Falsa 123")
.get()
.addHeader("Accept", "application/json")
.addHeader("Token", "xxx")
.addHeader("Nif", "00000014Z")
.build();
Response response = client.newCall(request).execute();
HTTP/1.1 200 OK
{
"result": "OK",
"return": "JVBERi0xLjcNJeLjz9MNCjE1OSAwIG9iag08PC9MaW5lYXJpemVkIDEvTCAxMzQ0MTMwL08gMTYx...",
"msg": null
}
TicketBAI / Verifactu methods
- POST New invoice / resubmission (zuzendu) TicketBAI / Verifactu
- POST Complete a simplified invoice
- GET Get a TicketBAI / Verifactu invoice
- GET List TicketBAI / Verifactu invoices
- GET Download TicketBAI / Verifactu XML
- GET Download invoice in FacturaE format
- GET Download invoice as PDF
- GET System status
- DEL Cancel a TicketBAI / Verifactu invoice
- PUT Force TicketBAI / Verifactu resend
- POST Validate a NIF with the AEAT
- POST Validate a VAT number in VIES
Representation document
- GET Representation document - Download template
- POST Representation document - Upload document
- GET Representation document - Download uploaded document
- DELETE Representation document - Revoke uploaded document
BATUZ BIZKAIA specific methods
- GET List IAE activity codes
- POST LROE - Received invoices - Submit (BATUZ)
- PUT LROE - Received invoices - Update (BATUZ)
- GET LROE - Received invoices - Query (BATUZ)
- DEL LROE - Received invoices - Cancel (BATUZ)
- POST LROE - Expenses without invoice - Submit (BATUZ, form 140)
- PUT LROE - Expenses without invoice - Update (BATUZ, form 140)
- GET LROE - Expenses without invoice - Query (BATUZ, form 140)
- DEL LROE - Expenses without invoice - Cancel (BATUZ, form 140)
- POST LROE - Cash accounting COLLECTIONS - Submit (BATUZ)
- PUT LROE - Cash accounting COLLECTIONS - Update (BATUZ)
- GET LROE - Cash accounting COLLECTIONS - Query (BATUZ)
- DEL LROE - Cash accounting COLLECTIONS - Cancel (BATUZ)
- POST LROE - Cash accounting PAYMENTS - Submit (BATUZ)
- PUT LROE - Cash accounting PAYMENTS - Update (BATUZ)
- GET LROE - Cash accounting PAYMENTS - Query (BATUZ)
- DEL LROE - Cash accounting PAYMENTS - Cancel (BATUZ)
SII (AEAT)
Customers and products (invoicing tool)
- GET Customers - Search / get customers
- POST Customers - New customer
- PUT Customers - Update customer
- GET Products - Search / get products
