curl --request POST \
--url https://api.kubifactu.com/api/invoicing/invoices/{invoiceId}/deferredcancel \
--header 'Content-Type: application/json' \
--header 'X-Qbikode-ClientApiKey: <api-key>' \
--data '
{
"callback_url": "https://www.tuempresa.com/kubifactu/callback"
}
'import requests
url = "https://api.kubifactu.com/api/invoicing/invoices/{invoiceId}/deferredcancel"
payload = { "callback_url": "https://www.tuempresa.com/kubifactu/callback" }
headers = {
"X-Qbikode-ClientApiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Qbikode-ClientApiKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({callback_url: 'https://www.tuempresa.com/kubifactu/callback'})
};
fetch('https://api.kubifactu.com/api/invoicing/invoices/{invoiceId}/deferredcancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kubifactu.com/api/invoicing/invoices/{invoiceId}/deferredcancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'callback_url' => 'https://www.tuempresa.com/kubifactu/callback'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Qbikode-ClientApiKey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kubifactu.com/api/invoicing/invoices/{invoiceId}/deferredcancel"
payload := strings.NewReader("{\n \"callback_url\": \"https://www.tuempresa.com/kubifactu/callback\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Qbikode-ClientApiKey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.kubifactu.com/api/invoicing/invoices/{invoiceId}/deferredcancel")
.header("X-Qbikode-ClientApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"callback_url\": \"https://www.tuempresa.com/kubifactu/callback\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kubifactu.com/api/invoicing/invoices/{invoiceId}/deferredcancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Qbikode-ClientApiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"callback_url\": \"https://www.tuempresa.com/kubifactu/callback\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"request_id": "2cc8ef846029ec69613711ad1d85f6dfebf16ffb",
"sif_id": "0995C42C-6708-44FB-BFBF-B363A5FE873E",
"fingerprint": "<string>",
"vf_post_status": "success",
"vf_record_registration_status": "success",
"has_warnings": false,
"vf_error_descriptions": "<string>",
"next_request_waiting_time": 123,
"next_request_datetime": "1977-04-22T06:00:00Z"
}
}{
"data": {
"error": {
"code": "E-UNAUTH-APIKEY",
"message": "No client with API-KEY '5tVySMGJOpq8HfMgIX28Qz6kF0dFOoq37x55PLZcWsGeGeYkNgJyAcRTlFJ5NbVoDRm8qtCywEoiN3A9JkBanMBXYmxiqR3BItxgxx' was found.",
"http_code": 403,
"errors": null,
"details": {
"request_id": "2cc8ef846029ec69613711ad1d85f6dfebf16ffb"
}
}
}
}{
"data": {
"error": {
"message": "The given data was invalid.",
"errors": {
"invoice_exists": [
"An invoice already exists with the indicated invoice number and fiscal for the provided SIF. Existing invoice ID: [9db6bb78-6799-4abb-b9a0-22d127c543ed]."
],
"incorrect_total_quota": [
"The total quota of the invoice does not match the total tax quota and equalization_tax_quota of the tax breakdown. Calculated total quota: [26.25]."
],
"incorrect_total_amount": [
"The total amount of the invoice does not match the total tax base of the tax breakdown. Calculated total amount: [151.25]."
]
},
"details": {
"request_id": "9ded9e2c-d59e-4432-a926-652cbcfac365"
}
}
}
}Anular registro de facturación en diferido
Anulación de un registro de facturación en diferido.
curl --request POST \
--url https://api.kubifactu.com/api/invoicing/invoices/{invoiceId}/deferredcancel \
--header 'Content-Type: application/json' \
--header 'X-Qbikode-ClientApiKey: <api-key>' \
--data '
{
"callback_url": "https://www.tuempresa.com/kubifactu/callback"
}
'import requests
url = "https://api.kubifactu.com/api/invoicing/invoices/{invoiceId}/deferredcancel"
payload = { "callback_url": "https://www.tuempresa.com/kubifactu/callback" }
headers = {
"X-Qbikode-ClientApiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Qbikode-ClientApiKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({callback_url: 'https://www.tuempresa.com/kubifactu/callback'})
};
fetch('https://api.kubifactu.com/api/invoicing/invoices/{invoiceId}/deferredcancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kubifactu.com/api/invoicing/invoices/{invoiceId}/deferredcancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'callback_url' => 'https://www.tuempresa.com/kubifactu/callback'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Qbikode-ClientApiKey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kubifactu.com/api/invoicing/invoices/{invoiceId}/deferredcancel"
payload := strings.NewReader("{\n \"callback_url\": \"https://www.tuempresa.com/kubifactu/callback\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Qbikode-ClientApiKey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.kubifactu.com/api/invoicing/invoices/{invoiceId}/deferredcancel")
.header("X-Qbikode-ClientApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"callback_url\": \"https://www.tuempresa.com/kubifactu/callback\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kubifactu.com/api/invoicing/invoices/{invoiceId}/deferredcancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Qbikode-ClientApiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"callback_url\": \"https://www.tuempresa.com/kubifactu/callback\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"request_id": "2cc8ef846029ec69613711ad1d85f6dfebf16ffb",
"sif_id": "0995C42C-6708-44FB-BFBF-B363A5FE873E",
"fingerprint": "<string>",
"vf_post_status": "success",
"vf_record_registration_status": "success",
"has_warnings": false,
"vf_error_descriptions": "<string>",
"next_request_waiting_time": 123,
"next_request_datetime": "1977-04-22T06:00:00Z"
}
}{
"data": {
"error": {
"code": "E-UNAUTH-APIKEY",
"message": "No client with API-KEY '5tVySMGJOpq8HfMgIX28Qz6kF0dFOoq37x55PLZcWsGeGeYkNgJyAcRTlFJ5NbVoDRm8qtCywEoiN3A9JkBanMBXYmxiqR3BItxgxx' was found.",
"http_code": 403,
"errors": null,
"details": {
"request_id": "2cc8ef846029ec69613711ad1d85f6dfebf16ffb"
}
}
}
}{
"data": {
"error": {
"message": "The given data was invalid.",
"errors": {
"invoice_exists": [
"An invoice already exists with the indicated invoice number and fiscal for the provided SIF. Existing invoice ID: [9db6bb78-6799-4abb-b9a0-22d127c543ed]."
],
"incorrect_total_quota": [
"The total quota of the invoice does not match the total tax quota and equalization_tax_quota of the tax breakdown. Calculated total quota: [26.25]."
],
"incorrect_total_amount": [
"The total amount of the invoice does not match the total tax base of the tax breakdown. Calculated total amount: [151.25]."
]
},
"details": {
"request_id": "9ded9e2c-d59e-4432-a926-652cbcfac365"
}
}
}
}Authorizations
API-KEY de la empresa que hace la petición. Este dato se puede consultar en el panel web, accediendo a la sección Empresas y accediendo a la ficha de la empresa en cuestión.
Path Parameters
ID de la factura. Este ID se obtiene en la respuesta a las altas de registros de facturación. También se peude obtener desde el panel web, acediendo a la factura en el campo ID DE KUBIFACTU.
Body
Sólo aplicable a registros de facturación en diferido o reenvíos de regitros de facturación. URL a la que se llamará con el resultado de la AEAT al procesamiento del registro de facturación.
Se hará una petición POST a esta URL y se enviarán los siguientes campos en formato JSON:
id:string. Identificador de KubiFACTU para el registro de facturación.client_invoice_id:string. Identificador del cliente para el registro de facturación.record_type:string (creation|cancellation). Tipo de registro de facturación.sif_id:string. ID del SIF utilizado para la creación del registro.sender_company_name:string. Nombre de la empresa emisira.sender_tax_id_number:string. CIF/NIF de la empresa emisora.full_invoice_number:string. Número de factura.fingerprint:string. Huella del registro de facturación.csv:string. Código Seguro de Verificación del registro de facturación.vf_post_status:string. Ver valores posibles en la documentación del campovf_post_statusde la respuesta de envío de registros de facturación.vf_record_registration_status:string. Ver valores posibles en la documentación del campovf_record_registration_statusde la respuesta de envío de registros de facturación.has_warnings:bool. Indica si el registro contiene errores que deban ser subsanados.vf_error_descriptions:string|null. Cadena con la descripción de los errores devueltos por Veri*Factu.vf_response_body:string|null. Cuerpo de la respuesta de Veri*Factu en formato Base64. Contiene el XML completo devuelto por la AEAT tras el envío del registro de facturación.xml_url:string|null. URL para descargar el XML del registro de facturación enviado a Veri*Factu mediante el endpoint Descargar XML del registro de facturación. Seránullsi el XML aún no está disponible.qr_value:string|null. URL del código QR para validación de la factura en Veri*Factu. Seránullsi el registro fue rechazado o no aplica mostrar QR.qr_image_url:string|null. URL para descargar la imagen PNG del código QR generado por KubiFACTU mediante el endpoint Descargar imagen QR del registro de facturación. Seránullsi el registro fue rechazado o no aplica mostrar QR.
"https://www.tuempresa.com/kubifactu/callback"
Response
Factura enviada con éxito.
Show child attributes
Show child attributes