> ## 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 une adresse

> Mettre à jour partiellement une adresse

## Autorisation

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

## Paramètres de chemin

<ParamField path="id" type="string" required>
  UUID de l'adresse à mettre à jour
</ParamField>

## Corps de la requête

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

<ParamField body="type" type="string">
  Type d'adresse. Valeurs autorisées : `"billing"`, `"shipping"`
</ParamField>

<ParamField body="name" type="string | null">
  Libellé de l'adresse. Définir à `null` pour effacer.
</ParamField>

<ParamField body="address_line1" type="string">
  Adresse postale
</ParamField>

<ParamField body="address_line2" type="string | null">
  Complément d'adresse. Définir à `null` pour effacer.
</ParamField>

<ParamField body="city" type="string">
  Ville
</ParamField>

<ParamField body="state" type="string | null">
  État ou région. Définir à `null` pour effacer.
</ParamField>

<ParamField body="postal_code" type="string">
  Code postal
</ParamField>

<ParamField body="country" type="string">
  Code pays (ISO 3166-1 alpha-2)
</ParamField>

<ParamField body="contact_id" type="string | null">
  UUID du contact associé. Définir à `null` pour effacer.
</ParamField>

<ParamField body="comment" type="string | null">
  Commentaire interne. Définir à `null` pour effacer.
</ParamField>

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

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

<ParamField body="id_accounting" type="string | null">
  Identifiant comptable externe
</ParamField>

<Note>`customer_id` ne peut pas être modifié après la création.</Note>

## Exemples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PATCH https://qwoty.app/api/addresses/770e8400-e29b-41d4-a716-446655440002 \
    -H "Authorization: Bearer qwoty_your_token" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Nouveau siège",
      "address_line1": "42 Avenue des Champs-Élysées",
      "city": "Paris",
      "postal_code": "75008",
      "country": "FR"
    }'
  ```

  ```javascript JavaScript theme={null}
  const addressId = '770e8400-e29b-41d4-a716-446655440002'

  const response = await fetch(`https://qwoty.app/api/addresses/${addressId}`, {
    method: 'PATCH',
    headers: {
      Authorization: 'Bearer qwoty_your_token',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      name: 'Nouveau siège',
      address_line1: '42 Avenue des Champs-Élysées',
      city: 'Paris',
      postal_code: '75008',
      country: 'FR',
    }),
  })
  const data = await response.json()
  ```

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

  address_id = '770e8400-e29b-41d4-a716-446655440002'

  response = requests.patch(
      f'https://qwoty.app/api/addresses/{address_id}',
      headers={
          'Authorization': 'Bearer qwoty_your_token',
          'Content-Type': 'application/json',
      },
      json={
          'name': 'Nouveau siège',
          'address_line1': '42 Avenue des Champs-Élysées',
          'city': 'Paris',
          'postal_code': '75008',
          'country': 'FR',
      },
  )
  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 adresse mis à jour (même structure que [Obtenir une
  adresse](/api-reference/addresses/get))
</ResponseField>

<ResponseExample>
  ```json Réponse de succès theme={null}
  {
    "success": true,
    "data": {
      "id": "770e8400-e29b-41d4-a716-446655440002",
      "customer_id": "550e8400-e29b-41d4-a716-446655440000",
      "type": "billing",
      "name": "Nouveau siège",
      "address_line1": "42 Avenue des Champs-Élysées",
      "address_line2": null,
      "city": "Paris",
      "state": null,
      "postal_code": "75008",
      "country": "FR",
      "contact_id": null,
      "comment": null,
      "id_crm": null,
      "id_erp": null,
      "id_accounting": null,
      "created_at": "2026-01-15T10:30:00Z",
      "updated_at": "2026-03-24T14:00:00Z"
    }
  }
  ```

  ```json Non trouvé theme={null}
  {
    "success": false,
    "error": "Address not found"
  }
  ```
</ResponseExample>
