API > LROE - Cash accounting - COLLECTIONS - Modify collections

LROE - Cash accounting - COLLECTIONS - Modify collections

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

IMPORTANT: This method is only valid for BATUZ Bizkaia. Lets you modify collections previously sent 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 collections, in yyyy format
2023
cobros 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_cobro string required
Date on which the collection was made, in dd/mm/yyyy format
13/11/2023
tipo_operacion string required
Collection for an operation with or without an invoice. Possible values:
con_factura , sin_factura
con_factura
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 collection relates to
2300017
fecha_factura string required for operations WITH invoice
Date of the invoice for the collection, in dd/mm/yyyy format
13/11/2023
tipo_ingreso 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:
1  - Temporary disability benefits
2 - Grants (subgroup 74)
3 - Financial income (subgroup 76)
4 - Extraordinary and other income (subgroups 73, 77 and 79)
2
fecha_operacion string required for operations WITHOUT invoice and form 140
Date of the operation without invoice (that of the registered income entry) in dd/mm/yyyy format
13/11/2023
linea integer required for operations WITHOUT invoice and form 140
Sequence number identifying the income entry
1
importe_cobrado float required
Amount collected
1210.00
iva_devengado float optional
Amount of output VAT collected
210.00
ingreso_irpf float optional for form 140
Income to be reported 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


PUT https://{entorno}.ticketbaiws.eus/lroe-critcaja-cobros/
$ curl --request PUT \
     --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,
    "cobros":[
        {
            "fecha_factura": "29/11/2023",
            "fecha_cobro": "30/12/2023",
            "serie":"A",
            "num_factura":"2023000699",
            "importe_cobrado": 100.00,
            "iva_devengado": 21.00,
            "forma_pago":"01",
            "descripcion_fpago":"Transferencia"
        },
        {
            "fecha_factura": "29/11/2023",
            "fecha_cobro": "01/12/2023",
            "serie":"A",
            "num_factura":"2023000699",
            "importe_cobrado": 50,
            "iva_devengado": 10.50,
            "forma_pago":"04",
            "descripcion_fpago":"Otros medios de cobro o de pago"
        }
    ]
}'
$ 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()->modificar([
    'ejercicio' => 2023,
    'cobros'    => [
        ['fecha_factura' => '29/11/2023', 'fecha_cobro' => '30/12/2023', 'serie' => 'A', 'num_factura' => '2023000699', 'importe_cobrado' => 100.0, 'iva_devengado' => 21.0, 'forma_pago' => '01', 'descripcion_fpago' => 'Transferencia'],
        ['fecha_factura' => '29/11/2023', 'fecha_cobro' => '01/12/2023', 'serie' => 'A', 'num_factura' => '2023000699', 'importe_cobrado' => 50, 'iva_devengado' => 10.5, 'forma_pago' => '04', 'descripcion_fpago' => 'Otros medios de cobro o de pago'],
    ],
]);

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,
    "cobros":[
        {
            "fecha_factura": "29/11/2023",
            "fecha_cobro": "30/12/2023",
            "serie":"A",
            "num_factura":"2023000699",
            "importe_cobrado": 100.00,
            "iva_devengado": 21.00,
            "forma_pago":"01",
            "descripcion_fpago":"Transferencia"
        },
        {
            "fecha_factura": "29/11/2023",
            "fecha_cobro": "01/12/2023",
            "serie":"A",
            "num_factura":"2023000699",
            "importe_cobrado": 50,
            "iva_devengado": 10.50,
            "forma_pago":"04",
            "descripcion_fpago":"Otros medios de cobro o de pago"
        }
    ]
}

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

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

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
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_POSTFIELDS, '{"ejercicio": 2023,"cobros":[{"fecha_factura": "29/11/2023","fecha_cobro": "30/12/2023","serie":"A","num_factura":"2023000699","importe_cobrado": 100.00,"iva_devengado": 21.00,"forma_pago":"01","descripcion_fpago":"Transferencia"},{"fecha_factura": "29/11/2023","fecha_cobro": "01/12/2023","serie":"A","num_factura":"2023000699","importe_cobrado": 50,"iva_devengado": 10.50,"forma_pago":"04","descripcion_fpago":"Otros medios de cobro o de pago"}]}');

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

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{"ejercicio": 2023,"cobros":[{"fecha_factura": "29/11/2023","fecha_cobro": "30/12/2023","serie":"A","num_factura":"2023000699","importe_cobrado": 100.00,"iva_devengado": 21.00,"forma_pago":"01","descripcion_fpago":"Transferencia"},{"fecha_factura": "29/11/2023","fecha_cobro": "01/12/2023","serie":"A","num_factura":"2023000699","importe_cobrado": 50,"iva_devengado": 10.50,"forma_pago":"04","descripcion_fpago":"Otros medios de cobro o de pago"}]}');

Request request = new Request.Builder()
  .url("https://api-test.ticketbaiws.eus/lroe-critcaja-cobros/")
  .put(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": "04-12-2023",
                "serie": "A",
                "num_factura": "2023000699",
                "estado": "Correcto"
            },
            {
                "fecha_factura": "29-11-2023",
                "fecha_cobro": "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