## New company

`POST`  https://api.ticketbaiws.eus/empresas/

This method creates a new company record for sending TicketBAI invoices

**PARAMETERS**

- `id_licencia` (integer, optional): ID of the license to link the company to. If omitted, the first free license is used or a new one is created. Ejemplo: `999`
- `nombre_social` (string, required): Company's registered (legal) name. Ejemplo: `Empresa de ejemplo S.L.`
- `nombre_comercial` (string, optional): Company's trade name. Ejemplo: `Neumáticos Pepe`
- `nif` (string, required): Company's NIF (Spanish tax ID) Ejemplo: `B01000012`
- `direccion` (string, required): Company's registered address. Ejemplo: `Calle de ejemplo 123`
- `poblacion` (string, required): Company's registered town/city. Ejemplo: `Vitoria-Gasteiz`
- `provincia` (string, required): Company's registered province. Ejemplo: `Álava`
- `cp` (string, required): Company's registered postal code. Ejemplo: `01001`
- `email` (string, optional): Company's contact email. Ejemplo: `info@ejemplo.com`
- `web` (string, optional): Company's website address. Ejemplo: `www.ejemplo.com`
- `epigrafe` (string, required in Bizkaia only for self-employed individuals, CBs (comunidades de bienes) and SCs (sociedades civiles)): IAE activity code. Ejemplo: `301800`
- `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: full invoices issued to Spanish customers with a NIF are sent, and received invoices are downloaded. See [SPFE methods](https://ticketbaiws.eus/en/spfe-recibidas-get/) Ejemplo: `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: each invoice is recorded within 4 working days (in the Basque Country and Navarre, once the regional tax authority accepts it). See [GET sii-envios](https://ticketbaiws.eus/en/sii-envios-get/) Ejemplo: `true`

**POST** `https://api.ticketbaiws.eus/empresas/`

```bash
$ curl --request POST \
     --url https://api.ticketbaiws.eus/empresas/ \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'Token: xxx' \
     --header 'Nif: 00000014Z'
	 --data '
{
    "id_licencia": "0",
    "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",
    "diputacion": 1,
    "epigrafe" : "301800"
}'
```

Respuesta:

```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",
        "diputacion": 1,
        "token": "xxx",
        "token_test": "xxx"
    },
	"msg": null
}
```

Fuente: https://ticketbaiws.eus/en/empresas-post/
