API > LROE - Cash accounting - PAYMENTS - Send payments

LROE - Cash accounting - PAYMENTS - Send payments

POST  https://{entorno}.ticketbaiws.eus/lroe-critcaja-pagos/

IMPORTANT: This method is only valid for BATUZ Bizkaia. Lets you send the payments made to the Batuz LROE. This method is for companies or self-employed individuals under the special cash accounting scheme

PARAMETERS

ejercicio integer required
Fiscal year of the batch of payments, in yyyy format
2023
pagos object array required (max 1000) records
epigrafe string optional
For form 140 (self-employed individuals or entities without legal personality), if the IAE activity code differs from the main one predefined in the company profile
197210
fecha_pago string required
Date on which the payment was made, in dd/mm/yyyy format
13/11/2023
tipo_operacion string required for form 140
Payment for an operation with or without an invoice. Possible values:
con_factura , sin_factura
con_factura
nif string required
NIF (Spanish tax ID) of the invoice issuer
B01000012
pais string optional
Two-letter country code of the invoice issuer if the supplier's tax ID is foreign (ISO-3166 Alpha-2 code format)
ES
tipo_documento string optional
Type of identification document of a foreign supplier (when pais is not ES). Defaults to 02.
Possible values:
02 => VAT ID (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
nombre_social string required
Company name of the supplier issuing the invoice
Empresa de ejemplo S.L.
serie string optional for operations WITH invoice
Series of the invoice issuer
A
num_factura string required for operations WITH invoice
Number of the invoice the payment relates to
2300017
fecha_factura string required for operations WITH invoice
Date of the invoice for the payment, in dd/mm/yyyy format
13/11/2023
concepto enum required for operations WITHOUT invoice and form 140
When the operation has no invoice, and only for form 140 (self-employed individuals or entities without legal personality). Possible options:
600 - Purchases of goods for resale
601 - Purchases of raw materials
602 - Purchases of other supplies
606 - Early payment discounts on purchases
607 - Work performed by other companies
608 - Purchase returns and similar operations
609 - Volume discounts (rappels) on purchases
620 - Research and development expenses for the year
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 - Other services
631 - Other taxes
634 - Negative adjustments to indirect taxation
639 - Positive adjustments to indirect taxation
640 - Wages and salaries
641 - Severance payments
64201 - Social security paid by the company: self-employed
64202 - Social security paid by the company: employees
643 - Long-term remuneration under defined contribution plans
644 - Long-term remuneration under defined benefit plans
649 - Other employee benefit expenses
65 - Other operating expenses
66 - Financial expenses
67 - Exceptional expenses
680 - Amortization of intangible fixed assets
681 - Depreciation of property, plant and equipment
682 - Depreciation of real estate investments
69 - Impairment losses and other provisions
600
fecha_operacion string required for operations WITHOUT invoice and form 140
Date of the operation without invoice (that of the registered expense entry) in dd/mm/yyyy format
13/11/2023
linea integer required for operations WITHOUT invoice and form 140
Sequence number identifying the expense entry
1
importe_pagado float required
Amount paid
1210.00
iva_soportado float optional
Amount of input VAT
210.00
iva_deducible float optional
Deductible VAT amount
210.00
gasto_irpf float optional for form 140
Expense to be allocated for IRPF (personal income tax)
1000.00
forma_pago enum optional
Payment method used. Options:
01 - Bank transfer
02 - Check
03 - Not collected / paid (accrual deadline / forced accrual in insolvency proceedings)
04 - Other means of collection or payment
05 - Direct debit
04
descripcion_fpago string optional
Description of the payment method
Paypal


POST https://{entorno}.ticketbaiws.eus/lroe-critcaja-pagos/
$ curl --request POST \
     --url https://api-test.ticketbaiws.eus/lroe-critcaja-pagos/ \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'Token: xxx' \
     --header 'Nif: 00000014Z'
	 --data '
{
    "ejercicio": 2023,
    "pagos": [
        {
            "nombre_social": "Berein Internet S.L.",
            "nif": "B01489350",
            "fecha_factura": "29\/11\/2023",
            "fecha_pago": "30\/12\/2023",
            "serie": "A",
            "num_factura": "2023000699",
            "importe_pagado": 100,
            "iva_soportado": 21,
            "iva_deducible": 21,
            "forma_pago": "01",
            "descripcion_fpago": "Transferencia"
        },
        {
            "nombre_social": "Berein Internet S.L.",
            "nif": "B01489350",
            "fecha_factura": "29\/11\/2023",
            "fecha_pago": "30\/12\/2023",
            "serie": "A",
            "num_factura": "2023000700",
            "importe_pagado": 100,
            "iva_soportado": 21,
            "iva_deducible": 21,
            "forma_pago": "01",
            "descripcion_fpago": "Transferencia"
        }
    ]
}'
$ 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->lroeCriterioCajaPagos()->alta([
    'ejercicio' => 2023,
    'pagos'     => [
        ['nombre_social' => 'Berein Internet S.L.', 'nif' => 'B01489350', 'fecha_factura' => '29/11/2023', 'fecha_pago' => '30/12/2023', 'serie' => 'A', 'num_factura' => '2023000699', 'importe_pagado' => 100, 'iva_soportado' => 21, 'iva_deducible' => 21, 'forma_pago' => '01', 'descripcion_fpago' => 'Transferencia'],
        ['nombre_social' => 'Berein Internet S.L.', 'nif' => 'B01489350', 'fecha_factura' => '29/11/2023', 'fecha_pago' => '30/12/2023', 'serie' => 'A', 'num_factura' => '2023000700', 'importe_pagado' => 100, 'iva_soportado' => 21, 'iva_deducible' => 21, 'forma_pago' => '01', 'descripcion_fpago' => 'Transferencia'],
    ],
]);

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-pagos/"
payload = {
    "ejercicio": 2023,
    "pagos": [
        {
            "nombre_social": "Berein Internet S.L.",
            "nif": "B01489350",
            "fecha_factura": "29\/11\/2023",
            "fecha_pago": "30\/12\/2023",
            "serie": "A",
            "num_factura": "2023000699",
            "importe_pagado": 100,
            "iva_soportado": 21,
            "iva_deducible": 21,
            "forma_pago": "01",
            "descripcion_fpago": "Transferencia"
        },
        {
            "nombre_social": "Berein Internet S.L.",
            "nif": "B01489350",
            "fecha_factura": "29\/11\/2023",
            "fecha_pago": "30\/12\/2023",
            "serie": "A",
            "num_factura": "2023000700",
            "importe_pagado": 100,
            "iva_soportado": 21,
            "iva_deducible": 21,
            "forma_pago": "01",
            "descripcion_fpago": "Transferencia"
        }
    ]
}

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-critcaja-pagos/");

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_POSTFIELDS, '{"ejercicio": 2023,"pagos": [{"nombre_social": "Berein Internet S.L.","nif": "B01489350","fecha_factura": "29\/11\/2023","fecha_pago": "30\/12\/2023","serie": "A","num_factura": "2023000699","importe_pagado": 100,"iva_soportado": 21,"iva_deducible": 21,"forma_pago": "01","descripcion_fpago": "Transferencia"},{"nombre_social": "Berein Internet S.L.","nif": "B01489350","fecha_factura": "29\/11\/2023","fecha_pago": "30\/12\/2023","serie": "A","num_factura": "2023000700","importe_pagado": 100,"iva_soportado": 21,"iva_deducible": 21,"forma_pago": "01","descripcion_fpago": "Transferencia"}]}');

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

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{"ejercicio": 2023,"pagos": [{"nombre_social": "Berein Internet S.L.","nif": "B01489350","fecha_factura": "29\/11\/2023","fecha_pago": "30\/12\/2023","serie": "A","num_factura": "2023000699","importe_pagado": 100,"iva_soportado": 21,"iva_deducible": 21,"forma_pago": "01","descripcion_fpago": "Transferencia"},{"nombre_social": "Berein Internet S.L.","nif": "B01489350","fecha_factura": "29\/11\/2023","fecha_pago": "30\/12\/2023","serie": "A","num_factura": "2023000700","importe_pagado": 100,"iva_soportado": 21,"iva_deducible": 21,"forma_pago": "01","descripcion_fpago": "Transferencia"}]}');

Request request = new Request.Builder()
  .url("https://api-test.ticketbaiws.eus/lroe-critcaja-pagos/")
  .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_factura": "29-11-2023",
                "fecha_pago": "04-12-2023",
                "serie": "A",
                "num_factura": "2023000699",
                "estado": "Correcto"
            },
            {
                "fecha_factura": "29-11-2023",
                "fecha_pago": "05-12-2023",
                "serie": "A",
                "num_factura": "2023000699",
                "estado": "Correcto"
            }
        ],
        "status": "OK"
    },
    "msg": null
}

TicketBAI / Verifactu methods

Representation document

BATUZ BIZKAIA specific methods

SII (AEAT)

Customers and products (invoicing tool)

Other methods