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
Attributes
- accountstring
The ID of the account the AccountSession was created for
- client_
secretstring 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_
should be handled.secret - componentsobject
Information about which embedded components and component features are enabled for this Account Session. Components that have no features have an empty
features
hash. - expires_
attimestamp The timestamp at which this AccountSession will expire.
More attributes
- objectstring
- livemodeboolean
{ "object": "account_session", "account": "acct_1NkDjjJyhOZfPCWt", "client_secret": "_OXIKXxEihJokDBnDoe2sgG5OGSO2Q12shKvbeboxpALZGng", "expires_at": 1693261123, "livemode": false, "components": { "account_management": { "enabled": false, "features": { "external_account_collection": true, "disable_stripe_user_authentication": false } }, "account_onboarding": { "enabled": true, "features": { "external_account_collection": true, "disable_stripe_user_authentication": false } }, "balances": { "enabled": true, "features": { "edit_payout_schedule": false, "instant_payouts": false, "standard_payouts": false, "external_account_collection": true, "disable_stripe_user_authentication": false } }, "documents": { "enabled": false, "features": {} }, "financial_account": { "enabled": false, "features": { "disable_stripe_user_authentication": false, "external_account_collection": false, "money_movement": false, "send_money": false, "transfer_balance": false } }, "financial_account_transactions": { "enabled": false, "features": { "card_spend_dispute_management": false } }, "issuing_card": { "enabled": false, "features": { "card_management": false, "card_spend_dispute_management": false, "cardholder_management": false, "spend_control_management": false } }, "issuing_cards_list": { "enabled": false, "features": { "card_management": false, "card_spend_dispute_management": false, "cardholder_management": false, "disable_stripe_user_authentication": false, "spend_control_management": false } }, "notification_banner": { "enabled": false, "features": { "external_account_collection": true, "disable_stripe_user_authentication": false } }, "payment_details": { "enabled": false, "features": { "capture_payments": true, "destination_on_behalf_of_charge_management": false, "dispute_management": true, "refund_management": true } }, "payments": { "enabled": true, "features": { "capture_payments": true, "destination_on_behalf_of_charge_management": false, "dispute_management": true, "refund_management": true } }, "payouts": { "enabled": true, "features": { "edit_payout_schedule": false, "instant_payouts": false, "standard_payouts": false, "external_account_collection": true, "disable_stripe_user_authentication": false } }, "payouts_list": { "enabled": false, "features": {} }, "tax_registrations": { "enabled": false, "features": {} }, "tax_settings": { "enabled": false, "features": {} } }}
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.
Parameters
- accountstringRequired
The identifier of the account to create an Account Session for.
- componentsobjectRequired
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).
Returns
Returns an Account Session object if the call succeeded.
{ "object": "account_session", "account": "acct_1NkDjjJyhOZfPCWt", "client_secret": "_OXIKXxEihJokDBnDoe2sgG5OGSO2Q12shKvbeboxpALZGng", "expires_at": 1693261123, "livemode": false, "components": { "account_management": { "enabled": false, "features": { "external_account_collection": true, "disable_stripe_user_authentication": false } }, "account_onboarding": { "enabled": true, "features": { "external_account_collection": true, "disable_stripe_user_authentication": false } }, "balances": { "enabled": true, "features": { "edit_payout_schedule": false, "instant_payouts": false, "standard_payouts": false, "external_account_collection": true, "disable_stripe_user_authentication": false } }, "documents": { "enabled": false, "features": {} }, "financial_account": { "enabled": false, "features": { "disable_stripe_user_authentication": false, "external_account_collection": false, "money_movement": false, "send_money": false, "transfer_balance": false } }, "financial_account_transactions": { "enabled": false, "features": { "card_spend_dispute_management": false } }, "issuing_card": { "enabled": false, "features": { "card_management": false, "card_spend_dispute_management": false, "cardholder_management": false, "spend_control_management": false } }, "issuing_cards_list": { "enabled": false, "features": { "card_management": false, "card_spend_dispute_management": false, "cardholder_management": false, "disable_stripe_user_authentication": false, "spend_control_management": false } }, "notification_banner": { "enabled": false, "features": { "external_account_collection": true, "disable_stripe_user_authentication": false } }, "payment_details": { "enabled": false, "features": { "capture_payments": true, "destination_on_behalf_of_charge_management": false, "dispute_management": true, "refund_management": true } }, "payments": { "enabled": true, "features": { "capture_payments": true, "destination_on_behalf_of_charge_management": false, "dispute_management": true, "refund_management": true } }, "payouts": { "enabled": true, "features": { "edit_payout_schedule": false, "instant_payouts": false, "standard_payouts": false, "external_account_collection": true, "disable_stripe_user_authentication": false } }, "payouts_list": { "enabled": false, "features": {} }, "tax_registrations": { "enabled": false, "features": {} }, "tax_settings": { "enabled": false, "features": {} } }}
When you collect a transaction fee on top of a charge made for your user (using Connect), an Application Fee
object is created in your account. You can list, retrieve, and refund application fees.
Related guide: Collecting application fees
Application Fee Refund
objects allow you to refund an application fee that has previously been created but not yet refunded. Funds will be refunded to the Stripe account from which the fee was originally collected.
Related guide: Refunding application fees