API > LROE - Anular facturas recibidas

LROE - Anular facturas recibidas

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

ATENCIÓN: Este método únicamente es válido para BATUZ Bizkaia. Permite anular facturas recibidas (compras) que previamente hemos enviado al LROE de Batuz

PARÁMETROS

ejercicio integer obligatorio
Año fiscal del ejercicio del bloque de facturas recibicas en formato yyyy
2023
facturas object array obligatorio (máx 1000) registros
nif string obligatorio
NIF del emisor de la factura
B01000012
pais string opcional
Código 2 letras del país del emisor de la factura si el NIF del proveedor es extranjero (formato ISO-3166 Alpha-2 code)
ES
num_factura string obligatorio
Número de factura
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 guzzlehttp/guzzle
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api-test.ticketbaiws.eus/lroe-recibidas/', [
  'body' => '{"ejercicio": 2023,"facturas":[{"nif": "B01000012","num_factura": "2023715273"}]}',
  'headers' => [
    'Accept' => 'application/json',
    'Content-Type' => 'application/json',
    'Token' => 'xxx',
    'Nif' => '00000014Z'
  ],
]);

echo $response->getBody();
$ 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
}