# `StripeManaged.Refund`
[🔗](https://github.com/safemyprivacy0-bit/stripe_managed/blob/main/lib/stripe_managed/refund.ex#L1)

Issue and manage refunds for Managed Payments transactions.

When refunds are processed, customers receive the full amount including
original sales tax. Stripe retains and remits tax in certain jurisdictions.

Note: Customers can also request refunds via Link support.
Stripe may issue refunds at their discretion within 60 days.

# `create`

```elixir
@spec create(
  map(),
  keyword()
) :: StripeManaged.Client.response()
```

Creates a refund.

Params:
  - `payment_intent` or `charge` - the payment to refund (one required)
  - `amount` - partial refund amount in cents (omit for full refund)
  - `reason` - `"duplicate"`, `"fraudulent"`, or `"requested_by_customer"`
  - `metadata` - key-value metadata

# `list`

```elixir
@spec list(
  map(),
  keyword()
) :: StripeManaged.Client.response()
```

Lists refunds. Filter by `payment_intent`, `charge`, etc.

# `list_all`

```elixir
@spec list_all(
  map(),
  keyword()
) :: Enumerable.t()
```

Returns a lazy Stream of all refunds, auto-paginating.

# `retrieve`

```elixir
@spec retrieve(
  String.t(),
  keyword()
) :: StripeManaged.Client.response()
```

Retrieves a refund by ID.

# `update`

```elixir
@spec update(String.t(), map(), keyword()) :: StripeManaged.Client.response()
```

Updates a refund's metadata.

---

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