Customers - Search / get customers
GET https://{entorno}.ticketbaiws.eus/clientes/
GET https://{entorno}.ticketbaiws.eus/clientes/{id}/
These are the customers and products of the company's invoicing tool in the private area. They are meant for looking up the customer and the products before issuing an invoice with POST /tbai/: the field names match those of the invoice (nombre, nif, pais_cliente, importe_unitario, tipo_iva, tipo_req...).
They do not depend on the environment: with the test token (api-test) you read and modify the same data as with the production token.
Searches customers by text (NIF, name, trade name, email or phone) or by exact NIF, or gets a single customer by its id. Each customer includes id, nif, tipo_documento, nombre, nombre_comercial, direccion, cp, poblacion, provincia, pais, pais_cliente (ISO-2), email, telefono, web and fecha_alta.
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
| buscar string optional Text to search for in NIF, name, trade name, email and phone | ejemplo |
| nif string optional Exact NIF (normalized) | B01000012 |
| pagina integer optional Page number, starting at 0 | 0 |
| cantidad integer optional Results per page. Default 50, maximum 250 | 50 |
The list returns the total number of results in count.
$ curl --request GET \
--url 'https://api-test.ticketbaiws.eus/clientes/?buscar=ejemplo&pagina=0&cantidad=50' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Token: xxx' \
--header 'Nif: 00000014Z'
$ composer require ticketbaiws/ticketbaiws-php
<?php
// Installation: composer require ticketbaiws/ticketbaiws-php
require 'vendor/autoload.php';
$tbai = new \TicketbaiWS\Client('xxx', '00000014Z', ['entorno' => 'test']);
// GET /clientes/ (paginated search)
$r = $tbai->clientes()->buscar('ejemplo', 0, 50);
// GET /clientes/?nif= (exact NIF)
// $r = $tbai->clientes()->porNif('B01000012');
// GET /clientes/{id}/
// $r = $tbai->clientes()->obtener(1532);
if ($r->isError()) {
echo $r->getMessageText();
} else {
print_r($r->getData());
}
$ python -m pip install requests
import requests
url = "https://api-test.ticketbaiws.eus/clientes/"
params = {"buscar": "ejemplo", "pagina": 0, "cantidad": 50}
headers = {"Accept": "application/json", "Token" : "xxx", "Nif" : "00000014Z"}
response = requests.request("GET", url, params=params, 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/clientes/?buscar=ejemplo&pagina=0&cantidad=50");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept: application/json");
headers = curl_slist_append(headers, "Content-Type: application/json");
headers = curl_slist_append(headers, "Token: xxx");
headers = curl_slist_append(headers, "Nif: 00000014Z");
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/clientes/?buscar=ejemplo&pagina=0&cantidad=50")
.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": [
{
"id": 1532,
"nif": "B01000012",
"tipo_documento": "02",
"nombre": "Empresa de ejemplo S.L.",
"nombre_comercial": "Ejemplo",
"direccion": "Calle Mayor 1",
"cp": "48001",
"poblacion": "Bilbao",
"provincia": "Bizkaia",
"pais": "España",
"pais_cliente": "ES",
"email": "facturas@ejemplo.com",
"telefono": "944000000",
"web": "https://www.ejemplo.com",
"fecha_alta": "28/11/2026"
}
],
"msg": "Showing 1 to 1 of 1",
"count": 1
}
HTTP/1.1 200 OK
{
"result": "OK",
"return": {
"id": 1532,
"nif": "B01000012",
"tipo_documento": "02",
"nombre": "Empresa de ejemplo S.L.",
"nombre_comercial": "Ejemplo",
"direccion": "Calle Mayor 1",
"cp": "48001",
"poblacion": "Bilbao",
"provincia": "Bizkaia",
"pais": "España",
"pais_cliente": "ES",
"email": "facturas@ejemplo.com",
"telefono": "944000000",
"web": "https://www.ejemplo.com",
"fecha_alta": "28/11/2026"
},
"msg": ""
}
HTTP/1.1 200 OK
{
"result": "ERROR",
"return": null,
"msg": "Client not found"
}
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
