API > LROE - Send expenses without invoice

LROE - Send expenses without invoice

POST  https://{entorno}.ticketbaiws.eus/lroe-gastos-sinfactura/

NOTE: This method is only valid for BATUZ Bizkaia and for Form 140 taxpayers (individuals carrying out an economic activity and income-attribution entities such as comunidades de bienes and sociedades civiles). It corresponds to section 2.2 of the LROE: expenses that are not documented by an invoice, such as self-employed social security contributions, bank fees or insurance.

Sends expenses without invoice to the Batuz LROE. Expenses already recorded as accepted are not sent again and are returned with the existe field. To change an expense already sent, use the PUT method.

PARAMETERS

ejercicio integer required
Fiscal year in yyyy format
2026
gastos object array required (max 1000) records
fecha_operacion string required
Date of the expense in dd/mm/yyyy format. It must fall within the given fiscal year.
30/09/2026
concepto string required
Accounting concept of the expense. Possible values:
600 Purchases of goods for resale, 601 Purchases of raw materials, 602 Other supplies, 606 Prompt-payment discounts on purchases, 607 Work performed by other companies, 608 Purchase returns, 609 Volume discounts (rappels) on purchases, 620 R&D expenses, 621 Leases and royalties, 622 Repairs and maintenance, 623 Independent professional services, 624 Transport, 625 Insurance premiums, 626 Banking and similar services, 627 Advertising, publicity and public relations, 628 Utilities, 629 / 631 Other services, 634 Negative adjustments to indirect taxation, 639 Positive adjustments to indirect taxation, 640 Wages and salaries, 641 Severance pay, 64201 Social security paid by the company: self-employed, 64202 Social security paid by the company: employees, 643 / 644 Long-term remuneration, 649 Other employee benefit expenses, 65 Other operating expenses, 66 Financial expenses, 67 Exceptional expenses, 680 / 681 / 682 Depreciation and amortization, 69 Impairment losses and other provisions
64201
epigrafe string optional
IAE activity code of the activity (max. 7 digits). If not given, the IAE activity code in the company profile is used.
165140
linea integer optional
Line number (1 to 99). Defaults to 1. Together with the date, the IAE activity code and the concept, it identifies the expense: if there are two expenses with the same date and the same concept, each one must have a different line.
1
importe decimal required
Amount of the expense for personal income tax (IRPF) purposes (2 decimals; may be negative).
294.00
nif string optional
NIF (Spanish tax ID) of the counterparty (supplier, bank, insurer...). If given, nombre_social is required.
B01000017
nombre_social string required if nif is given
Name or company name of the counterparty (max. 120 characters).
Banco de ejemplo S.A.
pais string optional
ISO-3166 Alpha-2 country code of the counterparty if it is foreign. Defaults to ES.
ES
tipo_documento string optional
ID document type of the foreign counterparty. Defaults to 02.
02 => NIF-IVA
03 => Passport
04 => Official identity document issued by the country or territory of residence
05 => Certificate of residence
06 => Other supporting document
02
referencia_bien string optional
Reference of the business asset the expense relates to (max. 10 characters).
LOCAL
referencia_catastral string optional
Fixed number (número fijo) or cadastral reference of the property (max. 25 characters).
1234567
territorio_alta_actividad string optional
Territory where the activity is registered: 1 Araba, 2 Bizkaia, 3 Gipuzkoa, 4 Navarra, 5 State (rest of Spain).
2
criterio_cobros_pagos boolean optional
Indicates whether the expense is allocated on a collections and payments (cash) basis.
false


