View Source Stripe.AccountSession (stripity_stripe v3.3.1)

An AccountSession allows a Connect platform to grant access to a connected account in Connect embedded components.

We recommend that you create an AccountSession each time you need to display an embedded component to your user. Do not save AccountSessions to your database as they expire relatively quickly, and cannot be used more than once.

Related guide: Connect embedded components

Summary

Types

Configuration for the account management embedded component.

Configuration for the account onboarding embedded component.

Configuration for the balances embedded component.

Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. whether it has been enabled or not).

Configuration for the disputes list embedded component.

Configuration for the documents embedded component.

The list of features enabled in the embedded component.

Configuration for the financial account embedded component.

Configuration for the financial account transactions embedded component.

Configuration for the instant payouts promotion embedded component.

Configuration for the issuing card embedded component.

Configuration for the issuing cards list embedded component.

Configuration for the notification banner embedded component.

Configuration for the payment details embedded component.

Configuration for the payment disputes embedded component.

Configuration for the payments embedded component.

Configuration for the payout details embedded component.

Configuration for the payouts embedded component.

Configuration for the payouts list embedded component.

t()

The account_session type.

Configuration for the tax registrations embedded component.

Configuration for the tax settings embedded component.

Functions

Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.

Types

@type account_management() :: %{
  optional(:enabled) => boolean(),
  optional(:features) => features()
}

Configuration for the account management embedded component.

@type account_onboarding() :: %{
  optional(:enabled) => boolean(),
  optional(:features) => features()
}

Configuration for the account onboarding embedded component.

@type balances() :: %{
  optional(:enabled) => boolean(),
  optional(:features) => features()
}

Configuration for the balances embedded component.

@type components() :: %{
  optional(:account_management) => account_management(),
  optional(:account_onboarding) => account_onboarding(),
  optional(:balances) => balances(),
  optional(:disputes_list) => disputes_list(),
  optional(:documents) => documents(),
  optional(:financial_account) => financial_account(),
  optional(:financial_account_transactions) => financial_account_transactions(),
  optional(:instant_payouts_promotion) => instant_payouts_promotion(),
  optional(:issuing_card) => issuing_card(),
  optional(:issuing_cards_list) => issuing_cards_list(),
  optional(:notification_banner) => notification_banner(),
  optional(:payment_details) => payment_details(),
  optional(:payment_disputes) => payment_disputes(),
  optional(:payments) => payments(),
  optional(:payout_details) => payout_details(),
  optional(:payouts) => payouts(),
  optional(:payouts_list) => payouts_list(),
  optional(:tax_registrations) => tax_registrations(),
  optional(:tax_settings) => tax_settings()
}

Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. whether it has been enabled or not).

@type disputes_list() :: %{
  optional(:enabled) => boolean(),
  optional(:features) => features()
}

Configuration for the disputes list embedded component.

@type documents() :: %{optional(:enabled) => boolean(), optional(:features) => map()}

Configuration for the documents embedded component.

@type features() :: %{
  optional(:capture_payments) => boolean(),
  optional(:destination_on_behalf_of_charge_management) => boolean(),
  optional(:dispute_management) => boolean(),
  optional(:refund_management) => boolean()
}

The list of features enabled in the embedded component.

@type financial_account() :: %{
  optional(:enabled) => boolean(),
  optional(:features) => features()
}

Configuration for the financial account embedded component.

Link to this type

financial_account_transactions()

View Source
@type financial_account_transactions() :: %{
  optional(:enabled) => boolean(),
  optional(:features) => features()
}

Configuration for the financial account transactions embedded component.

Link to this type

instant_payouts_promotion()

View Source
@type instant_payouts_promotion() :: %{
  optional(:enabled) => boolean(),
  optional(:features) => features()
}

Configuration for the instant payouts promotion embedded component.

@type issuing_card() :: %{
  optional(:enabled) => boolean(),
  optional(:features) => features()
}

Configuration for the issuing card embedded component.

@type issuing_cards_list() :: %{
  optional(:enabled) => boolean(),
  optional(:features) => features()
}

Configuration for the issuing cards list embedded component.

@type notification_banner() :: %{
  optional(:enabled) => boolean(),
  optional(:features) => features()
}

Configuration for the notification banner embedded component.

@type payment_details() :: %{
  optional(:enabled) => boolean(),
  optional(:features) => features()
}

Configuration for the payment details embedded component.

@type payment_disputes() :: %{
  optional(:enabled) => boolean(),
  optional(:features) => features()
}

Configuration for the payment disputes embedded component.

@type payments() :: %{
  optional(:enabled) => boolean(),
  optional(:features) => features()
}

Configuration for the payments embedded component.

@type payout_details() :: %{
  optional(:enabled) => boolean(),
  optional(:features) => map()
}

Configuration for the payout details embedded component.

@type payouts() :: %{
  optional(:enabled) => boolean(),
  optional(:features) => features()
}

Configuration for the payouts embedded component.

@type payouts_list() :: %{
  optional(:enabled) => boolean(),
  optional(:features) => map()
}

Configuration for the payouts list embedded component.

@type t() :: %Stripe.AccountSession{
  account: binary(),
  client_secret: binary(),
  components: term(),
  expires_at: integer(),
  livemode: boolean(),
  object: binary()
}

The account_session type.

  • account The ID of the account the AccountSession was created for
  • client_secret The client secret of this AccountSession. Used on the client to set up secure access to the given account.

The client secret can be used to provide access to account from your frontend. It should not be stored, logged, or exposed to anyone other than the connected account. Make sure that you have TLS enabled on any page that includes the client secret.

Refer to our docs to setup Connect embedded components and learn about how client_secret should be handled.

  • components
  • expires_at The timestamp at which this AccountSession will expire.
  • livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
  • object String representing the object's type. Objects of the same type share the same value.
@type tax_registrations() :: %{
  optional(:enabled) => boolean(),
  optional(:features) => map()
}

Configuration for the tax registrations embedded component.

@type tax_settings() :: %{
  optional(:enabled) => boolean(),
  optional(:features) => map()
}

Configuration for the tax settings embedded component.

Functions

Link to this function

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

View Source
@spec create(
  params :: %{
    optional(:account) => binary(),
    optional(:components) => components(),
    optional(:expand) => [binary()]
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.

Details

  • Method: post
  • Path: /v1/account_sessions