View Source Stripe.BillingPortal.Configuration (stripity_stripe v3.3.1)
A portal configuration describes the functionality and behavior you embed in a portal session. Related guide: Configure the customer portal.
Summary
Types
Control whether the quantity of the product can be adjusted.
The business information shown to customers in the portal.
Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer
Information about updating the customer details in the portal.
Information about the features available in the portal.
Information about showing the billing history in the portal.
The hosted login page for this configuration. Learn more about the portal login page in our integration docs.
Information about updating payment methods in the portal.
Setting to control when an update should be scheduled at the end of the period instead of applying immediately.
Information about canceling subscriptions in the portal.
Information about updating subscriptions in the portal.
The billing_portal.configuration type.
Functions
Creates a configuration that describes the functionality and behavior of a PortalSession
Returns a list of configurations that describe the functionality of the customer portal.
Retrieves a configuration that describes the functionality of the customer portal.
Updates a configuration that describes the functionality of the customer portal.
Types
@type adjustable_quantity() :: %{ optional(:enabled) => boolean(), optional(:maximum) => integer(), optional(:minimum) => integer() }
Control whether the quantity of the product can be adjusted.
@type business_profile() :: %{ optional(:headline) => binary() | binary(), optional(:privacy_policy_url) => binary(), optional(:terms_of_service_url) => binary() }
The business information shown to customers in the portal.
@type cancellation_reason() :: %{ optional(:enabled) => boolean(), optional(:options) => [ :customer_service | :low_quality | :missing_features | :other | :switched_service | :too_complex | :too_expensive | :unused ] | binary() }
Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer
@type conditions() :: %{
optional(:type) => :decreasing_item_amount | :shortening_interval
}
@type customer_update() :: %{ optional(:allowed_updates) => [:address | :email | :name | :phone | :shipping | :tax_id] | binary(), optional(:enabled) => boolean() }
Information about updating the customer details in the portal.
@type features() :: %{ optional(:customer_update) => customer_update(), optional(:invoice_history) => invoice_history(), optional(:payment_method_update) => payment_method_update(), optional(:subscription_cancel) => subscription_cancel(), optional(:subscription_update) => subscription_update() }
Information about the features available in the portal.
@type invoice_history() :: %{optional(:enabled) => boolean()}
Information about showing the billing history in the portal.
@type login_page() :: %{optional(:enabled) => boolean()}
The hosted login page for this configuration. Learn more about the portal login page in our integration docs.
@type payment_method_update() :: %{ optional(:enabled) => boolean(), optional(:payment_method_configuration) => binary() | binary() }
Information about updating payment methods in the portal.
@type products() :: %{ optional(:adjustable_quantity) => adjustable_quantity(), optional(:prices) => [binary()], optional(:product) => binary() }
@type schedule_at_period_end() :: %{optional(:conditions) => [conditions()]}
Setting to control when an update should be scheduled at the end of the period instead of applying immediately.
@type subscription_cancel() :: %{ optional(:cancellation_reason) => cancellation_reason(), optional(:enabled) => boolean(), optional(:mode) => :at_period_end | :immediately, optional(:proration_behavior) => :always_invoice | :create_prorations | :none }
Information about canceling subscriptions in the portal.
@type subscription_update() :: %{ optional(:default_allowed_updates) => [:price | :promotion_code | :quantity] | binary(), optional(:enabled) => boolean(), optional(:products) => [products()] | binary(), optional(:proration_behavior) => :always_invoice | :create_prorations | :none, optional(:schedule_at_period_end) => schedule_at_period_end(), optional(:trial_update_behavior) => :continue_trial | :end_trial }
Information about updating subscriptions in the portal.
@type t() :: %Stripe.BillingPortal.Configuration{ active: boolean(), application: (binary() | term() | term()) | nil, business_profile: term(), created: integer(), default_return_url: binary() | nil, features: term(), id: binary(), is_default: boolean(), livemode: boolean(), login_page: term(), metadata: term() | nil, name: binary() | nil, object: binary(), updated: integer() }
The billing_portal.configuration type.
activeWhether the configuration is active and can be used to create portal sessions.applicationID of the Connect Application that created the configuration.business_profilecreatedTime at which the object was created. Measured in seconds since the Unix epoch.default_return_urlThe default URL to redirect customers to when they click on the portal's link to return to your website. This can be overriden when creating the session.featuresidUnique identifier for the object.is_defaultWhether the configuration is the default. Iftrue, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session.livemodeHas the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.login_pagemetadataSet of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.nameThe name of the configuration.objectString representing the object's type. Objects of the same type share the same value.updatedTime at which the object was last updated. Measured in seconds since the Unix epoch.
Functions
@spec create( params :: %{ optional(:business_profile) => business_profile(), optional(:default_return_url) => binary() | binary(), optional(:expand) => [binary()], optional(:features) => features(), optional(:login_page) => login_page(), optional(:metadata) => %{optional(binary()) => binary()}, optional(:name) => binary() | binary() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Creates a configuration that describes the functionality and behavior of a PortalSession
Details
- Method:
post - Path:
/v1/billing_portal/configurations
@spec list( params :: %{ optional(:active) => boolean(), optional(:ending_before) => binary(), optional(:expand) => [binary()], optional(:is_default) => boolean(), optional(:limit) => integer(), optional(:starting_after) => binary() }, opts :: Keyword.t() ) :: {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Returns a list of configurations that describe the functionality of the customer portal.
Details
- Method:
get - Path:
/v1/billing_portal/configurations
@spec retrieve( configuration :: binary(), params :: %{optional(:expand) => [binary()]}, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Retrieves a configuration that describes the functionality of the customer portal.
Details
- Method:
get - Path:
/v1/billing_portal/configurations/{configuration}
@spec update( configuration :: binary(), params :: %{ optional(:active) => boolean(), optional(:business_profile) => business_profile(), optional(:default_return_url) => binary() | binary(), optional(:expand) => [binary()], optional(:features) => features(), optional(:login_page) => login_page(), optional(:metadata) => %{optional(binary()) => binary()} | binary(), optional(:name) => binary() | binary() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Updates a configuration that describes the functionality of the customer portal.
Details
- Method:
post - Path:
/v1/billing_portal/configurations/{configuration}