POST https://{entorno}.ticketbaiws.eus/lroe-gastos-sinfactura/
$ curl --request POST \
     --url https://api-test.ticketbaiws.eus/lroe-gastos-sinfactura/ \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'Token: xxx' \
     --header 'Nif: 00000014Z' \
     --data '
{
    "ejercicio": 2026,
    "gastos": [
        {
            "fecha_operacion": "30/09/2026",
            "concepto": "64201",
            "importe": 294.0
        },
        {
            "fecha_operacion": "30/09/2026",
            "concepto": "626",
            "linea": 1,
            "importe": 12.5,
            "nif": "B01000017",
            "nombre_social": "Banco de ejemplo S.A."
        },
        {
            "fecha_operacion": "30/09/2026",
            "concepto": "626",
            "linea": 2,
            "importe": 3.2,
            "nif": "B01000017",
            "nombre_social": "Banco de ejemplo S.A."
        },
        {
            "fecha_operacion": "01/10/2026",
            "concepto": "625",
            "importe": 180.0,
            "epigrafe": "165140",
            "referencia_bien": "LOCAL",
            "criterio_cobros_pagos": false
        }
    ]
}'
$ 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->lroeGastosSinFactura()->alta([
    'ejercicio' => 2026,
    'gastos'    => [
        ['fecha_operacion' => '30/09/2026', 'concepto' => '64201', 'importe' => 294.0],
        ['fecha_operacion' => '30/09/2026', 'concepto' => '626', 'linea' => 1, 'importe' => 12.5, 'nif' => 'B01000017', 'nombre_social' => 'Banco de ejemplo S.A.'],
        ['fecha_operacion' => '30/09/2026', 'concepto' => '626', 'linea' => 2, 'importe' => 3.2, 'nif' => 'B01000017', 'nombre_social' => 'Banco de ejemplo S.A.'],
        ['fecha_operacion' => '01/10/2026', 'concepto' => '625', 'importe' => 180.0, 'epigrafe' => '165140', 'referencia_bien' => 'LOCAL', 'criterio_cobros_pagos' => false],
    ],
]);

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-gastos-sinfactura/"
payload = {
    "ejercicio": 2026,
    "gastos": [
        {
            "fecha_operacion": "30/09/2026",
            "concepto": "64201",
            "importe": 294.0
        },
        {
            "fecha_operacion": "30/09/2026",
            "concepto": "626",
            "linea": 1,
            "importe": 12.5,
            "nif": "B01000017",
            "nombre_social": "Banco de ejemplo S.A."
        },
        {
            "fecha_operacion": "30/09/2026",
            "concepto": "626",
            "linea": 2,
            "importe": 3.2,
            "nif": "B01000017",
            "nombre_social": "Banco de ejemplo S.A."
        },
        {
            "fecha_operacion": "01/10/2026",
            "concepto": "625",
            "importe": 180.0,
            "epigrafe": "165140",
            "referencia_bien": "LOCAL",
            "criterio_cobros_pagos": False
        }
    ]
}

headers = {"Accept": "application/json", "Token": "xxx", "Nif": "00000014Z"}
response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-test.ticketbaiws.eus/lroe-gastos-sinfactura/");

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);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, R"({"ejercicio":2026,"gastos":[{"fecha_operacion":"30/09/2026","concepto":"64201","importe":294.0},{"fecha_operacion":"30/09/2026","concepto":"626","linea":1,"importe":12.5,"nif":"B01000017","nombre_social":"Banco de ejemplo S.A."},{"fecha_operacion":"30/09/2026","concepto":"626","linea":2,"importe":3.2,"nif":"B01000017","nombre_social":"Banco de ejemplo S.A."},{"fecha_operacion":"01/10/2026","concepto":"625","importe":180.0,"epigrafe":"165140","referencia_bien":"LOCAL","criterio_cobros_pagos":false}]})");

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

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"ejercicio\":2026,\"gastos\":[{\"fecha_operacion\":\"30/09/2026\",\"concepto\":\"64201\",\"importe\":294.0},{\"fecha_operacion\":\"30/09/2026\",\"concepto\":\"626\",\"linea\":1,\"importe\":12.5,\"nif\":\"B01000017\",\"nombre_social\":\"Banco de ejemplo S.A.\"},{\"fecha_operacion\":\"30/09/2026\",\"concepto\":\"626\",\"linea\":2,\"importe\":3.2,\"nif\":\"B01000017\",\"nombre_social\":\"Banco de ejemplo S.A.\"},{\"fecha_operacion\":\"01/10/2026\",\"concepto\":\"625\",\"importe\":180.0,\"epigrafe\":\"165140\",\"referencia_bien\":\"LOCAL\",\"criterio_cobros_pagos\":false}]}");

Request request = new Request.Builder()
  .url("https://api-test.ticketbaiws.eus/lroe-gastos-sinfactura/")
  .post(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_operacion": "30/09/2026",
                "epigrafe": "165140",
                "concepto": "64201",
                "linea": 1,
                "estado": "Correcto"
            },
            {
                "fecha_operacion": "30/09/2026",
                "epigrafe": "165140",
                "concepto": "626",
                "linea": 1,
                "estado": "Correcto"
            },
            {
                "fecha_operacion": "30/09/2026",
                "epigrafe": "165140",
                "concepto": "626",
                "linea": 2,
                "estado": "Correcto"
            },
            {
                "fecha_operacion": "01/10/2026",
                "epigrafe": "165140",
                "concepto": "625",
                "linea": 1,
                "estado": "Incorrecto",
                "codigo_error": "B4_2000000",
                "descripcion_error": "Error description returned by Batuz."
            }
        ],
        "status": "ERROR"
    },
    "msg": ""
}

TicketBAI / Verifactu methods

Representation document

BATUZ BIZKAIA specific methods

SII (AEAT)

Customers and products (invoicing tool)

Other methods