# `Stancer.API.Customers`

# `create`

```elixir
@spec create(map()) :: {:ok, map()} | {:error, term()}
```

POST `/v2/customers/`

## Parameters

  * `billing_address` (string (matches ^addr_[a-zA-Z0-9]{24}$), optional) - Billing address ID
    - Example: "addr_yWYfCSzsUUhr9KwMv7vuLZHX"
  * `country` (string (2-2 chars), optional) - Country of the card issuer
    - Example: "FR"
  * `date_birth` (string (format: date), optional) - Date of birth
    - Example: "1953-01-19"
  * `email` (string (format: email), optional) - Customer email
    - Example: "arthur.martin@example.com"
  * `external_id` (string (1-36 chars), optional) - Unique id with unicity check
    - Example: "UniqueId123"
  * `legal_id` (string (max 16 chars), optional) - Any legal identifier like SIREN, CBE, KVK, etc
    - Example: "AA732A82C93V20"
  * `mobile` (string (max 16 chars), optional) - Customer mobile number
    - Example: "+33100000000"
  * `name` (string (3-64 chars), optional) - Customer name
    - Example: "Arthur Martin"
  * `shipping_address` (string (matches ^addr_[a-zA-Z0-9]{24}$), optional) - Shipping address ID
    - Example: "addr_yWYfCSzsUUhr9KwMv7vuLZHX"

# `delete`

```elixir
@spec delete(String.t()) :: {:ok, map()} | {:error, term()}
```

DELETE `/v2/customers/{id}`

# `get`

```elixir
@spec get(String.t()) :: {:ok, map()} | {:error, term()}
```

GET `/v2/customers/{id}`

# `list`

```elixir
@spec list() :: {:ok, map()} | {:error, term()}
```

GET `/v2/customers/`

# `update`

```elixir
@spec update(String.t(), map()) :: {:ok, map()} | {:error, term()}
```

PATCH `/v2/customers/{id}`

## Parameters

  * `billing_address` (string (matches ^addr_[a-zA-Z0-9]{24}$), optional) - Billing address ID
    - Example: "addr_yWYfCSzsUUhr9KwMv7vuLZHX"
  * `country` (string (2-2 chars), optional) - Country of the card issuer
    - Example: "FR"
  * `date_birth` (string (format: date), optional) - Date of birth
    - Example: "1953-01-19"
  * `email` (string (format: email), optional) - Customer email
    - Example: "arthur.martin@example.com"
  * `external_id` (string (1-36 chars), optional) - Unique id with unicity check
    - Example: "UniqueId123"
  * `legal_id` (string (max 16 chars), optional) - Any legal identifier like SIREN, CBE, KVK, etc
    - Example: "AA732A82C93V20"
  * `mobile` (string (max 16 chars), optional) - Customer mobile number
    - Example: "+33100000000"
  * `name` (string (3-64 chars), optional) - Customer name
    - Example: "Arthur Martin"
  * `shipping_address` (string (matches ^addr_[a-zA-Z0-9]{24}$), optional) - Shipping address ID
    - Example: "addr_yWYfCSzsUUhr9KwMv7vuLZHX"

---

*Consult [api-reference.md](api-reference.md) for complete listing*
