Editar empresa
curl --request POST \
--url https://api.kubifactu.com/api/clientcompanies/{companyId} \
--header 'Content-Type: application/json' \
--header 'X-Qbikode-UserApiKey: <api-key>' \
--data '
{
"company_name": "Empresa de ejemplo",
"tax_id_number": "S6271969E",
"email": "[email protected]"
}
'import requests
url = "https://api.kubifactu.com/api/clientcompanies/{companyId}"
payload = {
"company_name": "Empresa de ejemplo",
"tax_id_number": "S6271969E",
"email": "[email protected]"
}
headers = {
"X-Qbikode-UserApiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Qbikode-UserApiKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
company_name: 'Empresa de ejemplo',
tax_id_number: 'S6271969E',
email: '[email protected]'
})
};
fetch('https://api.kubifactu.com/api/clientcompanies/{companyId}', 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}",
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([
'company_name' => 'Empresa de ejemplo',
'tax_id_number' => 'S6271969E',
'email' => '[email protected]'
]),
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/clientcompanies/{companyId}"
payload := strings.NewReader("{\n \"company_name\": \"Empresa de ejemplo\",\n \"tax_id_number\": \"S6271969E\",\n \"email\": \"[email protected]\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.kubifactu.com/api/clientcompanies/{companyId}")
.header("X-Qbikode-UserApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"company_name\": \"Empresa de ejemplo\",\n \"tax_id_number\": \"S6271969E\",\n \"email\": \"[email protected]\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kubifactu.com/api/clientcompanies/{companyId}")
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["Content-Type"] = 'application/json'
request.body = "{\n \"company_name\": \"Empresa de ejemplo\",\n \"tax_id_number\": \"S6271969E\",\n \"email\": \"[email protected]\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "9dcccd85-496d-4ed8-8f78-edfacac68964",
"company_name": "Empresa de ejemplo",
"tax_id_number": "S6271969E",
"email": "[email protected]",
"api_key": "Xxv3en85OJOtI7Q6XFNGuA3FPwDNsnhk1kbtlQ5RgRSAdoo47eSGGYbgfLs8Qf2obGJluvY28a0tIqeM1UjzdbHDSDp1Q0fNX9sz"
}
}{
"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"
}
}
}
}API Reference
Editar empresa
Edición de los datos de una empresa.
POST
/
api
/
clientcompanies
/
{companyId}
Editar empresa
curl --request POST \
--url https://api.kubifactu.com/api/clientcompanies/{companyId} \
--header 'Content-Type: application/json' \
--header 'X-Qbikode-UserApiKey: <api-key>' \
--data '
{
"company_name": "Empresa de ejemplo",
"tax_id_number": "S6271969E",
"email": "[email protected]"
}
'import requests
url = "https://api.kubifactu.com/api/clientcompanies/{companyId}"
payload = {
"company_name": "Empresa de ejemplo",
"tax_id_number": "S6271969E",
"email": "[email protected]"
}
headers = {
"X-Qbikode-UserApiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Qbikode-UserApiKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
company_name: 'Empresa de ejemplo',
tax_id_number: 'S6271969E',
email: '[email protected]'
})
};
fetch('https://api.kubifactu.com/api/clientcompanies/{companyId}', 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}",
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([
'company_name' => 'Empresa de ejemplo',
'tax_id_number' => 'S6271969E',
'email' => '[email protected]'
]),
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/clientcompanies/{companyId}"
payload := strings.NewReader("{\n \"company_name\": \"Empresa de ejemplo\",\n \"tax_id_number\": \"S6271969E\",\n \"email\": \"[email protected]\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.kubifactu.com/api/clientcompanies/{companyId}")
.header("X-Qbikode-UserApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"company_name\": \"Empresa de ejemplo\",\n \"tax_id_number\": \"S6271969E\",\n \"email\": \"[email protected]\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kubifactu.com/api/clientcompanies/{companyId}")
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["Content-Type"] = 'application/json'
request.body = "{\n \"company_name\": \"Empresa de ejemplo\",\n \"tax_id_number\": \"S6271969E\",\n \"email\": \"[email protected]\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "9dcccd85-496d-4ed8-8f78-edfacac68964",
"company_name": "Empresa de ejemplo",
"tax_id_number": "S6271969E",
"email": "[email protected]",
"api_key": "Xxv3en85OJOtI7Q6XFNGuA3FPwDNsnhk1kbtlQ5RgRSAdoo47eSGGYbgfLs8Qf2obGJluvY28a0tIqeM1UjzdbHDSDp1Q0fNX9sz"
}
}{
"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 a editar.
Body
application/json
Nombre de la empresa.
Example:
"Empresa de ejemplo"
NIF/CIF de la empresa.
Example:
"S6271969E"
Correo electrónico de la empresa.
Example:
Response
Empresa creada con éxito.
Show child attributes
Show child attributes
⌘I