curl --request POST \
--url https://api.kubifactu.com/api/invoices/batch \
--header 'Content-Type: application/json' \
--header 'X-Qbikode-ClientApiKey: <api-key>' \
--data '
{
"invoices": [
{
"sif_id": "9db0bca1-187e-4cf4-b87c-96f2044008d7",
"invoice_type_key": "F1",
"sender_data": {
"company_name": "<string>",
"tax_id_number": "<string>"
},
"full_invoice_number": "2025-00001",
"fiscal_year": 2025,
"issue_date": "2025-09-15",
"operation_description": "<string>",
"tax_breakdown": [
{
"tax_base": 200,
"tax_base_at_cost": 123,
"tax_rate": 21,
"tax_quota": 42,
"equalization_tax_rate": 5.2,
"equalization_tax_quota": 10.4
}
],
"total_quota": 123,
"total_amount": 123,
"client_invoice_id": "96f2044008d7iujfd78jspo4",
"callback_url": "https://www.tuempresa.com/kubifactu/callback",
"recipients": [
{
"company_name": "<string>",
"tax_id_number": "<string>",
"other_country_code": "<string>",
"other_tax_id_number": "<string>"
}
],
"representative_company_name": "<string>",
"representative_tax_id_number": "<string>",
"operation_date": "2025-02-26",
"rectified_tax_base": 2500.55,
"rectified_tax_quota": 42.3,
"rectified_equalization_tax_quota": 5.2,
"rectified_invoices": [
{
"tax_id_number": "<string>",
"full_invoice_number": "<string>",
"issue_date": "2025-02-26"
}
],
"substituted_invoices": [
{
"tax_id_number": "<string>",
"full_invoice_number": "<string>",
"issue_date": "2025-02-26"
}
],
"coupon_key": "N",
"invoicing_agreement_registration_number": "<string>",
"sif_agreement_id": "<string>"
}
]
}
'import requests
url = "https://api.kubifactu.com/api/invoices/batch"
payload = { "invoices": [
{
"sif_id": "9db0bca1-187e-4cf4-b87c-96f2044008d7",
"invoice_type_key": "F1",
"sender_data": {
"company_name": "<string>",
"tax_id_number": "<string>"
},
"full_invoice_number": "2025-00001",
"fiscal_year": 2025,
"issue_date": "2025-09-15",
"operation_description": "<string>",
"tax_breakdown": [
{
"tax_base": 200,
"tax_base_at_cost": 123,
"tax_rate": 21,
"tax_quota": 42,
"equalization_tax_rate": 5.2,
"equalization_tax_quota": 10.4
}
],
"total_quota": 123,
"total_amount": 123,
"client_invoice_id": "96f2044008d7iujfd78jspo4",
"callback_url": "https://www.tuempresa.com/kubifactu/callback",
"recipients": [
{
"company_name": "<string>",
"tax_id_number": "<string>",
"other_country_code": "<string>",
"other_tax_id_number": "<string>"
}
],
"representative_company_name": "<string>",
"representative_tax_id_number": "<string>",
"operation_date": "2025-02-26",
"rectified_tax_base": 2500.55,
"rectified_tax_quota": 42.3,
"rectified_equalization_tax_quota": 5.2,
"rectified_invoices": [
{
"tax_id_number": "<string>",
"full_invoice_number": "<string>",
"issue_date": "2025-02-26"
}
],
"substituted_invoices": [
{
"tax_id_number": "<string>",
"full_invoice_number": "<string>",
"issue_date": "2025-02-26"
}
],
"coupon_key": "N",
"invoicing_agreement_registration_number": "<string>",
"sif_agreement_id": "<string>"
}
] }
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({
invoices: [
{
sif_id: '9db0bca1-187e-4cf4-b87c-96f2044008d7',
invoice_type_key: 'F1',
sender_data: {company_name: '<string>', tax_id_number: '<string>'},
full_invoice_number: '2025-00001',
fiscal_year: 2025,
issue_date: '2025-09-15',
operation_description: '<string>',
tax_breakdown: [
{
tax_base: 200,
tax_base_at_cost: 123,
tax_rate: 21,
tax_quota: 42,
equalization_tax_rate: 5.2,
equalization_tax_quota: 10.4
}
],
total_quota: 123,
total_amount: 123,
client_invoice_id: '96f2044008d7iujfd78jspo4',
callback_url: 'https://www.tuempresa.com/kubifactu/callback',
recipients: [
{
company_name: '<string>',
tax_id_number: '<string>',
other_country_code: '<string>',
other_tax_id_number: '<string>'
}
],
representative_company_name: '<string>',
representative_tax_id_number: '<string>',
operation_date: '2025-02-26',
rectified_tax_base: 2500.55,
rectified_tax_quota: 42.3,
rectified_equalization_tax_quota: 5.2,
rectified_invoices: [
{
tax_id_number: '<string>',
full_invoice_number: '<string>',
issue_date: '2025-02-26'
}
],
substituted_invoices: [
{
tax_id_number: '<string>',
full_invoice_number: '<string>',
issue_date: '2025-02-26'
}
],
coupon_key: 'N',
invoicing_agreement_registration_number: '<string>',
sif_agreement_id: '<string>'
}
]
})
};
fetch('https://api.kubifactu.com/api/invoices/batch', 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/invoices/batch",
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([
'invoices' => [
[
'sif_id' => '9db0bca1-187e-4cf4-b87c-96f2044008d7',
'invoice_type_key' => 'F1',
'sender_data' => [
'company_name' => '<string>',
'tax_id_number' => '<string>'
],
'full_invoice_number' => '2025-00001',
'fiscal_year' => 2025,
'issue_date' => '2025-09-15',
'operation_description' => '<string>',
'tax_breakdown' => [
[
'tax_base' => 200,
'tax_base_at_cost' => 123,
'tax_rate' => 21,
'tax_quota' => 42,
'equalization_tax_rate' => 5.2,
'equalization_tax_quota' => 10.4
]
],
'total_quota' => 123,
'total_amount' => 123,
'client_invoice_id' => '96f2044008d7iujfd78jspo4',
'callback_url' => 'https://www.tuempresa.com/kubifactu/callback',
'recipients' => [
[
'company_name' => '<string>',
'tax_id_number' => '<string>',
'other_country_code' => '<string>',
'other_tax_id_number' => '<string>'
]
],
'representative_company_name' => '<string>',
'representative_tax_id_number' => '<string>',
'operation_date' => '2025-02-26',
'rectified_tax_base' => 2500.55,
'rectified_tax_quota' => 42.3,
'rectified_equalization_tax_quota' => 5.2,
'rectified_invoices' => [
[
'tax_id_number' => '<string>',
'full_invoice_number' => '<string>',
'issue_date' => '2025-02-26'
]
],
'substituted_invoices' => [
[
'tax_id_number' => '<string>',
'full_invoice_number' => '<string>',
'issue_date' => '2025-02-26'
]
],
'coupon_key' => 'N',
'invoicing_agreement_registration_number' => '<string>',
'sif_agreement_id' => '<string>'
]
]
]),
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/invoices/batch"
payload := strings.NewReader("{\n \"invoices\": [\n {\n \"sif_id\": \"9db0bca1-187e-4cf4-b87c-96f2044008d7\",\n \"invoice_type_key\": \"F1\",\n \"sender_data\": {\n \"company_name\": \"<string>\",\n \"tax_id_number\": \"<string>\"\n },\n \"full_invoice_number\": \"2025-00001\",\n \"fiscal_year\": 2025,\n \"issue_date\": \"2025-09-15\",\n \"operation_description\": \"<string>\",\n \"tax_breakdown\": [\n {\n \"tax_base\": 200,\n \"tax_base_at_cost\": 123,\n \"tax_rate\": 21,\n \"tax_quota\": 42,\n \"equalization_tax_rate\": 5.2,\n \"equalization_tax_quota\": 10.4\n }\n ],\n \"total_quota\": 123,\n \"total_amount\": 123,\n \"client_invoice_id\": \"96f2044008d7iujfd78jspo4\",\n \"callback_url\": \"https://www.tuempresa.com/kubifactu/callback\",\n \"recipients\": [\n {\n \"company_name\": \"<string>\",\n \"tax_id_number\": \"<string>\",\n \"other_country_code\": \"<string>\",\n \"other_tax_id_number\": \"<string>\"\n }\n ],\n \"representative_company_name\": \"<string>\",\n \"representative_tax_id_number\": \"<string>\",\n \"operation_date\": \"2025-02-26\",\n \"rectified_tax_base\": 2500.55,\n \"rectified_tax_quota\": 42.3,\n \"rectified_equalization_tax_quota\": 5.2,\n \"rectified_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"issue_date\": \"2025-02-26\"\n }\n ],\n \"substituted_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"issue_date\": \"2025-02-26\"\n }\n ],\n \"coupon_key\": \"N\",\n \"invoicing_agreement_registration_number\": \"<string>\",\n \"sif_agreement_id\": \"<string>\"\n }\n ]\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/invoices/batch")
.header("X-Qbikode-ClientApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"invoices\": [\n {\n \"sif_id\": \"9db0bca1-187e-4cf4-b87c-96f2044008d7\",\n \"invoice_type_key\": \"F1\",\n \"sender_data\": {\n \"company_name\": \"<string>\",\n \"tax_id_number\": \"<string>\"\n },\n \"full_invoice_number\": \"2025-00001\",\n \"fiscal_year\": 2025,\n \"issue_date\": \"2025-09-15\",\n \"operation_description\": \"<string>\",\n \"tax_breakdown\": [\n {\n \"tax_base\": 200,\n \"tax_base_at_cost\": 123,\n \"tax_rate\": 21,\n \"tax_quota\": 42,\n \"equalization_tax_rate\": 5.2,\n \"equalization_tax_quota\": 10.4\n }\n ],\n \"total_quota\": 123,\n \"total_amount\": 123,\n \"client_invoice_id\": \"96f2044008d7iujfd78jspo4\",\n \"callback_url\": \"https://www.tuempresa.com/kubifactu/callback\",\n \"recipients\": [\n {\n \"company_name\": \"<string>\",\n \"tax_id_number\": \"<string>\",\n \"other_country_code\": \"<string>\",\n \"other_tax_id_number\": \"<string>\"\n }\n ],\n \"representative_company_name\": \"<string>\",\n \"representative_tax_id_number\": \"<string>\",\n \"operation_date\": \"2025-02-26\",\n \"rectified_tax_base\": 2500.55,\n \"rectified_tax_quota\": 42.3,\n \"rectified_equalization_tax_quota\": 5.2,\n \"rectified_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"issue_date\": \"2025-02-26\"\n }\n ],\n \"substituted_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"issue_date\": \"2025-02-26\"\n }\n ],\n \"coupon_key\": \"N\",\n \"invoicing_agreement_registration_number\": \"<string>\",\n \"sif_agreement_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kubifactu.com/api/invoices/batch")
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 \"invoices\": [\n {\n \"sif_id\": \"9db0bca1-187e-4cf4-b87c-96f2044008d7\",\n \"invoice_type_key\": \"F1\",\n \"sender_data\": {\n \"company_name\": \"<string>\",\n \"tax_id_number\": \"<string>\"\n },\n \"full_invoice_number\": \"2025-00001\",\n \"fiscal_year\": 2025,\n \"issue_date\": \"2025-09-15\",\n \"operation_description\": \"<string>\",\n \"tax_breakdown\": [\n {\n \"tax_base\": 200,\n \"tax_base_at_cost\": 123,\n \"tax_rate\": 21,\n \"tax_quota\": 42,\n \"equalization_tax_rate\": 5.2,\n \"equalization_tax_quota\": 10.4\n }\n ],\n \"total_quota\": 123,\n \"total_amount\": 123,\n \"client_invoice_id\": \"96f2044008d7iujfd78jspo4\",\n \"callback_url\": \"https://www.tuempresa.com/kubifactu/callback\",\n \"recipients\": [\n {\n \"company_name\": \"<string>\",\n \"tax_id_number\": \"<string>\",\n \"other_country_code\": \"<string>\",\n \"other_tax_id_number\": \"<string>\"\n }\n ],\n \"representative_company_name\": \"<string>\",\n \"representative_tax_id_number\": \"<string>\",\n \"operation_date\": \"2025-02-26\",\n \"rectified_tax_base\": 2500.55,\n \"rectified_tax_quota\": 42.3,\n \"rectified_equalization_tax_quota\": 5.2,\n \"rectified_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"issue_date\": \"2025-02-26\"\n }\n ],\n \"substituted_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"issue_date\": \"2025-02-26\"\n }\n ],\n \"coupon_key\": \"N\",\n \"invoicing_agreement_registration_number\": \"<string>\",\n \"sif_agreement_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"response": "Batch of invoice records processed for deferred submission to Veri*Factu."
}
}{
"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"
}
}
}
}Enviar registros de facturación en lote
Registra entre 1 y 500 registros de facturación que serán procesados en diferido.
La respuesta confirma la recepción del lote, pero no incluye los identificadores ni el resultado individual de los registros. Tampoco confirma su aceptación por Veri*Factu. El resultado de cada registro se obtiene posteriormente mediante la URL indicada en su campo callback_url o consultando el registro de facturación.
Si algún registro no supera la validación, la respuesta contiene los errores indexados según su posición en el array, por ejemplo, invoices.0.sif_id.
Resultado mediante callback
El campo callback_url se configura individualmente en cada elemento de invoices. Cuando los registros han sido procesados, KubiFACTU agrupa los resultados de una misma empresa cliente y URL de callback, y realiza una petición POST con contenido application/json.
El cuerpo del callback siempre es un array y puede contener uno o varios registros. Un callback no tiene por qué corresponder exactamente con el lote original, por lo que la integración debe correlacionar cada resultado mediante id o client_invoice_id, sin depender de su posición en el array.
[
{
"id": "7d76c4a6-6603-4fc6-946a-8b9ffcc93480",
"client_invoice_id": "FACTURA-2026-0042",
"record_type": "creation",
"sif_id": "0995c42c-6708-44fb-bfbf-b363a5fe873e",
"sender_company_name": "Ferretería Ejemplo, S.L.",
"sender_tax_id_number": "B12345678",
"fiscal_year": 2026,
"full_invoice_number": "F-2026-0042",
"fingerprint": "8f3d7aa5530f5f6c3a96a5c8a9516a7fd9ce90b9bf3b60375682d8b45ca72867",
"csv": "CSV-DE-EJEMPLO",
"vf_post_status": "success",
"vf_record_registration_status": "success",
"has_warnings": false,
"vf_error_descriptions": null,
"vf_response_body": "PHhtbD5SZXNwdWVzdGEgZGUgZWplbXBsbzwveG1sPg==",
"qr_value": "https://www2.agenciatributaria.gob.es/wlpl/TIKE-CONT/ValidarQR?nif=B12345678&numserie=F-2026-0042&fecha=01-09-2026&importe=121.00",
"qr_image_url": "https://api.kubifactu.com/api/invoices/7d76c4a6-6603-4fc6-946a-8b9ffcc93480/qr-image",
"xml_url": "https://api.kubifactu.com/api/invoices/7d76c4a6-6603-4fc6-946a-8b9ffcc93480/xml"
}
]
El contrato completo de cada elemento se detalla en el campo callback_url de la petición. Este callback es independiente de la respuesta HTTP inmediata del endpoint.
curl --request POST \
--url https://api.kubifactu.com/api/invoices/batch \
--header 'Content-Type: application/json' \
--header 'X-Qbikode-ClientApiKey: <api-key>' \
--data '
{
"invoices": [
{
"sif_id": "9db0bca1-187e-4cf4-b87c-96f2044008d7",
"invoice_type_key": "F1",
"sender_data": {
"company_name": "<string>",
"tax_id_number": "<string>"
},
"full_invoice_number": "2025-00001",
"fiscal_year": 2025,
"issue_date": "2025-09-15",
"operation_description": "<string>",
"tax_breakdown": [
{
"tax_base": 200,
"tax_base_at_cost": 123,
"tax_rate": 21,
"tax_quota": 42,
"equalization_tax_rate": 5.2,
"equalization_tax_quota": 10.4
}
],
"total_quota": 123,
"total_amount": 123,
"client_invoice_id": "96f2044008d7iujfd78jspo4",
"callback_url": "https://www.tuempresa.com/kubifactu/callback",
"recipients": [
{
"company_name": "<string>",
"tax_id_number": "<string>",
"other_country_code": "<string>",
"other_tax_id_number": "<string>"
}
],
"representative_company_name": "<string>",
"representative_tax_id_number": "<string>",
"operation_date": "2025-02-26",
"rectified_tax_base": 2500.55,
"rectified_tax_quota": 42.3,
"rectified_equalization_tax_quota": 5.2,
"rectified_invoices": [
{
"tax_id_number": "<string>",
"full_invoice_number": "<string>",
"issue_date": "2025-02-26"
}
],
"substituted_invoices": [
{
"tax_id_number": "<string>",
"full_invoice_number": "<string>",
"issue_date": "2025-02-26"
}
],
"coupon_key": "N",
"invoicing_agreement_registration_number": "<string>",
"sif_agreement_id": "<string>"
}
]
}
'import requests
url = "https://api.kubifactu.com/api/invoices/batch"
payload = { "invoices": [
{
"sif_id": "9db0bca1-187e-4cf4-b87c-96f2044008d7",
"invoice_type_key": "F1",
"sender_data": {
"company_name": "<string>",
"tax_id_number": "<string>"
},
"full_invoice_number": "2025-00001",
"fiscal_year": 2025,
"issue_date": "2025-09-15",
"operation_description": "<string>",
"tax_breakdown": [
{
"tax_base": 200,
"tax_base_at_cost": 123,
"tax_rate": 21,
"tax_quota": 42,
"equalization_tax_rate": 5.2,
"equalization_tax_quota": 10.4
}
],
"total_quota": 123,
"total_amount": 123,
"client_invoice_id": "96f2044008d7iujfd78jspo4",
"callback_url": "https://www.tuempresa.com/kubifactu/callback",
"recipients": [
{
"company_name": "<string>",
"tax_id_number": "<string>",
"other_country_code": "<string>",
"other_tax_id_number": "<string>"
}
],
"representative_company_name": "<string>",
"representative_tax_id_number": "<string>",
"operation_date": "2025-02-26",
"rectified_tax_base": 2500.55,
"rectified_tax_quota": 42.3,
"rectified_equalization_tax_quota": 5.2,
"rectified_invoices": [
{
"tax_id_number": "<string>",
"full_invoice_number": "<string>",
"issue_date": "2025-02-26"
}
],
"substituted_invoices": [
{
"tax_id_number": "<string>",
"full_invoice_number": "<string>",
"issue_date": "2025-02-26"
}
],
"coupon_key": "N",
"invoicing_agreement_registration_number": "<string>",
"sif_agreement_id": "<string>"
}
] }
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({
invoices: [
{
sif_id: '9db0bca1-187e-4cf4-b87c-96f2044008d7',
invoice_type_key: 'F1',
sender_data: {company_name: '<string>', tax_id_number: '<string>'},
full_invoice_number: '2025-00001',
fiscal_year: 2025,
issue_date: '2025-09-15',
operation_description: '<string>',
tax_breakdown: [
{
tax_base: 200,
tax_base_at_cost: 123,
tax_rate: 21,
tax_quota: 42,
equalization_tax_rate: 5.2,
equalization_tax_quota: 10.4
}
],
total_quota: 123,
total_amount: 123,
client_invoice_id: '96f2044008d7iujfd78jspo4',
callback_url: 'https://www.tuempresa.com/kubifactu/callback',
recipients: [
{
company_name: '<string>',
tax_id_number: '<string>',
other_country_code: '<string>',
other_tax_id_number: '<string>'
}
],
representative_company_name: '<string>',
representative_tax_id_number: '<string>',
operation_date: '2025-02-26',
rectified_tax_base: 2500.55,
rectified_tax_quota: 42.3,
rectified_equalization_tax_quota: 5.2,
rectified_invoices: [
{
tax_id_number: '<string>',
full_invoice_number: '<string>',
issue_date: '2025-02-26'
}
],
substituted_invoices: [
{
tax_id_number: '<string>',
full_invoice_number: '<string>',
issue_date: '2025-02-26'
}
],
coupon_key: 'N',
invoicing_agreement_registration_number: '<string>',
sif_agreement_id: '<string>'
}
]
})
};
fetch('https://api.kubifactu.com/api/invoices/batch', 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/invoices/batch",
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([
'invoices' => [
[
'sif_id' => '9db0bca1-187e-4cf4-b87c-96f2044008d7',
'invoice_type_key' => 'F1',
'sender_data' => [
'company_name' => '<string>',
'tax_id_number' => '<string>'
],
'full_invoice_number' => '2025-00001',
'fiscal_year' => 2025,
'issue_date' => '2025-09-15',
'operation_description' => '<string>',
'tax_breakdown' => [
[
'tax_base' => 200,
'tax_base_at_cost' => 123,
'tax_rate' => 21,
'tax_quota' => 42,
'equalization_tax_rate' => 5.2,
'equalization_tax_quota' => 10.4
]
],
'total_quota' => 123,
'total_amount' => 123,
'client_invoice_id' => '96f2044008d7iujfd78jspo4',
'callback_url' => 'https://www.tuempresa.com/kubifactu/callback',
'recipients' => [
[
'company_name' => '<string>',
'tax_id_number' => '<string>',
'other_country_code' => '<string>',
'other_tax_id_number' => '<string>'
]
],
'representative_company_name' => '<string>',
'representative_tax_id_number' => '<string>',
'operation_date' => '2025-02-26',
'rectified_tax_base' => 2500.55,
'rectified_tax_quota' => 42.3,
'rectified_equalization_tax_quota' => 5.2,
'rectified_invoices' => [
[
'tax_id_number' => '<string>',
'full_invoice_number' => '<string>',
'issue_date' => '2025-02-26'
]
],
'substituted_invoices' => [
[
'tax_id_number' => '<string>',
'full_invoice_number' => '<string>',
'issue_date' => '2025-02-26'
]
],
'coupon_key' => 'N',
'invoicing_agreement_registration_number' => '<string>',
'sif_agreement_id' => '<string>'
]
]
]),
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/invoices/batch"
payload := strings.NewReader("{\n \"invoices\": [\n {\n \"sif_id\": \"9db0bca1-187e-4cf4-b87c-96f2044008d7\",\n \"invoice_type_key\": \"F1\",\n \"sender_data\": {\n \"company_name\": \"<string>\",\n \"tax_id_number\": \"<string>\"\n },\n \"full_invoice_number\": \"2025-00001\",\n \"fiscal_year\": 2025,\n \"issue_date\": \"2025-09-15\",\n \"operation_description\": \"<string>\",\n \"tax_breakdown\": [\n {\n \"tax_base\": 200,\n \"tax_base_at_cost\": 123,\n \"tax_rate\": 21,\n \"tax_quota\": 42,\n \"equalization_tax_rate\": 5.2,\n \"equalization_tax_quota\": 10.4\n }\n ],\n \"total_quota\": 123,\n \"total_amount\": 123,\n \"client_invoice_id\": \"96f2044008d7iujfd78jspo4\",\n \"callback_url\": \"https://www.tuempresa.com/kubifactu/callback\",\n \"recipients\": [\n {\n \"company_name\": \"<string>\",\n \"tax_id_number\": \"<string>\",\n \"other_country_code\": \"<string>\",\n \"other_tax_id_number\": \"<string>\"\n }\n ],\n \"representative_company_name\": \"<string>\",\n \"representative_tax_id_number\": \"<string>\",\n \"operation_date\": \"2025-02-26\",\n \"rectified_tax_base\": 2500.55,\n \"rectified_tax_quota\": 42.3,\n \"rectified_equalization_tax_quota\": 5.2,\n \"rectified_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"issue_date\": \"2025-02-26\"\n }\n ],\n \"substituted_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"issue_date\": \"2025-02-26\"\n }\n ],\n \"coupon_key\": \"N\",\n \"invoicing_agreement_registration_number\": \"<string>\",\n \"sif_agreement_id\": \"<string>\"\n }\n ]\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/invoices/batch")
.header("X-Qbikode-ClientApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"invoices\": [\n {\n \"sif_id\": \"9db0bca1-187e-4cf4-b87c-96f2044008d7\",\n \"invoice_type_key\": \"F1\",\n \"sender_data\": {\n \"company_name\": \"<string>\",\n \"tax_id_number\": \"<string>\"\n },\n \"full_invoice_number\": \"2025-00001\",\n \"fiscal_year\": 2025,\n \"issue_date\": \"2025-09-15\",\n \"operation_description\": \"<string>\",\n \"tax_breakdown\": [\n {\n \"tax_base\": 200,\n \"tax_base_at_cost\": 123,\n \"tax_rate\": 21,\n \"tax_quota\": 42,\n \"equalization_tax_rate\": 5.2,\n \"equalization_tax_quota\": 10.4\n }\n ],\n \"total_quota\": 123,\n \"total_amount\": 123,\n \"client_invoice_id\": \"96f2044008d7iujfd78jspo4\",\n \"callback_url\": \"https://www.tuempresa.com/kubifactu/callback\",\n \"recipients\": [\n {\n \"company_name\": \"<string>\",\n \"tax_id_number\": \"<string>\",\n \"other_country_code\": \"<string>\",\n \"other_tax_id_number\": \"<string>\"\n }\n ],\n \"representative_company_name\": \"<string>\",\n \"representative_tax_id_number\": \"<string>\",\n \"operation_date\": \"2025-02-26\",\n \"rectified_tax_base\": 2500.55,\n \"rectified_tax_quota\": 42.3,\n \"rectified_equalization_tax_quota\": 5.2,\n \"rectified_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"issue_date\": \"2025-02-26\"\n }\n ],\n \"substituted_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"issue_date\": \"2025-02-26\"\n }\n ],\n \"coupon_key\": \"N\",\n \"invoicing_agreement_registration_number\": \"<string>\",\n \"sif_agreement_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kubifactu.com/api/invoices/batch")
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 \"invoices\": [\n {\n \"sif_id\": \"9db0bca1-187e-4cf4-b87c-96f2044008d7\",\n \"invoice_type_key\": \"F1\",\n \"sender_data\": {\n \"company_name\": \"<string>\",\n \"tax_id_number\": \"<string>\"\n },\n \"full_invoice_number\": \"2025-00001\",\n \"fiscal_year\": 2025,\n \"issue_date\": \"2025-09-15\",\n \"operation_description\": \"<string>\",\n \"tax_breakdown\": [\n {\n \"tax_base\": 200,\n \"tax_base_at_cost\": 123,\n \"tax_rate\": 21,\n \"tax_quota\": 42,\n \"equalization_tax_rate\": 5.2,\n \"equalization_tax_quota\": 10.4\n }\n ],\n \"total_quota\": 123,\n \"total_amount\": 123,\n \"client_invoice_id\": \"96f2044008d7iujfd78jspo4\",\n \"callback_url\": \"https://www.tuempresa.com/kubifactu/callback\",\n \"recipients\": [\n {\n \"company_name\": \"<string>\",\n \"tax_id_number\": \"<string>\",\n \"other_country_code\": \"<string>\",\n \"other_tax_id_number\": \"<string>\"\n }\n ],\n \"representative_company_name\": \"<string>\",\n \"representative_tax_id_number\": \"<string>\",\n \"operation_date\": \"2025-02-26\",\n \"rectified_tax_base\": 2500.55,\n \"rectified_tax_quota\": 42.3,\n \"rectified_equalization_tax_quota\": 5.2,\n \"rectified_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"issue_date\": \"2025-02-26\"\n }\n ],\n \"substituted_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"issue_date\": \"2025-02-26\"\n }\n ],\n \"coupon_key\": \"N\",\n \"invoicing_agreement_registration_number\": \"<string>\",\n \"sif_agreement_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"response": "Batch of invoice records processed for deferred submission to Veri*Factu."
}
}{
"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.
Body
Array de registros de facturación con la misma estructura que la del endpoint de Enviar registro de facturación.
1 - 500 elementsShow child attributes
Show child attributes
Response
Lote recibido para su procesamiento diferido.
Show child attributes
Show child attributes