> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qwoty.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Mettre à jour un client

> Mettre à jour partiellement un client

## Autorisation

<ParamField header="Authorization" type="string" required>
  Jeton Bearer. Format : `Bearer qwoty_your_token`
</ParamField>

## Paramètres de chemin

<ParamField path="id" type="string" required>
  UUID du client à mettre à jour
</ParamField>

## Corps de la requête

Tous les champs sont optionnels. Seuls les champs fournis seront mis à jour.

<ParamField body="name" type="string">
  Nom d'affichage du client
</ParamField>

<ParamField body="type" type="string">
  Type de client. Valeurs autorisées : `"company"`, `"individual"`
</ParamField>

<ParamField body="segment_id" type="string | null">
  UUID du segment client. Définir à `null` pour effacer.
</ParamField>

<ParamField body="logo" type="string | null">
  URL du logo. Définir à `null` pour effacer.
</ParamField>

<ParamField body="tax_ids" type="array">
  Identifiants légaux. **Remplace tous les identifiants fiscaux existants.** Envoyer `[]` pour tous les supprimer.

  Omettre ce champ laisse les identifiants fiscaux existants inchangés.

  ```json theme={null}
  [{ "tax": "VAT", "tax_value": "FR98765432100" }]
  ```
</ParamField>

<ParamField body="id_crm" type="string | null">
  ID CRM externe
</ParamField>

<ParamField body="id_erp" type="string | null">
  ID ERP externe
</ParamField>

<ParamField body="id_accounting" type="string | null">
  ID comptabilité externe
</ParamField>

## Exemples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PATCH https://qwoty.app/api/customers/550e8400-e29b-41d4-a716-446655440000 \
    -H "Authorization: Bearer qwoty_your_token" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Acme Corp (Renamed)",
      "tax_ids": [
        { "tax": "VAT", "tax_value": "FR98765432100" }
      ]
    }'
  ```

  ```javascript JavaScript theme={null}
  const customerId = '550e8400-e29b-41d4-a716-446655440000'

  const response = await fetch(`https://qwoty.app/api/customers/${customerId}`, {
    method: 'PATCH',
    headers: {
      Authorization: 'Bearer qwoty_your_token',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      name: 'Acme Corp (Renamed)',
      tax_ids: [{ tax: 'VAT', tax_value: 'FR98765432100' }],
    }),
  })
  const data = await response.json()
  ```

  ```python Python theme={null}
  import requests

  customer_id = '550e8400-e29b-41d4-a716-446655440000'

  response = requests.patch(
      f'https://qwoty.app/api/customers/{customer_id}',
      headers={
          'Authorization': 'Bearer qwoty_your_token',
          'Content-Type': 'application/json',
      },
      json={
          'name': 'Acme Corp (Renamed)',
          'tax_ids': [{'tax': 'VAT', 'tax_value': 'FR98765432100'}],
      },
  )
  data = response.json()
  ```
</CodeGroup>

## Réponse

<ResponseField name="success" type="boolean">
  `true` si la mise à jour a réussi
</ResponseField>

<ResponseField name="data" type="object">
  L'objet client mis à jour (même structure que [Obtenir un client](/api-reference/customers/get))
</ResponseField>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "success": true,
    "data": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Acme Corp (Renamed)",
      "type": "company",
      "segment_id": null,
      "logo": null,
      "id_crm": "crm_001",
      "id_erp": null,
      "id_accounting": null,
      "created_at": "2026-01-15T10:30:00Z",
      "updated_at": "2026-03-24T14:00:00Z"
    }
  }
  ```

  ```json Not Found theme={null}
  {
    "success": false,
    "error": "Customer not found"
  }
  ```
</ResponseExample>
