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

# Create Address

> Create a new address linked to a customer

## Authorization

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

## Request Body

<ParamField body="customer_id" type="string" required>
  UUID of the customer this address belongs to
</ParamField>

<ParamField body="type" type="string" required>
  Address type. Allowed values: `"billing"`, `"shipping"`
</ParamField>

<ParamField body="address_line1" type="string" required>
  Street address
</ParamField>

<ParamField body="city" type="string" required>
  City
</ParamField>

<ParamField body="postal_code" type="string" required>
  Postal/ZIP code
</ParamField>

<ParamField body="country" type="string" required>
  Country code (ISO 3166-1 alpha-2, e.g., `"FR"`, `"US"`, `"DE"`)
</ParamField>

<ParamField body="name" type="string">
  Label for this address (e.g., `"Head office"`, `"Warehouse"`)
</ParamField>

<ParamField body="address_line2" type="string">
  Secondary address line (apartment, floor, etc.)
</ParamField>

<ParamField body="state" type="string">
  State or region
</ParamField>

<ParamField body="contact_id" type="string">
  UUID of the contact associated with this address
</ParamField>

<ParamField body="comment" type="string">
  Internal comment
</ParamField>

<ParamField body="id_crm" type="string">
  External CRM ID
</ParamField>

<ParamField body="id_erp" type="string">
  External ERP ID
</ParamField>

<ParamField body="id_accounting" type="string">
  External accounting ID
</ParamField>

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://qwoty.app/api/addresses \
    -H "Authorization: Bearer qwoty_your_token" \
    -H "Content-Type: application/json" \
    -d '{
      "customer_id": "550e8400-e29b-41d4-a716-446655440000",
      "type": "billing",
      "name": "Siège social",
      "address_line1": "12 Rue de la Paix",
      "city": "Paris",
      "postal_code": "75001",
      "country": "FR"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://qwoty.app/api/addresses', {
    method: 'POST',
    headers: {
      Authorization: 'Bearer qwoty_your_token',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      customer_id: '550e8400-e29b-41d4-a716-446655440000',
      type: 'billing',
      name: 'Siège social',
      address_line1: '12 Rue de la Paix',
      city: 'Paris',
      postal_code: '75001',
      country: 'FR',
    }),
  })
  const data = await response.json()
  ```

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

  response = requests.post(
      'https://qwoty.app/api/addresses',
      headers={
          'Authorization': 'Bearer qwoty_your_token',
          'Content-Type': 'application/json',
      },
      json={
          'customer_id': '550e8400-e29b-41d4-a716-446655440000',
          'type': 'billing',
          'name': 'Siège social',
          'address_line1': '12 Rue de la Paix',
          'city': 'Paris',
          'postal_code': '75001',
          'country': 'FR',
      },
  )
  data = response.json()
  ```
</CodeGroup>

## Response

<ResponseField name="success" type="boolean">
  `true` if the address was created
</ResponseField>

<ResponseField name="data" type="object">
  The created address object (same shape as [Get
  Address](/api-reference/addresses/get))
</ResponseField>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "success": true,
    "data": {
      "id": "770e8400-e29b-41d4-a716-446655440002",
      "workspace_id": "706eb564-6c4a-4e18-841c-bdd79be6bca7",
      "customer_id": "550e8400-e29b-41d4-a716-446655440000",
      "type": "billing",
      "name": "Siège social",
      "address_line1": "12 Rue de la Paix",
      "address_line2": null,
      "city": "Paris",
      "state": null,
      "postal_code": "75001",
      "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-01-15T10:30:00Z"
    }
  }
  ```

  ```json Validation Error theme={null}
  {
    "error": "Validation error",
    "details": [
      { "path": "customer_id", "message": "customer_id must be a valid UUID" },
      { "path": "type", "message": "Type must be \"billing\" or \"shipping\"" }
    ]
  }
  ```
</ResponseExample>
