# `Accrue.BillingPortal.Session`
[🔗](https://github.com/szTheory/accrue/blob/accrue-v0.3.0/lib/accrue/billing_portal/session.ex#L1)

Stripe Customer Billing Portal session wrapper.

Wraps the processor-level `portal_session_create/2` callback,
projects the response into a tightly-typed struct, and **masks the
`:url` field in `Inspect` output** — the portal URL is
a single-use, short-lived (~5 minute) authenticated bearer
credential that impersonates the customer in the Stripe portal.
Any leak via Logger, APM, crash dumps, or telemetry handlers is an
account-takeover vector within the TTL window.

## Configuration

Programmatic `BillingPortal.Configuration` support is deferred to a
future processor release. For now, host apps configure portal
behavior in the Stripe Dashboard (matching the Pay/Cashier
convention) and pass the resulting `bpc_*` id via the
`:configuration` option on `create/1`. See
`guides/portal_configuration_checklist.md` for the three required
Dashboard toggles that defend against the "cancel-without-dunning"
footgun (Pitfall 6).

# `t`

```elixir
@type t() :: %Accrue.BillingPortal.Session{
  configuration: term(),
  created: term(),
  customer: term(),
  data: term(),
  flow: term(),
  id: term(),
  livemode: term(),
  locale: term(),
  object: term(),
  on_behalf_of: term(),
  return_url: term(),
  url: term()
}
```

# `create`

```elixir
@spec create(map() | keyword()) :: {:ok, t()} | {:error, term()}
```

Creates a Customer Billing Portal session through the configured
processor.

# `create!`

```elixir
@spec create!(map() | keyword()) :: t()
```

Bang variant of `create/1`. Raises on failure.

---

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