The Account Session object 

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_secret should be handled.

  • componentsobject

    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).

  • expires_attimestamp

    The timestamp at which this AccountSession will expire.

More attributes

  • objectstring

  • livemodeboolean

The Account Session object
{
"object": "account_session",
"account": "acct_1NkDjjJyhOZfPCWt",
"client_secret": "_OXIKXxEihJokDBnDoe2sgG5OGSO2Q12shKvbeboxpALZGng",
"expires_at": 1693261123,
"livemode": false,
"components": {
"account_management": {
"enabled": false,
"features": {
"external_account_collection": true
}
},
"account_onboarding": {
"enabled": true,
"features": {
"external_account_collection": true
}
},
"balances": {
"enabled": true,
"features": {
"edit_payout_schedule": false,
"instant_payouts": false,
"standard_payouts": false,
"external_account_collection": true
}
},
"documents": {
"enabled": false,
"features": {}
},
"notification_banner": {
"enabled": false,
"features": {
"external_account_collection": true
}
},
"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
}
},
"payouts_list": {
"enabled": false,
"features": {}
},
"tax_registrations": {
"enabled": false,
"features": {}
},
"tax_settings": {
"enabled": false,
"features": {}
}
}
}

Create an Account Session 

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.

POST /v1/account_sessions
curl https://api.stripe.com/v1/account_sessions \
-u "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \
-d account=acct_1NkDjjJyhOZfPCWt \
-d "components[account_onboarding][enabled]"=true \
-d "components[payments][enabled]"=true \
-d "components[payouts][enabled]"=true \
-d "components[balances][enabled]"=true
Response
{
"object": "account_session",
"account": "acct_1NkDjjJyhOZfPCWt",
"client_secret": "_OXIKXxEihJokDBnDoe2sgG5OGSO2Q12shKvbeboxpALZGng",
"expires_at": 1693261123,
"livemode": false,
"components": {
"account_management": {
"enabled": false,
"features": {
"external_account_collection": true
}
},
"account_onboarding": {
"enabled": true,
"features": {
"external_account_collection": true
}
},
"balances": {
"enabled": true,
"features": {
"edit_payout_schedule": false,
"instant_payouts": false,
"standard_payouts": false,
"external_account_collection": true
}
},
"documents": {
"enabled": false,
"features": {}
},
"notification_banner": {
"enabled": false,
"features": {
"external_account_collection": true
}
},
"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
}
},
"payouts_list": {
"enabled": false,
"features": {}
},
"tax_registrations": {
"enabled": false,
"features": {}
},
"tax_settings": {
"enabled": false,
"features": {}
}
}
}

Application Fees 

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 Refunds 

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

Capabilities 

This is an object representing a capability for a Stripe account.

Related guide: Account capabilities