curl --request POST \
--url https://api.kubifactu.com/api/invoicing/invoices \
--header 'Content-Type: application/json' \
--header 'X-Qbikode-ClientApiKey: <api-key>' \
--data '
{
"sif_id": "9db0bca1-187e-4cf4-b87c-96f2044008d7",
"sender_data": {
"sender_full_name": "<string>",
"sender_id_card_number": "<string>"
},
"invoice_data": {
"invoice_type_key": "F1",
"fiscal_year": 2025,
"series_code": "2025",
"invoice_number": "00021",
"invoice_datetime": "2025-02-26 12:35:44",
"description": "<string>",
"lines": [
{
"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,
"operation_date": "2025-02-26",
"representative_company_name": "<string>",
"representative_tax_id_number": "<string>",
"is_simplified": false,
"coupon_key": "N",
"invoicing_agreement_registration_number": "<string>",
"sif_agreement_id": "<string>",
"rectified_base_amount": 2500.55,
"rectified_quota": 42.3,
"rectified_equalization_tax_quota": 5.2,
"replaced_rectified_invoices": [
{
"tax_id_number": "<string>",
"full_invoice_number": "<string>",
"invoice_date": "2025-02-26"
}
],
"substituted_invoices": [
{
"tax_id_number": "<string>",
"full_invoice_number": "<string>",
"invoice_date": "2025-02-26"
}
]
},
"callback_url": "https://www.tuempresa.com/kubifactu/callback",
"recipients": [
{
"full_name": "<string>",
"tax_id_number": "<string>",
"other_id_country_code": "<string>",
"other_id_card_id": "<string>"
}
]
}
'import requests
url = "https://api.kubifactu.com/api/invoicing/invoices"
payload = {
"sif_id": "9db0bca1-187e-4cf4-b87c-96f2044008d7",
"sender_data": {
"sender_full_name": "<string>",
"sender_id_card_number": "<string>"
},
"invoice_data": {
"invoice_type_key": "F1",
"fiscal_year": 2025,
"series_code": "2025",
"invoice_number": "00021",
"invoice_datetime": "2025-02-26 12:35:44",
"description": "<string>",
"lines": [
{
"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,
"operation_date": "2025-02-26",
"representative_company_name": "<string>",
"representative_tax_id_number": "<string>",
"is_simplified": False,
"coupon_key": "N",
"invoicing_agreement_registration_number": "<string>",
"sif_agreement_id": "<string>",
"rectified_base_amount": 2500.55,
"rectified_quota": 42.3,
"rectified_equalization_tax_quota": 5.2,
"replaced_rectified_invoices": [
{
"tax_id_number": "<string>",
"full_invoice_number": "<string>",
"invoice_date": "2025-02-26"
}
],
"substituted_invoices": [
{
"tax_id_number": "<string>",
"full_invoice_number": "<string>",
"invoice_date": "2025-02-26"
}
]
},
"callback_url": "https://www.tuempresa.com/kubifactu/callback",
"recipients": [
{
"full_name": "<string>",
"tax_id_number": "<string>",
"other_id_country_code": "<string>",
"other_id_card_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({
sif_id: '9db0bca1-187e-4cf4-b87c-96f2044008d7',
sender_data: {sender_full_name: '<string>', sender_id_card_number: '<string>'},
invoice_data: {
invoice_type_key: 'F1',
fiscal_year: 2025,
series_code: '2025',
invoice_number: '00021',
invoice_datetime: '2025-02-26 12:35:44',
description: '<string>',
lines: [
{
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,
operation_date: '2025-02-26',
representative_company_name: '<string>',
representative_tax_id_number: '<string>',
is_simplified: false,
coupon_key: 'N',
invoicing_agreement_registration_number: '<string>',
sif_agreement_id: '<string>',
rectified_base_amount: 2500.55,
rectified_quota: 42.3,
rectified_equalization_tax_quota: 5.2,
replaced_rectified_invoices: [
{
tax_id_number: '<string>',
full_invoice_number: '<string>',
invoice_date: '2025-02-26'
}
],
substituted_invoices: [
{
tax_id_number: '<string>',
full_invoice_number: '<string>',
invoice_date: '2025-02-26'
}
]
},
callback_url: 'https://www.tuempresa.com/kubifactu/callback',
recipients: [
{
full_name: '<string>',
tax_id_number: '<string>',
other_id_country_code: '<string>',
other_id_card_id: '<string>'
}
]
})
};
fetch('https://api.kubifactu.com/api/invoicing/invoices', 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",
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([
'sif_id' => '9db0bca1-187e-4cf4-b87c-96f2044008d7',
'sender_data' => [
'sender_full_name' => '<string>',
'sender_id_card_number' => '<string>'
],
'invoice_data' => [
'invoice_type_key' => 'F1',
'fiscal_year' => 2025,
'series_code' => '2025',
'invoice_number' => '00021',
'invoice_datetime' => '2025-02-26 12:35:44',
'description' => '<string>',
'lines' => [
[
'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,
'operation_date' => '2025-02-26',
'representative_company_name' => '<string>',
'representative_tax_id_number' => '<string>',
'is_simplified' => false,
'coupon_key' => 'N',
'invoicing_agreement_registration_number' => '<string>',
'sif_agreement_id' => '<string>',
'rectified_base_amount' => 2500.55,
'rectified_quota' => 42.3,
'rectified_equalization_tax_quota' => 5.2,
'replaced_rectified_invoices' => [
[
'tax_id_number' => '<string>',
'full_invoice_number' => '<string>',
'invoice_date' => '2025-02-26'
]
],
'substituted_invoices' => [
[
'tax_id_number' => '<string>',
'full_invoice_number' => '<string>',
'invoice_date' => '2025-02-26'
]
]
],
'callback_url' => 'https://www.tuempresa.com/kubifactu/callback',
'recipients' => [
[
'full_name' => '<string>',
'tax_id_number' => '<string>',
'other_id_country_code' => '<string>',
'other_id_card_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/invoicing/invoices"
payload := strings.NewReader("{\n \"sif_id\": \"9db0bca1-187e-4cf4-b87c-96f2044008d7\",\n \"sender_data\": {\n \"sender_full_name\": \"<string>\",\n \"sender_id_card_number\": \"<string>\"\n },\n \"invoice_data\": {\n \"invoice_type_key\": \"F1\",\n \"fiscal_year\": 2025,\n \"series_code\": \"2025\",\n \"invoice_number\": \"00021\",\n \"invoice_datetime\": \"2025-02-26 12:35:44\",\n \"description\": \"<string>\",\n \"lines\": [\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 \"operation_date\": \"2025-02-26\",\n \"representative_company_name\": \"<string>\",\n \"representative_tax_id_number\": \"<string>\",\n \"is_simplified\": false,\n \"coupon_key\": \"N\",\n \"invoicing_agreement_registration_number\": \"<string>\",\n \"sif_agreement_id\": \"<string>\",\n \"rectified_base_amount\": 2500.55,\n \"rectified_quota\": 42.3,\n \"rectified_equalization_tax_quota\": 5.2,\n \"replaced_rectified_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"invoice_date\": \"2025-02-26\"\n }\n ],\n \"substituted_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"invoice_date\": \"2025-02-26\"\n }\n ]\n },\n \"callback_url\": \"https://www.tuempresa.com/kubifactu/callback\",\n \"recipients\": [\n {\n \"full_name\": \"<string>\",\n \"tax_id_number\": \"<string>\",\n \"other_id_country_code\": \"<string>\",\n \"other_id_card_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/invoicing/invoices")
.header("X-Qbikode-ClientApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sif_id\": \"9db0bca1-187e-4cf4-b87c-96f2044008d7\",\n \"sender_data\": {\n \"sender_full_name\": \"<string>\",\n \"sender_id_card_number\": \"<string>\"\n },\n \"invoice_data\": {\n \"invoice_type_key\": \"F1\",\n \"fiscal_year\": 2025,\n \"series_code\": \"2025\",\n \"invoice_number\": \"00021\",\n \"invoice_datetime\": \"2025-02-26 12:35:44\",\n \"description\": \"<string>\",\n \"lines\": [\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 \"operation_date\": \"2025-02-26\",\n \"representative_company_name\": \"<string>\",\n \"representative_tax_id_number\": \"<string>\",\n \"is_simplified\": false,\n \"coupon_key\": \"N\",\n \"invoicing_agreement_registration_number\": \"<string>\",\n \"sif_agreement_id\": \"<string>\",\n \"rectified_base_amount\": 2500.55,\n \"rectified_quota\": 42.3,\n \"rectified_equalization_tax_quota\": 5.2,\n \"replaced_rectified_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"invoice_date\": \"2025-02-26\"\n }\n ],\n \"substituted_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"invoice_date\": \"2025-02-26\"\n }\n ]\n },\n \"callback_url\": \"https://www.tuempresa.com/kubifactu/callback\",\n \"recipients\": [\n {\n \"full_name\": \"<string>\",\n \"tax_id_number\": \"<string>\",\n \"other_id_country_code\": \"<string>\",\n \"other_id_card_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kubifactu.com/api/invoicing/invoices")
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 \"sif_id\": \"9db0bca1-187e-4cf4-b87c-96f2044008d7\",\n \"sender_data\": {\n \"sender_full_name\": \"<string>\",\n \"sender_id_card_number\": \"<string>\"\n },\n \"invoice_data\": {\n \"invoice_type_key\": \"F1\",\n \"fiscal_year\": 2025,\n \"series_code\": \"2025\",\n \"invoice_number\": \"00021\",\n \"invoice_datetime\": \"2025-02-26 12:35:44\",\n \"description\": \"<string>\",\n \"lines\": [\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 \"operation_date\": \"2025-02-26\",\n \"representative_company_name\": \"<string>\",\n \"representative_tax_id_number\": \"<string>\",\n \"is_simplified\": false,\n \"coupon_key\": \"N\",\n \"invoicing_agreement_registration_number\": \"<string>\",\n \"sif_agreement_id\": \"<string>\",\n \"rectified_base_amount\": 2500.55,\n \"rectified_quota\": 42.3,\n \"rectified_equalization_tax_quota\": 5.2,\n \"replaced_rectified_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"invoice_date\": \"2025-02-26\"\n }\n ],\n \"substituted_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"invoice_date\": \"2025-02-26\"\n }\n ]\n },\n \"callback_url\": \"https://www.tuempresa.com/kubifactu/callback\",\n \"recipients\": [\n {\n \"full_name\": \"<string>\",\n \"tax_id_number\": \"<string>\",\n \"other_id_country_code\": \"<string>\",\n \"other_id_card_id\": \"<string>\"\n }\n ]\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",
"fiscal_year": 123,
"full_invoice_number": "<string>",
"created_at": "2025-09-15T07:35:24.992854Z",
"fingerprint": "<string>",
"csv": "<string>",
"has_warnings": false,
"vf_error_descriptions": "<string>",
"next_request_waiting_time": 123,
"next_request_datetime": "1977-04-22T06:00:00Z",
"qr_value": "<string>",
"qr_image_url": "<string>",
"xml_url": "<string>",
"vf_response_body": "aSDinaTvuI8gbWludGxpZnk="
}
}{
"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 lines. Calculated total quota: [26.25]."
],
"incorrect_total_amount": [
"The total amount of the invoice does not match the total tax base of the lines. Calculated total amount: [151.25]."
]
},
"details": {
"request_id": "9ded9e2c-d59e-4432-a926-652cbcfac365"
}
}
}
}Enviar registro de facturación
Generación de un nuevo registro de facturación.
curl --request POST \
--url https://api.kubifactu.com/api/invoicing/invoices \
--header 'Content-Type: application/json' \
--header 'X-Qbikode-ClientApiKey: <api-key>' \
--data '
{
"sif_id": "9db0bca1-187e-4cf4-b87c-96f2044008d7",
"sender_data": {
"sender_full_name": "<string>",
"sender_id_card_number": "<string>"
},
"invoice_data": {
"invoice_type_key": "F1",
"fiscal_year": 2025,
"series_code": "2025",
"invoice_number": "00021",
"invoice_datetime": "2025-02-26 12:35:44",
"description": "<string>",
"lines": [
{
"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,
"operation_date": "2025-02-26",
"representative_company_name": "<string>",
"representative_tax_id_number": "<string>",
"is_simplified": false,
"coupon_key": "N",
"invoicing_agreement_registration_number": "<string>",
"sif_agreement_id": "<string>",
"rectified_base_amount": 2500.55,
"rectified_quota": 42.3,
"rectified_equalization_tax_quota": 5.2,
"replaced_rectified_invoices": [
{
"tax_id_number": "<string>",
"full_invoice_number": "<string>",
"invoice_date": "2025-02-26"
}
],
"substituted_invoices": [
{
"tax_id_number": "<string>",
"full_invoice_number": "<string>",
"invoice_date": "2025-02-26"
}
]
},
"callback_url": "https://www.tuempresa.com/kubifactu/callback",
"recipients": [
{
"full_name": "<string>",
"tax_id_number": "<string>",
"other_id_country_code": "<string>",
"other_id_card_id": "<string>"
}
]
}
'import requests
url = "https://api.kubifactu.com/api/invoicing/invoices"
payload = {
"sif_id": "9db0bca1-187e-4cf4-b87c-96f2044008d7",
"sender_data": {
"sender_full_name": "<string>",
"sender_id_card_number": "<string>"
},
"invoice_data": {
"invoice_type_key": "F1",
"fiscal_year": 2025,
"series_code": "2025",
"invoice_number": "00021",
"invoice_datetime": "2025-02-26 12:35:44",
"description": "<string>",
"lines": [
{
"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,
"operation_date": "2025-02-26",
"representative_company_name": "<string>",
"representative_tax_id_number": "<string>",
"is_simplified": False,
"coupon_key": "N",
"invoicing_agreement_registration_number": "<string>",
"sif_agreement_id": "<string>",
"rectified_base_amount": 2500.55,
"rectified_quota": 42.3,
"rectified_equalization_tax_quota": 5.2,
"replaced_rectified_invoices": [
{
"tax_id_number": "<string>",
"full_invoice_number": "<string>",
"invoice_date": "2025-02-26"
}
],
"substituted_invoices": [
{
"tax_id_number": "<string>",
"full_invoice_number": "<string>",
"invoice_date": "2025-02-26"
}
]
},
"callback_url": "https://www.tuempresa.com/kubifactu/callback",
"recipients": [
{
"full_name": "<string>",
"tax_id_number": "<string>",
"other_id_country_code": "<string>",
"other_id_card_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({
sif_id: '9db0bca1-187e-4cf4-b87c-96f2044008d7',
sender_data: {sender_full_name: '<string>', sender_id_card_number: '<string>'},
invoice_data: {
invoice_type_key: 'F1',
fiscal_year: 2025,
series_code: '2025',
invoice_number: '00021',
invoice_datetime: '2025-02-26 12:35:44',
description: '<string>',
lines: [
{
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,
operation_date: '2025-02-26',
representative_company_name: '<string>',
representative_tax_id_number: '<string>',
is_simplified: false,
coupon_key: 'N',
invoicing_agreement_registration_number: '<string>',
sif_agreement_id: '<string>',
rectified_base_amount: 2500.55,
rectified_quota: 42.3,
rectified_equalization_tax_quota: 5.2,
replaced_rectified_invoices: [
{
tax_id_number: '<string>',
full_invoice_number: '<string>',
invoice_date: '2025-02-26'
}
],
substituted_invoices: [
{
tax_id_number: '<string>',
full_invoice_number: '<string>',
invoice_date: '2025-02-26'
}
]
},
callback_url: 'https://www.tuempresa.com/kubifactu/callback',
recipients: [
{
full_name: '<string>',
tax_id_number: '<string>',
other_id_country_code: '<string>',
other_id_card_id: '<string>'
}
]
})
};
fetch('https://api.kubifactu.com/api/invoicing/invoices', 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",
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([
'sif_id' => '9db0bca1-187e-4cf4-b87c-96f2044008d7',
'sender_data' => [
'sender_full_name' => '<string>',
'sender_id_card_number' => '<string>'
],
'invoice_data' => [
'invoice_type_key' => 'F1',
'fiscal_year' => 2025,
'series_code' => '2025',
'invoice_number' => '00021',
'invoice_datetime' => '2025-02-26 12:35:44',
'description' => '<string>',
'lines' => [
[
'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,
'operation_date' => '2025-02-26',
'representative_company_name' => '<string>',
'representative_tax_id_number' => '<string>',
'is_simplified' => false,
'coupon_key' => 'N',
'invoicing_agreement_registration_number' => '<string>',
'sif_agreement_id' => '<string>',
'rectified_base_amount' => 2500.55,
'rectified_quota' => 42.3,
'rectified_equalization_tax_quota' => 5.2,
'replaced_rectified_invoices' => [
[
'tax_id_number' => '<string>',
'full_invoice_number' => '<string>',
'invoice_date' => '2025-02-26'
]
],
'substituted_invoices' => [
[
'tax_id_number' => '<string>',
'full_invoice_number' => '<string>',
'invoice_date' => '2025-02-26'
]
]
],
'callback_url' => 'https://www.tuempresa.com/kubifactu/callback',
'recipients' => [
[
'full_name' => '<string>',
'tax_id_number' => '<string>',
'other_id_country_code' => '<string>',
'other_id_card_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/invoicing/invoices"
payload := strings.NewReader("{\n \"sif_id\": \"9db0bca1-187e-4cf4-b87c-96f2044008d7\",\n \"sender_data\": {\n \"sender_full_name\": \"<string>\",\n \"sender_id_card_number\": \"<string>\"\n },\n \"invoice_data\": {\n \"invoice_type_key\": \"F1\",\n \"fiscal_year\": 2025,\n \"series_code\": \"2025\",\n \"invoice_number\": \"00021\",\n \"invoice_datetime\": \"2025-02-26 12:35:44\",\n \"description\": \"<string>\",\n \"lines\": [\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 \"operation_date\": \"2025-02-26\",\n \"representative_company_name\": \"<string>\",\n \"representative_tax_id_number\": \"<string>\",\n \"is_simplified\": false,\n \"coupon_key\": \"N\",\n \"invoicing_agreement_registration_number\": \"<string>\",\n \"sif_agreement_id\": \"<string>\",\n \"rectified_base_amount\": 2500.55,\n \"rectified_quota\": 42.3,\n \"rectified_equalization_tax_quota\": 5.2,\n \"replaced_rectified_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"invoice_date\": \"2025-02-26\"\n }\n ],\n \"substituted_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"invoice_date\": \"2025-02-26\"\n }\n ]\n },\n \"callback_url\": \"https://www.tuempresa.com/kubifactu/callback\",\n \"recipients\": [\n {\n \"full_name\": \"<string>\",\n \"tax_id_number\": \"<string>\",\n \"other_id_country_code\": \"<string>\",\n \"other_id_card_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/invoicing/invoices")
.header("X-Qbikode-ClientApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sif_id\": \"9db0bca1-187e-4cf4-b87c-96f2044008d7\",\n \"sender_data\": {\n \"sender_full_name\": \"<string>\",\n \"sender_id_card_number\": \"<string>\"\n },\n \"invoice_data\": {\n \"invoice_type_key\": \"F1\",\n \"fiscal_year\": 2025,\n \"series_code\": \"2025\",\n \"invoice_number\": \"00021\",\n \"invoice_datetime\": \"2025-02-26 12:35:44\",\n \"description\": \"<string>\",\n \"lines\": [\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 \"operation_date\": \"2025-02-26\",\n \"representative_company_name\": \"<string>\",\n \"representative_tax_id_number\": \"<string>\",\n \"is_simplified\": false,\n \"coupon_key\": \"N\",\n \"invoicing_agreement_registration_number\": \"<string>\",\n \"sif_agreement_id\": \"<string>\",\n \"rectified_base_amount\": 2500.55,\n \"rectified_quota\": 42.3,\n \"rectified_equalization_tax_quota\": 5.2,\n \"replaced_rectified_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"invoice_date\": \"2025-02-26\"\n }\n ],\n \"substituted_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"invoice_date\": \"2025-02-26\"\n }\n ]\n },\n \"callback_url\": \"https://www.tuempresa.com/kubifactu/callback\",\n \"recipients\": [\n {\n \"full_name\": \"<string>\",\n \"tax_id_number\": \"<string>\",\n \"other_id_country_code\": \"<string>\",\n \"other_id_card_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kubifactu.com/api/invoicing/invoices")
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 \"sif_id\": \"9db0bca1-187e-4cf4-b87c-96f2044008d7\",\n \"sender_data\": {\n \"sender_full_name\": \"<string>\",\n \"sender_id_card_number\": \"<string>\"\n },\n \"invoice_data\": {\n \"invoice_type_key\": \"F1\",\n \"fiscal_year\": 2025,\n \"series_code\": \"2025\",\n \"invoice_number\": \"00021\",\n \"invoice_datetime\": \"2025-02-26 12:35:44\",\n \"description\": \"<string>\",\n \"lines\": [\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 \"operation_date\": \"2025-02-26\",\n \"representative_company_name\": \"<string>\",\n \"representative_tax_id_number\": \"<string>\",\n \"is_simplified\": false,\n \"coupon_key\": \"N\",\n \"invoicing_agreement_registration_number\": \"<string>\",\n \"sif_agreement_id\": \"<string>\",\n \"rectified_base_amount\": 2500.55,\n \"rectified_quota\": 42.3,\n \"rectified_equalization_tax_quota\": 5.2,\n \"replaced_rectified_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"invoice_date\": \"2025-02-26\"\n }\n ],\n \"substituted_invoices\": [\n {\n \"tax_id_number\": \"<string>\",\n \"full_invoice_number\": \"<string>\",\n \"invoice_date\": \"2025-02-26\"\n }\n ]\n },\n \"callback_url\": \"https://www.tuempresa.com/kubifactu/callback\",\n \"recipients\": [\n {\n \"full_name\": \"<string>\",\n \"tax_id_number\": \"<string>\",\n \"other_id_country_code\": \"<string>\",\n \"other_id_card_id\": \"<string>\"\n }\n ]\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",
"fiscal_year": 123,
"full_invoice_number": "<string>",
"created_at": "2025-09-15T07:35:24.992854Z",
"fingerprint": "<string>",
"csv": "<string>",
"has_warnings": false,
"vf_error_descriptions": "<string>",
"next_request_waiting_time": 123,
"next_request_datetime": "1977-04-22T06:00:00Z",
"qr_value": "<string>",
"qr_image_url": "<string>",
"xml_url": "<string>",
"vf_response_body": "aSDinaTvuI8gbWludGxpZnk="
}
}{
"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 lines. Calculated total quota: [26.25]."
],
"incorrect_total_amount": [
"The total amount of the invoice does not match the total tax base of the lines. 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.
Body
ID del SIF que se quiere utilizar para el envío de la factura. Los SIFs se pueden registrar en el panel web de KubiFACTU.
Un SIF puede procesar registros de facturación de diferentes empresas.
Una empresa puede tener uno o varios SIFs. Por ejemplo, una empresa con varias tiendas puede operar con un SIF por cada establecimiento, de forma que el encadenamiento/trazabilidad de las facturas se trate por separado.
"9db0bca1-187e-4cf4-b87c-96f2044008d7"
Información referente al emisor de la factura.
Show child attributes
Show child attributes
Datos del registro de facturación.
Show child attributes
Show child attributes
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 un array en formato JSON con los datos de las facturas procesadas cuyos ítems contendrán los siguientes campos:
id:string. Identificador de KubiFACTU 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.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"
Información de los receptores de la factura. Obligatorio para facturas ordinarias.
Show child attributes
Show child attributes
Response
Factura enviada con éxito.
Show child attributes
Show child attributes