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

Handles Price resource endpoints.

## Endpoints

- POST   /v1/prices      - Create price
- GET    /v1/prices/:id  - Retrieve price
- POST   /v1/prices/:id  - Update price
- GET    /v1/prices      - List prices

Note: Prices cannot be deleted (Stripe API limitation).

## Price Object

    %{
      id: "price_...",
      object: "price",
      created: 1234567890,
      active: true,
      currency: "usd",
      unit_amount: 2000,  # $20.00
      recurring: %{
        interval: "month",
        interval_count: 1
      },
      product: "prod_...",
      # ... other fields
    }

# `create`

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

Creates a new price.

## Required Parameters

- currency - Three-letter ISO currency code (e.g., "usd")
- product - Product ID this price belongs to

One of:
- unit_amount - Price in cents (e.g., 2000 for $20.00)
- unit_amount_decimal - Price as decimal string

## Optional Parameters

- id - Custom ID (must start with "price_"). Useful for seeding deterministic data.
- active - Whether price is active (default: true)
- metadata - Key-value metadata
- recurring - Recurring billing config (interval, interval_count)
- billing_scheme - Pricing model (per_unit, tiered)
- tiers - Tiered pricing configuration
- tiers_mode - Tiering mode (graduated, volume)

# `list`

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

Lists all prices 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
- currency - Filter by currency
- product - Filter by product
- recurring - Filter recurring/one-time prices

# `retrieve`

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

Retrieves a price by ID.

# `update`

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

Updates a price.

Note: Prices can only have limited fields updated.

## Updatable Fields

- active
- metadata
- nickname

---

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