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
- POST New invoice / resubmission (zuzendu) TicketBAI / Verifactu
- POST Complete a simplified invoice
- GET Get a TicketBAI / Verifactu invoice
- GET List TicketBAI / Verifactu invoices
- GET Download TicketBAI / Verifactu XML
- GET Download invoice in FacturaE format
- GET Download invoice as PDF
- GET System status
- DEL Cancel a TicketBAI / Verifactu invoice
- PUT Force TicketBAI / Verifactu resend
- POST Validate a NIF with the AEAT
- POST Validate a VAT number in VIES
Representation document
- GET Representation document - Download template
- POST Representation document - Upload document
- GET Representation document - Download uploaded document
- DELETE Representation document - Revoke uploaded document
BATUZ BIZKAIA specific methods
- GET List IAE activity codes
- POST LROE - Received invoices - Submit (BATUZ)
- PUT LROE - Received invoices - Update (BATUZ)
- GET LROE - Received invoices - Query (BATUZ)
- DEL LROE - Received invoices - Cancel (BATUZ)
- POST LROE - Expenses without invoice - Submit (BATUZ, form 140)
- PUT LROE - Expenses without invoice - Update (BATUZ, form 140)
- GET LROE - Expenses without invoice - Query (BATUZ, form 140)
- DEL LROE - Expenses without invoice - Cancel (BATUZ, form 140)
- POST LROE - Cash accounting COLLECTIONS - Submit (BATUZ)
- PUT LROE - Cash accounting COLLECTIONS - Update (BATUZ)
- GET LROE - Cash accounting COLLECTIONS - Query (BATUZ)
- DEL LROE - Cash accounting COLLECTIONS - Cancel (BATUZ)
- POST LROE - Cash accounting PAYMENTS - Submit (BATUZ)
- PUT LROE - Cash accounting PAYMENTS - Update (BATUZ)
- GET LROE - Cash accounting PAYMENTS - Query (BATUZ)
- DEL LROE - Cash accounting PAYMENTS - Cancel (BATUZ)
SII (AEAT)
Customers and products (invoicing tool)
- GET Customers - Search / get customers
- POST Customers - New customer
- PUT Customers - Update customer
- GET Products - Search / get products
