curl --request POST \
--url https://api.kubifactu.com/api/clientcompanies/{companyId}/authorization-documents \
--header 'Content-Type: multipart/form-data' \
--header 'X-Qbikode-UserApiKey: <api-key>' \
--form authorization_document='@example-file' \
--form identity_document='@example-file' \
--form authorization_document_has_digital_signature=trueimport requests
url = "https://api.kubifactu.com/api/clientcompanies/{companyId}/authorization-documents"
files = {
"authorization_document": ("example-file", open("example-file", "rb")),
"identity_document": ("example-file", open("example-file", "rb"))
}
payload = { "authorization_document_has_digital_signature": "true" }
headers = {"X-Qbikode-UserApiKey": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('authorization_document', '<string>');
form.append('identity_document', '<string>');
form.append('authorization_document_has_digital_signature', 'true');
const options = {method: 'POST', headers: {'X-Qbikode-UserApiKey': '<api-key>'}};
options.body = form;
fetch('https://api.kubifactu.com/api/clientcompanies/{companyId}/authorization-documents', 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/clientcompanies/{companyId}/authorization-documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"authorization_document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"identity_document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"authorization_document_has_digital_signature\"\r\n\r\ntrue\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"X-Qbikode-UserApiKey: <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/clientcompanies/{companyId}/authorization-documents"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"authorization_document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"identity_document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"authorization_document_has_digital_signature\"\r\n\r\ntrue\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Qbikode-UserApiKey", "<api-key>")
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/clientcompanies/{companyId}/authorization-documents")
.header("X-Qbikode-UserApiKey", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"authorization_document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"identity_document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"authorization_document_has_digital_signature\"\r\n\r\ntrue\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kubifactu.com/api/clientcompanies/{companyId}/authorization-documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Qbikode-UserApiKey"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"authorization_document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"identity_document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"authorization_document_has_digital_signature\"\r\n\r\ntrue\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"data": {
"message": "Documents uploaded successfully.",
"authorization_document": "auth_20260129153045.pdf",
"identity_document": "identity_20260129153046.jpg"
}
}{
"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"
}
}
}
}Subir documentos de autorización
Sube documentos de autorización y/o identidad para una empresa cliente.
Este endpoint permite subir uno o ambos documentos simultáneamente:
- Solo documento de autorización
- Solo documento de identidad
- Ambos documentos a la vez
- Documento de autorización con indicador de firma digital del cliente (
authorization_document_has_digital_signature)
El campo authorization_document_has_digital_signature puede enviarse junto con authorization_document.
Si se sube solo identity_document, este indicador no aplica.
Nota: Este endpoint solo está disponible para intermediarios que NO usen su propio certificado digital.
curl --request POST \
--url https://api.kubifactu.com/api/clientcompanies/{companyId}/authorization-documents \
--header 'Content-Type: multipart/form-data' \
--header 'X-Qbikode-UserApiKey: <api-key>' \
--form authorization_document='@example-file' \
--form identity_document='@example-file' \
--form authorization_document_has_digital_signature=trueimport requests
url = "https://api.kubifactu.com/api/clientcompanies/{companyId}/authorization-documents"
files = {
"authorization_document": ("example-file", open("example-file", "rb")),
"identity_document": ("example-file", open("example-file", "rb"))
}
payload = { "authorization_document_has_digital_signature": "true" }
headers = {"X-Qbikode-UserApiKey": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('authorization_document', '<string>');
form.append('identity_document', '<string>');
form.append('authorization_document_has_digital_signature', 'true');
const options = {method: 'POST', headers: {'X-Qbikode-UserApiKey': '<api-key>'}};
options.body = form;
fetch('https://api.kubifactu.com/api/clientcompanies/{companyId}/authorization-documents', 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/clientcompanies/{companyId}/authorization-documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"authorization_document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"identity_document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"authorization_document_has_digital_signature\"\r\n\r\ntrue\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"X-Qbikode-UserApiKey: <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/clientcompanies/{companyId}/authorization-documents"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"authorization_document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"identity_document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"authorization_document_has_digital_signature\"\r\n\r\ntrue\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Qbikode-UserApiKey", "<api-key>")
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/clientcompanies/{companyId}/authorization-documents")
.header("X-Qbikode-UserApiKey", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"authorization_document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"identity_document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"authorization_document_has_digital_signature\"\r\n\r\ntrue\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kubifactu.com/api/clientcompanies/{companyId}/authorization-documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Qbikode-UserApiKey"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"authorization_document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"identity_document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"authorization_document_has_digital_signature\"\r\n\r\ntrue\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"data": {
"message": "Documents uploaded successfully.",
"authorization_document": "auth_20260129153045.pdf",
"identity_document": "identity_20260129153046.jpg"
}
}{
"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 del intermediario que hace la petición. Este dato se puede consultar en el panel web, en la página de Perfil de usuario.
Path Parameters
ID de la empresa cliente.
Body
Al menos uno de los dos documentos es requerido.
El campo authorization_document_has_digital_signature permite indicar firma digital en el documento de autorización y, en ese caso, considerar opcional el documento de identidad para la lógica de completitud.
Documento de autorización firmado. Formatos permitidos: PDF, JPG, JPEG, PNG. Tamaño máximo: 25MB.
Documento de identidad del representante legal. Sólo necesario si el documento de autorización no está firmado digitalmente por el cliente. Formatos permitidos: PDF, JPG, JPEG, PNG. Tamaño máximo: 25MB.
Indicador de que el documento de autorización está firmado digitalmente con el certificado digital del cliente.
Solo se tiene en cuenta cuando se envía authorization_document.
Response
Documento(s) subido(s) con éxito.
Show child attributes
Show child attributes