API > Anular Factura TicketBAI

Anular factura TicketBAI

DEL  https://{entorno}.ticketbaiws.eus/tbai/

Este método permite anular un TicketBAI enviado por error PERO no se podrá enviar otra factura con el mismo número. Consulta las preguntas frecuentes de Batuz aquí

PARÁMETROS

serie string obligatorio
Serie de la factura
A
numero string obligatorio
Número de factura
2021000123

DEL https://{entorno}.ticketbaiws.eus/tbai/
$ curl --request DELETE \
     --url https://api-test.ticketbaiws.eus/tbai/ \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'Token: xxx' \
     --header 'Nif: 00000014Z'
	 --data '{"serie":"A","numero":"2021000123"}'
$ composer require guzzlehttp/guzzle
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api-test.ticketbaiws.eus/tbai/', [
  'body' => '{"serie":"A","numero":"2021000123"}',
  '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/tbai/"
headers = {"Accept": "application/json", "Token" : "xxx", "Nif" : "00000014Z"}
response = requests.request("DELETE", url, 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/tbai/");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

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

Request request = new Request.Builder()
  .url("https://api-test.ticketbaiws.eus/tbai/")
  .delete()
  .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": {}, 
	"msg": "TicketBAI anulado" 
}