> ## 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.

# Créer un client

> Créer un nouveau client dans votre espace de travail

## Autorisation

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

## Corps de la requête

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

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

<ParamField body="segment_id" type="string">
  UUID du segment client
</ParamField>

<ParamField body="logo" type="string">
  URL du logo
</ParamField>

<ParamField body="tax_ids" type="array">
  Identifiants légaux de ce client. Chaque entrée doit contenir `tax` et `tax_value`.

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

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

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

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

## Exemples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://qwoty.app/api/customers \
    -H "Authorization: Bearer qwoty_your_token" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Acme Corporation",
      "type": "company",
      "tax_ids": [
        { "tax": "VAT", "tax_value": "FR12345678901" }
      ],
      "id_crm": "crm_001"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://qwoty.app/api/customers', {
    method: 'POST',
    headers: {
      Authorization: 'Bearer qwoty_your_token',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      name: 'Acme Corporation',
      type: 'company',
      tax_ids: [{ tax: 'VAT', tax_value: 'FR12345678901' }],
      id_crm: 'crm_001',
    }),
  })
  const data = await response.json()
  ```

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

  response = requests.post(
      'https://qwoty.app/api/customers',
      headers={
          'Authorization': 'Bearer qwoty_your_token',
          'Content-Type': 'application/json',
      },
      json={
          'name': 'Acme Corporation',
          'type': 'company',
          'tax_ids': [{'tax': 'VAT', 'tax_value': 'FR12345678901'}],
          'id_crm': 'crm_001',
      },
  )
  data = response.json()
  ```
</CodeGroup>

## Réponse

<ResponseField name="success" type="boolean">
  `true` si le client a été créé
</ResponseField>

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

<ResponseExample>
  ```json Réponse de succès theme={null}
  {
    "success": true,
    "data": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "workspace_id": "706eb564-6c4a-4e18-841c-bdd79be6bca7",
      "name": "Acme Corporation",
      "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-01-15T10:30:00Z"
    }
  }
  ```

  ```json Erreur de validation theme={null}
  {
    "error": "Validation error",
    "details": [
      { "path": "name", "message": "Name is required" },
      { "path": "type", "message": "Type must be \"company\" or \"individual\"" }
    ]
  }
  ```

  ```json Non autorisé theme={null}
  {
    "error": "Invalid API token"
  }
  ```
</ResponseExample>
