Cambiar la versión de un SIF
curl --request PATCH \
--url https://api.kubifactu.com/api/sifs/{sifId} \
--header 'Content-Type: application/json' \
--header 'X-Qbikode-UserApiKey: <api-key>' \
--data '
{
"version": "2.0.0"
}
'import requests
url = "https://api.kubifactu.com/api/sifs/{sifId}"
payload = { "version": "2.0.0" }
headers = {
"X-Qbikode-UserApiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Qbikode-UserApiKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({version: '2.0.0'})
};
fetch('https://api.kubifactu.com/api/sifs/{sifId}', 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/sifs/{sifId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'version' => '2.0.0'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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/sifs/{sifId}"
payload := strings.NewReader("{\n \"version\": \"2.0.0\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Qbikode-UserApiKey", "<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.patch("https://api.kubifactu.com/api/sifs/{sifId}")
.header("X-Qbikode-UserApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"version\": \"2.0.0\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kubifactu.com/api/sifs/{sifId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Qbikode-UserApiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version\": \"2.0.0\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "9dccd6c6-08f8-490d-a370-bfef724c0855",
"company_name": "Empresa de ejemplo",
"tax_id_number": "S6271969E",
"other_country_code": "<string>",
"other_tax_id_type_key": "02",
"other_tax_id_number": "<string>",
"name": "SIF 0001",
"sif_id": "DC",
"version": "1.0.0",
"installation_number": "BM1WJ36SS5MOL6LWPLHTMBFUOTQO5TNDU2ILL34JG6FLSVAUMD1I0G41AS7PC870QAHHIOWJSBPKRB2XELRCUWO4TSJ8XY0UPAML",
"only_verifactu_use_key": "S",
"multi_ot_key": "N",
"supporting_multiple_ots_key": "N"
}
}
API Reference
Cambiar la versión de un SIF
Cambia la versión de un SIF de intermediario o de empresa. El SIF conserva su UUID, su número de instalación y la cadena de registros de cada empresa.
Cada registro de facturación guarda la versión vigente cuando se generó y la declara siempre en SistemaInformatico/Version, también al reenviarlo. Las anulaciones y subsanaciones que se generen después del cambio llevan la versión nueva.
Solo se puede cambiar la versión. Si el cuerpo incluye cualquier otro campo, la API responde 422 y no cambia nada.
PATCH
/
api
/
sifs
/
{sifId}
Cambiar la versión de un SIF
curl --request PATCH \
--url https://api.kubifactu.com/api/sifs/{sifId} \
--header 'Content-Type: application/json' \
--header 'X-Qbikode-UserApiKey: <api-key>' \
--data '
{
"version": "2.0.0"
}
'import requests
url = "https://api.kubifactu.com/api/sifs/{sifId}"
payload = { "version": "2.0.0" }
headers = {
"X-Qbikode-UserApiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Qbikode-UserApiKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({version: '2.0.0'})
};
fetch('https://api.kubifactu.com/api/sifs/{sifId}', 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/sifs/{sifId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'version' => '2.0.0'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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/sifs/{sifId}"
payload := strings.NewReader("{\n \"version\": \"2.0.0\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Qbikode-UserApiKey", "<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.patch("https://api.kubifactu.com/api/sifs/{sifId}")
.header("X-Qbikode-UserApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"version\": \"2.0.0\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kubifactu.com/api/sifs/{sifId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Qbikode-UserApiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version\": \"2.0.0\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "9dccd6c6-08f8-490d-a370-bfef724c0855",
"company_name": "Empresa de ejemplo",
"tax_id_number": "S6271969E",
"other_country_code": "<string>",
"other_tax_id_type_key": "02",
"other_tax_id_number": "<string>",
"name": "SIF 0001",
"sif_id": "DC",
"version": "1.0.0",
"installation_number": "BM1WJ36SS5MOL6LWPLHTMBFUOTQO5TNDU2ILL34JG6FLSVAUMD1I0G41AS7PC870QAHHIOWJSBPKRB2XELRCUWO4TSJ8XY0UPAML",
"only_verifactu_use_key": "S",
"multi_ot_key": "N",
"supporting_multiple_ots_key": "N"
}
}
Authorizations
Body
application/json