# `PaperTiger.Resources.Customer`
[🔗](https://github.com/EnaiaInc/paper_tiger/blob/v1.2.2/lib/paper_tiger/resources/customer.ex#L1)

Handles Customer resource endpoints.

## Endpoints

- POST   /v1/customers      - Create customer
- GET    /v1/customers/:id  - Retrieve customer
- POST   /v1/customers/:id  - Update customer
- DELETE /v1/customers/:id  - Delete customer
- GET    /v1/customers      - List customers

## Customer Object

    %{
      id: "cus_...",
      object: "customer",
      created: 1234567890,
      email: "user@example.com",
      name: "John Doe",
      description: nil,
      metadata: %{},
      default_source: nil,
      default_payment_method: nil,
      # ... other fields
    }

# `create`

```elixir
@spec create(Plug.Conn.t()) :: Plug.Conn.t()
```

Creates a new customer.

## Required Parameters

None (all optional for Customer creation)

## Optional Parameters

- id - Custom ID (must start with "cus_"). Useful for seeding deterministic data.
- email - Customer email
- name - Customer name
- description - Customer description
- metadata - Key-value metadata
- default_source - Default payment source
- default_payment_method - Default payment method

# `delete`

```elixir
@spec delete(Plug.Conn.t(), String.t()) :: Plug.Conn.t()
```

Deletes a customer.

Returns a deletion confirmation object.

# `list`

```elixir
@spec list(Plug.Conn.t()) :: Plug.Conn.t()
```

Lists customers with pagination and optional email filtering.

## Parameters

- email - Filter by exact email address (Stripe API behavior)
- limit - Number of items (default: 10, max: 100)
- starting_after - Cursor for pagination
- ending_before - Reverse cursor

# `retrieve`

```elixir
@spec retrieve(Plug.Conn.t(), String.t()) :: Plug.Conn.t()
```

Retrieves a customer by ID.

# `search`

```elixir
@spec search(Plug.Conn.t()) :: Plug.Conn.t()
```

Searches customers with Stripe-style search query syntax.

# `update`

```elixir
@spec update(Plug.Conn.t(), String.t()) :: Plug.Conn.t()
```

Updates a customer.

## Updatable Fields

- email
- name
- description
- metadata
- default_source
- default_payment_method

---

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