API > Edit company data

Edit company data

PUT  https://api.ticketbaiws.eus/empresas/{NIF}/

This method updates a company record

PARAMETERS

nombre_social string  optional (*)
Company's registered (legal) name
Empresa de ejemplo S.L.
nombre_comercial string optional (*)
Company's trade name
Neumáticos Pepe
direccion string  optional (*)
Company's registered address
Calle de ejemplo 123
poblacion string  optional (*)
Company's registered town/city
Vitoria-Gasteiz
provincia string  optional (*)
Company's registered province
Álava
cp string  optional (*)
Company's registered postal code
01001
email string optional (*)
Company's contact email
info@ejemplo.com
web string optional (*)
Company's website address
www.ejemplo.com
epigrafe string  optional (*)
IAE activity code
301800
autorenovacion string  optional (*)
Auto-renewal of the associated license
true
spfe boolean optional (*)
Submission to the SPFE (Spanish public B2B e-invoicing platform) of the AEAT (Spanish Tax Agency), for B2B electronic invoicing under the Ley Crea y Crece. true enables it from that day on, false disables it. See SPFE methods
true
sii boolean optional (*)
Submission of the issued invoices book to the SII (Immediate Supply of Information) of the AEAT (Spanish Tax Agency), for companies in the common VAT territory (their invoices are no longer sent to Verifactu). true enables it from that day on, false disables it. See GET sii-envios
true

(*) Send only the parameters you want to change

PUT https://api.ticketbaiws.eus/empresas/
$ curl --request PUT \
     --url https://api.ticketbaiws.eus/empresas/B01010101/ \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'Token: xxx' \
     --header 'Nif: 00000014Z'
	 --data '
{
    "nombre_social": "Empresa de ejemplo S.L.",
    "nombre_comercial": "Neumáticos Pepe",
    "direccion": "Calle de ejemplo 123",
    "poblacion": "Vitoria-Gasteiz",
    "provincia": "Álava",
    "cp": "28080",
    "email": "info@ejemplo.com",
    "web": "www.ejemplo.com",
    "epigrafe" : "301800",
    "autorenovacion" : true
}'
$ composer require ticketbaiws/ticketbaiws-php
<?php
// Installation: composer require ticketbaiws/ticketbaiws-php
require 'vendor/autoload.php';

$cuenta = new \TicketbaiWS\Cuenta('xxx', '00000014Z');   // token de desarrollador y NIF de la cuenta

$r = $cuenta->editarEmpresa('B01010101', [
    'nombre_social'    => 'Empresa de ejemplo S.L.',
    'nombre_comercial' => 'Neumáticos Pepe',
    'direccion'        => 'Calle de ejemplo 123',
    'poblacion'        => 'Vitoria-Gasteiz',
    'provincia'        => 'Álava',
    'cp'               => '28080',
    'email'            => 'info@ejemplo.com',
    'web'              => 'www.ejemplo.com',
    'autorenovacion'   => true,
]);

if ($r->isError()) {
    echo $r->getMessageText();
} else {
    print_r($r->getData());
}
$ python -m pip install requests
import requests

url = "https://api.ticketbaiws.eus/empresas/B01010101/"
payload = {
    "nombre_social": "Empresa de ejemplo S.L.",
    "nombre_comercial": "Neumáticos Pepe",
    "direccion": "Calle de ejemplo 123",
    "poblacion": "Vitoria-Gasteiz",
    "provincia": "Álava",
    "cp": "28080",
    "email": "info@ejemplo.com",
    "web": "www.ejemplo.com",
    "epigrafe" : "301800",
    "autorenovacion" : true
}

headers = {"Accept": "application/json", "Token" : "xxx", "Nif" : "00000014Z"}
response = requests.request("PUT", url, json=payload, headers=headers)

print(response.text)
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.ticketbaiws.eus/empresas/B01010101/");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_PUTFIELDS, '{"nombre_social":"Empresa de ejemplo S.L.","nombre_comercial":"Neumáticos Pepe","direccion":"Calle de ejemplo 123","poblacion":"Vitoria-Gasteiz","provincia":"Álava","cp":"28080","email":"info@ejemplo.com","web":"www.ejemplo.com","autorenovacion":true}');

CURLcode ret = curl_easy_perform(hnd);
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{"nombre_social":"Empresa de ejemplo S.L.","nombre_comercial":"Neumáticos Pepe","direccion":"Calle de ejemplo 123","poblacion":"Vitoria-Gasteiz","provincia":"Álava","cp":"28080","email":"info@ejemplo.com","web":"www.ejemplo.com","autorenovacion":true}');

Request request = new Request.Builder()
  .url("https://api.ticketbaiws.eus/empresas/B01010101/")
  .put(body)
  .addHeader("Accept", "application/json")
  .addHeader("Token", "xxx")
  .addHeader("Nif", "00000014Z")
  .build();
  
Response response = client.newCall(request).execute();
{ } Response JSON
HTTP/1.1 200 OK
{ 
	"result": "OK", 
	"return": {
        "id": "999"
        "id_licencia": "999",
        "epigrafe": "",
        "nombre_social": "Empresa de ejemplo S.L.",
        "nombre_comercial": "Neumáticos Pepe",
        "nif": "B01000012",
        "direccion": "Calle de ejemplo 123",
        "poblacion": "Vitoria-Gasteiz",
        "provincia": "Álava",
        "cp": "28080",
        "email": "info@ejemplo.com",
        "web": "www.ejemplo.com",
        "token": "xxx",
        "token_test": "xxx",
        "autorenovacion" : true
    }, 
	"msg": null 
}

TicketBAI / Verifactu methods

Representation document

BATUZ BIZKAIA specific methods

SII (AEAT)

Customers and products (invoicing tool)

Other methods