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

Handles SetupIntent resource endpoints.

## Endpoints

- POST   /v1/setup_intents      - Create setup intent
- GET    /v1/setup_intents/:id  - Retrieve setup intent
- POST   /v1/setup_intents/:id  - Update setup intent
- GET    /v1/setup_intents      - List setup intents
- POST   /v1/setup_intents/:id/confirm - Confirm setup intent
- POST   /v1/setup_intents/:id/cancel - Cancel setup intent
- POST   /v1/setup_intents/:id/verify_microdeposits - Verify bank microdeposits

Note: Setup intents cannot be deleted (only canceled).

## SetupIntent Object

    %{
      id: "seti_...",
      object: "setup_intent",
      created: 1234567890,
      customer: "cus_...",
      payment_method: "pm_...",
      status: "requires_payment_method",
      usage: "off_session",
      metadata: %{},
      # ... other fields
    }

# `cancel`

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

Cancels a setup intent that has not reached a terminal state.

# `confirm`

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

Confirms a setup intent.

Compatible card payment methods transition to succeeded immediately. Bank
account methods transition to requires_action until microdeposits are verified.

# `create`

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

Creates a new setup intent.

## Required Parameters

None (all optional for SetupIntent creation)

## Optional Parameters

- customer - Customer ID for this setup intent
- payment_method - Payment method ID (can be updated later)
- usage - How the payment method will be used ("off_session" or "on_session")
- metadata - Key-value metadata

# `list`

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

Lists all setup intents with pagination.

## Parameters

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

# `retrieve`

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

Retrieves a setup intent by ID.

# `update`

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

Updates a setup intent.

## Updatable Fields

- customer
- payment_method
- metadata

# `verify_microdeposits`

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

Verifies microdeposits for a bank-account setup intent.

---

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