API > LROE - Cash accounting - COLLECTIONS - Query collections

LROE - Cash accounting - COLLECTIONS - Query collections

GET  https://{entorno}.ticketbaiws.eus/lroe-critcaja-cobros/

IMPORTANT: This method is only valid for BATUZ Bizkaia. Lets you query the collections sent to the Batuz LROE. All parameters except the fiscal year are optional (although at least one must be specified) and can be combined, for example to search for the collections made between two dates. This method is for companies or self-employed individuals under the special cash accounting scheme

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

ejercicio integer required
Fiscal year of the batch of collections, in yyyy format
2023
fecha_factura_desde string optional
Date of the full invoice in dd/mm/yyyy format
13/09/2023
fecha_factura_hasta string optional
Date of the full invoice in dd/mm/yyyy format
13/10/2023
fecha_operacion_desde string optional
Transaction date in dd/mm/yyyy format
13/09/2023
fecha_operacion_hasta string optional
Transaction date in dd/mm/yyyy format
13/10/2023
fecha_cobro_desde string optional
Collection date in dd/mm/yyyy format
13/09/2023
fecha_cobro_hasta string optional
Collection date in dd/mm/yyyy format
13/10/2023
tipo_ingreso string optional
When the operation has no invoice, and only for form 140 (self-employed individuals or entities without legal personality). Possible options:
1  - Temporary disability benefits
2 - Grants (subgroup 74)
3 - Financial income (subgroup 76)
4 - Extraordinary and other income (subgroups 73, 77 and 79)
02
num_factura string optional
Invoice number
2023715273
epigrafe integer optional, only for individuals (natural persons) in Bizkaia (LROE 140)
Indicates that the item belongs to a specific IAE activity code, different from the general one defined in the company profile or from the one defined on the invoice.
197210
estado string optional
Invoice status: Correcto, AceptadoConErrores, Incorrecto
Correcto
pagina integer optional
Page number of the paginated result.
1


GET https://{entorno}.ticketbaiws.eus/lroe-critcaja-cobros/
$ curl --request GET \
     --url https://api-test.ticketbaiws.eus/lroe-critcaja-cobros/ \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'Token: xxx' \
     --header 'Nif: 00000014Z'
	 --data '
{
    "ejercicio": 2023,
    "fecha_factura_desde": "01/06/2023",
    "fecha_factura_hasta": "01/10/2023",
	"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->lroeCriterioCajaCobros()->consultar([
    'ejercicio'           => 2023,
    'fecha_factura_desde' => '01/06/2023',
    'fecha_factura_hasta' => '01/10/2023',
    '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/lroe-critcaja-cobros/"
payload = {
    "ejercicio": 2023,
    "fecha_factura_desde": "01/06/2023",
    "fecha_factura_hasta": "01/10/2023",
	"pagina": 1
}

headers = {"Accept": "application/json", "Token" : "xxx", "Nif" : "00000014Z"}
response = requests.request("GET", url, json=payload, 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/lroe-critcaja-cobros/");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_GETFIELDS, '{"ejercicio": 2023,"fecha_factura_desde": "01/06/2023","fecha_factura_hasta": "01/10/2023","pagina": 1}');

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

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{"ejercicio": 2023,"fecha_factura_desde": "01/06/2023","fecha_factura_hasta": "01/10/2023","pagina": 1}');

Request request = new Request.Builder()
  .url("https://api-test.ticketbaiws.eus/lroe-critcaja-cobros/")
  .GET(body)
  .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": {
        "response": [
            {
                "fecha_factura": "29/11/2023",
                "fecha_cobro": "29/11/2023",
                "serie": "A",
                "num_factura": "2023000699",
                "importe_cobrado": "250.00",
                "iva_devengado": "52.50",
                "forma_pago": "01",
                "descripcion_fpago": "Transferencia",
                "estado": "Correcto"
            },
            {
                "fecha_factura": "29/11/2023",
                "fecha_cobro": "05/12/2023",
                "serie": "A",
                "num_factura": "2023000699",
                "importe_cobrado": "50.00",
                "iva_devengado": "10.50",
                "forma_pago": "04",
                "descripcion_fpago": "Otros medios de cobro o de pago",
                "estado": "Correcto"
            }
        ]
    },
    "msg": null
}

TicketBAI / Verifactu methods

Representation document

BATUZ BIZKAIA specific methods

SII (AEAT)

Customers and products (invoicing tool)

Other methods