API > LROE - Cancel received invoices

LROE - Cancel received invoices

DEL  https://{entorno}.ticketbaiws.eus/lroe-recibidas/

IMPORTANT: This method is only valid for BATUZ Bizkaia. Lets you cancel received invoices (purchases) that were previously sent to the Batuz LROE

PARAMETERS

ejercicio integer required
Fiscal year of the batch of received invoices, in yyyy format
2023
facturas object array required (max 1000) records
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
num_factura string required
Invoice number
2023715273


DEL https://{entorno}.ticketbaiws.eus/lroe-recibidas/
$ curl --request DELETE \
     --url https://api-test.ticketbaiws.eus/lroe-recibidas/ \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'Token: xxx' \
     --header 'Nif: 00000014Z'
	 --data '
{
    "ejercicio": 2023,
    "facturas":[
        {
            "nif": "B01000012",
            "num_factura": "2023715273",
        }
    ]
}'
$ 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->lroeRecibidas()->anular([
    'ejercicio' => 2023,
    'facturas'  => [
        ['nif' => 'B01000012', 'num_factura' => '2023715273'],
    ],
]);

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-recibidas/"
payload = {
    "ejercicio": 2023,
    "facturas":[
        {
            "nif": "B01000012",
            "num_factura": "2023715273",
        }
    ]
}

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

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

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-test.ticketbaiws.eus/lroe-recibidas/");

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_delFIELDS, '{"ejercicio": 2023,"facturas":[{"nif": "B01000012","num_factura": "2023715273"}]}');

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

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{"ejercicio": 2023,"facturas":[{"nif": "B01000012","num_factura": "2023715273"}]}');

Request request = new Request.Builder()
  .url("https://api-test.ticketbaiws.eus/lroe-recibidas/")
  .DELETE(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": "02-09-2023",
                "num_factura": "2023/3/075",
                "estado": "Correcto",
                "nif": "B01489350"
            },
            {
                "fecha": "02-09-2023",
                "num_factura": "2023/3/076",
                "estado": "Correcto",
                "nif": "B01489350"
            }
        ],
        "status": "OK"
    },
    "msg": null
}

TicketBAI / Verifactu methods

Representation document

BATUZ BIZKAIA specific methods

SII (AEAT)

Customers and products (invoicing tool)

Other methods