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

Handles Product resource endpoints.

## Endpoints

- POST   /v1/products      - Create product
- GET    /v1/products/:id  - Retrieve product
- POST   /v1/products/:id  - Update product
- DELETE /v1/products/:id  - Delete product
- GET    /v1/products      - List products

## Product Object

    %{
      id: "prod_...",
      object: "product",
      created: 1234567890,
      active: true,
      name: "Premium Plan",
      description: "A premium subscription plan",
      metadata: %{},
      # ... other fields
    }

# `create`

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

Creates a new product.

## Required Parameters

- name - Product name

## Optional Parameters

- id - Custom ID (must start with "prod_"). Useful for seeding deterministic data.
- active - Whether product is active (default: true)
- description - Product description
- metadata - Key-value metadata
- images - Product images URLs
- statement_descriptor - Descriptor for bank statements

# `delete`

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

Deletes a product.

Returns a deletion confirmation object.

# `list`

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

Lists all products with pagination.

## Parameters

- limit - Number of items (default: 10, max: 100)
- starting_after - Cursor for pagination
- ending_before - Reverse cursor
- active - Filter by active status

# `retrieve`

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

Retrieves a product by ID.

# `update`

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

Updates a product.

## Updatable Fields

- active
- name
- description
- metadata
- images
- statement_descriptor

---

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