## Customers - Update customer

`PUT`  https://{entorno}.ticketbaiws.eus/clientes/{id}/

These are the customers and products of the company's **invoicing tool**  in the private area. They are meant for looking up the customer and the products before issuing an invoice with [POST /tbai/](https://ticketbaiws.eus/en/ticketbai-post/): the field names match those of the invoice (nombre, nif, pais_cliente, importe_unitario, tipo_iva, tipo_req...).

**They do not depend on the environment:**  with the test token (**api-test** ) you read and modify the same data as with the production token.

Partial update: only the fields sent are changed.

**PARAMETERS**

- `nombre` (string, optional): Name or registered (legal) name. Alias: **nombre_social**. Ejemplo: `Empresa de ejemplo S.L.`
- `nif` (string, optional): Customer's NIF (Spanish tax ID). Stored without spaces, dots or hyphens. It cannot be repeated in another customer; if there is no NIF, the name cannot be repeated. Ejemplo: `B01000012`
- `nombre_comercial` (string, optional): Trade name. When creating the customer, defaults to the name. Ejemplo: `Ejemplo`
- `tipo_documento` (string, optional): ID document type for foreign customers: 02 NIF-IVA (EU VAT number, default), 03 passport, 04 official ID document issued by the country of residence, 05 certificate of residence, 06 other document. Ejemplo: `02`
- `direccion` (string, optional): Address. Ejemplo: `Calle Mayor 1`
- `cp` (string, optional): Postal code. Ejemplo: `48001`
- `poblacion` (string, optional): Town/city. Ejemplo: `Bilbao`
- `provincia` (string, optional): Province. Ejemplo: `Bizkaia`
- `pais` (string, optional): Country: ISO 3166 alpha-2 code or name. Alias: **pais_cliente**. Ejemplo: `ES`
- `email` (string, optional): Email. Ejemplo: `facturas@ejemplo.com`
- `telefono` (string, optional): Phone. Ejemplo: `944000000`
- `web` (string, optional): Website. Ejemplo: `https://...`

**PUT** `https://{entorno}.ticketbaiws.eus/clientes/{id}/`

```bash
$ curl --request PUT \
     --url https://api-test.ticketbaiws.eus/clientes/1532/ \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'Token: xxx' \
     --header 'Nif: 00000014Z' \
     --data '
{
    "email": "contabilidad@ejemplo.com",
    "telefono": "944111111"
}'
```

Respuesta:

```json
HTTP/1.1 200 OK
{
    "result": "OK",
    "return": {
        "id": 1532,
        "nif": "B01000012",
        "tipo_documento": "02",
        "nombre": "Empresa de ejemplo S.L.",
        "nombre_comercial": "Ejemplo",
        "direccion": "Calle Mayor 1",
        "cp": "48001",
        "poblacion": "Bilbao",
        "provincia": "Bizkaia",
        "pais": "España",
        "pais_cliente": "ES",
        "email": "contabilidad@ejemplo.com",
        "telefono": "944111111",
        "web": "https://www.ejemplo.com",
        "fecha_alta": "28/11/2026"
    },
    "msg": ""
}
```

Response (not found):

```json
HTTP/1.1 200 OK
{
    "result": "ERROR",
    "return": null,
    "msg": "Client not found"
}
```

Fuente: https://ticketbaiws.eus/en/clientes-put/
