View Source Stripe.BillingPortal.Session (Striped v0.4.0)

The Billing customer portal is a Stripe-hosted UI for subscription and billing management.

A portal configuration describes the functionality and features that you want to provide to your customers through the portal.

A portal session describes the instantiation of the customer portal for a particular customer. By visiting the session's URL, the customer can manage their subscriptions and billing details. For security reasons, sessions are short-lived and will expire if the customer does not visit the URL. Create sessions on-demand when customers intend to manage their subscriptions and billing details.

Learn more in the integration guide.

Link to this section Summary

Types

t()

The billing_portal.session type.

Functions

Creates a session of the customer portal.

Link to this section Types

@type t() :: %Stripe.BillingPortal.Session{
  configuration: binary() | Stripe.BillingPortal.Configuration.t(),
  created: integer(),
  customer: binary(),
  id: binary(),
  livemode: boolean(),
  locale: binary() | nil,
  object: binary(),
  on_behalf_of: binary() | nil,
  return_url: binary() | nil,
  url: binary()
}

The billing_portal.session type.

  • configuration The configuration used by this session, describing the features available.
  • created Time at which the object was created. Measured in seconds since the Unix epoch.
  • customer The ID of the customer for this session.
  • id Unique identifier for the object.
  • livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
  • locale The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer’s preferred_locales or browser’s locale is used.
  • object String representing the object's type. Objects of the same type share the same value.
  • on_behalf_of The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this on_behalf_of account appear in the portal. For more information, see the docs. Use the Accounts API to modify the on_behalf_of account's branding settings, which the portal displays.
  • return_url The URL to redirect customers to when they click on the portal's link to return to your website.
  • url The short-lived URL of the session that gives customers access to the customer portal.

Link to this section Functions

Link to this function

create(client, params \\ %{}, opts \\ [])

View Source
@spec create(
  client :: Stripe.t(),
  params :: %{
    optional(:configuration) => binary(),
    optional(:customer) => binary(),
    optional(:expand) => [binary()],
    optional(:locale) =>
      :auto
      | :bg
      | :cs
      | :da
      | :de
      | :el
      | :en
      | :"en-AU"
      | :"en-CA"
      | :"en-GB"
      | :"en-IE"
      | :"en-IN"
      | :"en-NZ"
      | :"en-SG"
      | :es
      | :"es-419"
      | :et
      | :fi
      | :fil
      | :fr
      | :"fr-CA"
      | :hr
      | :hu
      | :id
      | :it
      | :ja
      | :ko
      | :lt
      | :lv
      | :ms
      | :mt
      | :nb
      | :nl
      | :pl
      | :pt
      | :"pt-BR"
      | :ro
      | :ru
      | :sk
      | :sl
      | :sv
      | :th
      | :tr
      | :vi
      | :zh
      | :"zh-HK"
      | :"zh-TW",
    optional(:on_behalf_of) => binary(),
    optional(:return_url) => binary()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Creates a session of the customer portal.

Details

  • Method: post
  • Path: /v1/billing_portal/sessions