Skip to content

Stripe: Create an Account Session

Stripe accountSessions.postAccountSessions: arguments, response, policy and SDK examples.

← Account sessions operations · Get started

Operation stripe.postaccountsessions

Provider route: POST /v1/account_sessions. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/stripe with npm, or alter-sdk-stripe with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { StripeIntegration } from "@alter-ai/stripe";
async function execute(input: Parameters<StripeIntegration["accountSessions"]["postAccountSessions"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new StripeIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.accountSessions.postAccountSessions(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_stripe import StripeIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = StripeIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.account_sessions.post_account_sessions(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
headersobjectOptionalAdditional keys: not allowed
headers.Idempotency-KeystringOptionalMinimum length: 1
Maximum length: 255
bodyobjectRequired within parentAdditional keys: not allowed
body.accountstringRequired within parentThe identifier of the account to create an Account Session for.
body.componentsobjectRequired within parentEach 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).
body.components.account_managementobjectOptional
body.components.account_management.enabledbooleanRequired within parent
body.components.account_management.featuresobjectOptional
body.components.account_management.features.disable_stripe_user_authenticationbooleanOptional
body.components.account_management.features.external_account_collectionbooleanOptional
body.components.account_onboardingobjectOptional
body.components.account_onboarding.enabledbooleanRequired within parent
body.components.account_onboarding.featuresobjectOptional
body.components.account_onboarding.features.disable_stripe_user_authenticationbooleanOptional
body.components.account_onboarding.features.external_account_collectionbooleanOptional
body.components.balance_reportobjectOptional
body.components.balance_report.enabledbooleanRequired within parent
body.components.balance_report.featuresobjectOptional
body.components.balancesobjectOptional
body.components.balances.enabledbooleanRequired within parent
body.components.balances.featuresobjectOptional
body.components.balances.features.disable_stripe_user_authenticationbooleanOptional
body.components.balances.features.edit_payout_schedulebooleanOptional
body.components.balances.features.external_account_collectionbooleanOptional
body.components.balances.features.instant_payoutsbooleanOptional
body.components.balances.features.standard_payoutsbooleanOptional
body.components.disputes_listobjectOptional
body.components.disputes_list.enabledbooleanRequired within parent
body.components.disputes_list.featuresobjectOptional
body.components.disputes_list.features.capture_paymentsbooleanOptional
body.components.disputes_list.features.destination_on_behalf_of_charge_managementbooleanOptional
body.components.disputes_list.features.dispute_managementbooleanOptional
body.components.disputes_list.features.refund_managementbooleanOptional
body.components.disputes_list.features.smart_disputes_managementbooleanOptional
body.components.documentsobjectOptional
body.components.documents.enabledbooleanRequired within parent
body.components.documents.featuresobjectOptional
body.components.financial_accountobjectOptional
body.components.financial_account.enabledbooleanRequired within parent
body.components.financial_account.featuresobjectOptional
body.components.financial_account.features.disable_stripe_user_authenticationbooleanOptional
body.components.financial_account.features.external_account_collectionbooleanOptional
body.components.financial_account.features.send_moneybooleanOptional
body.components.financial_account.features.transfer_balancebooleanOptional
body.components.financial_account_transactionsobjectOptional
body.components.financial_account_transactions.enabledbooleanRequired within parent
body.components.financial_account_transactions.featuresobjectOptional
body.components.financial_account_transactions.features.card_spend_dispute_managementbooleanOptional
body.components.instant_payouts_promotionobjectOptional
body.components.instant_payouts_promotion.enabledbooleanRequired within parent
body.components.instant_payouts_promotion.featuresobjectOptional
body.components.instant_payouts_promotion.features.disable_stripe_user_authenticationbooleanOptional
body.components.instant_payouts_promotion.features.external_account_collectionbooleanOptional
body.components.instant_payouts_promotion.features.instant_payoutsbooleanOptional
body.components.issuing_cardobjectOptional
body.components.issuing_card.enabledbooleanRequired within parent
body.components.issuing_card.featuresobjectOptional
body.components.issuing_card.features.card_managementbooleanOptional
body.components.issuing_card.features.card_spend_dispute_managementbooleanOptional
body.components.issuing_card.features.cardholder_managementbooleanOptional
body.components.issuing_card.features.spend_control_managementbooleanOptional
body.components.issuing_cards_listobjectOptional
body.components.issuing_cards_list.enabledbooleanRequired within parent
body.components.issuing_cards_list.featuresobjectOptional
body.components.issuing_cards_list.features.card_managementbooleanOptional
body.components.issuing_cards_list.features.card_spend_dispute_managementbooleanOptional
body.components.issuing_cards_list.features.cardholder_managementbooleanOptional
body.components.issuing_cards_list.features.disable_stripe_user_authenticationbooleanOptional
body.components.issuing_cards_list.features.spend_control_managementbooleanOptional
body.components.notification_bannerobjectOptional
body.components.notification_banner.enabledbooleanRequired within parent
body.components.notification_banner.featuresobjectOptional
body.components.notification_banner.features.disable_stripe_user_authenticationbooleanOptional
body.components.notification_banner.features.external_account_collectionbooleanOptional
body.components.payment_detailsobjectOptional
body.components.payment_details.enabledbooleanRequired within parent
body.components.payment_details.featuresobjectOptional
body.components.payment_details.features.capture_paymentsbooleanOptional
body.components.payment_details.features.destination_on_behalf_of_charge_managementbooleanOptional
body.components.payment_details.features.dispute_managementbooleanOptional
body.components.payment_details.features.refund_managementbooleanOptional
body.components.payment_details.features.smart_disputes_managementbooleanOptional
body.components.payment_disputesobjectOptional
body.components.payment_disputes.enabledbooleanRequired within parent
body.components.payment_disputes.featuresobjectOptional
body.components.payment_disputes.features.destination_on_behalf_of_charge_managementbooleanOptional
body.components.payment_disputes.features.dispute_managementbooleanOptional
body.components.payment_disputes.features.refund_managementbooleanOptional
body.components.payment_disputes.features.smart_disputes_managementbooleanOptional
body.components.payment_method_settingsobjectOptional
body.components.payment_method_settings.enabledbooleanRequired within parent
body.components.payment_method_settings.featuresobjectOptional
body.components.payment_method_settings.features.disable_stripe_user_authenticationbooleanOptional
body.components.paymentsobjectOptional
body.components.payments.enabledbooleanRequired within parent
body.components.payments.featuresobjectOptional
body.components.payments.features.capture_paymentsbooleanOptional
body.components.payments.features.destination_on_behalf_of_charge_managementbooleanOptional
body.components.payments.features.dispute_managementbooleanOptional
body.components.payments.features.refund_managementbooleanOptional
body.components.payments.features.smart_disputes_managementbooleanOptional
body.components.payout_detailsobjectOptional
body.components.payout_details.enabledbooleanRequired within parent
body.components.payout_details.featuresobjectOptional
body.components.payout_reconciliation_reportobjectOptional
body.components.payout_reconciliation_report.enabledbooleanRequired within parent
body.components.payout_reconciliation_report.featuresobjectOptional
body.components.payoutsobjectOptional
body.components.payouts.enabledbooleanRequired within parent
body.components.payouts.featuresobjectOptional
body.components.payouts.features.disable_stripe_user_authenticationbooleanOptional
body.components.payouts.features.edit_payout_schedulebooleanOptional
body.components.payouts.features.external_account_collectionbooleanOptional
body.components.payouts.features.instant_payoutsbooleanOptional
body.components.payouts.features.standard_payoutsbooleanOptional
body.components.payouts_listobjectOptional
body.components.payouts_list.enabledbooleanRequired within parent
body.components.payouts_list.featuresobjectOptional
body.components.tax_registrationsobjectOptional
body.components.tax_registrations.enabledbooleanRequired within parent
body.components.tax_registrations.featuresobjectOptional
body.components.tax_settingsobjectOptional
body.components.tax_settings.enabledbooleanRequired within parent
body.components.tax_settings.featuresobjectOptional
body.expandarrayOptionalSpecifies which fields in the response should be expanded.
body.expand[]stringEach itemMaximum length: 5000

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Create an Account Session — response body

Referenced models: Create an Account Session — response body

18 more schemas are linked from the tables above, on the schema pages.

Create an Account Session — response body
FieldTypePresenceDescription and constraints
$objectRootAn 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](https://docs.stripe.com/connect/get-started-connect-embedded-components)
accountstringRequired within parentThe ID of the account the AccountSession was created for
Maximum length: 5000
client_secretstringRequired within parentThe 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](https://docs.stripe.com/connect/get-started-connect-embedded-components) and learn about how `client_secret` should be handled.
Maximum length: 5000
componentsModelRequired within parentExpand Create an Account Session — response body — components
expires_atJSONRequired within parent
expires_at (anyOf 1)integerAlternativeThe timestamp at which this AccountSession will expire.
Format: unix-time
expires_at (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
livemodebooleanRequired within parentIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: account_session

Referenced models: Create an Account Session — response body — components

Create an Account Session — response body — components
FieldTypePresenceDescription and constraints
$objectRoot
account_managementModelRequired within parentExpand Create an Account Session — response body — components account management
account_onboardingModelRequired within parentExpand Create an Account Session — response body — components account management
balance_reportModelRequired within parentExpand Create an Account Session — response body — components documents
balancesModelRequired within parentExpand Create an Account Session — response body — components payouts
disputes_listModelRequired within parentExpand Create an Account Session — response body — components payments
documentsModelRequired within parentExpand Create an Account Session — response body — components documents
financial_accountModelRequired within parentExpand Create an Account Session — response body — components financial account
financial_account_transactionsModelRequired within parentExpand Create an Account Session — response body — components financial account transactions
instant_payouts_promotionModelRequired within parentExpand Create an Account Session — response body — components instant payouts promotion
issuing_cardModelRequired within parentExpand Create an Account Session — response body — components issuing card
issuing_cards_listModelRequired within parentExpand Create an Account Session — response body — components issuing cards list
notification_bannerModelRequired within parentExpand Create an Account Session — response body — components account management
payment_detailsModelRequired within parentExpand Create an Account Session — response body — components payments
payment_disputesModelRequired within parentExpand Create an Account Session — response body — components payment disputes
payment_method_settingsModelRequired within parentExpand Create an Account Session — response body — components payment method settings
paymentsModelRequired within parentExpand Create an Account Session — response body — components payments
payout_detailsModelRequired within parentExpand Create an Account Session — response body — components documents
payout_reconciliation_reportModelRequired within parentExpand Create an Account Session — response body — components documents
payoutsModelRequired within parentExpand Create an Account Session — response body — components payouts
payouts_listModelRequired within parentExpand Create an Account Session — response body — components documents
tax_registrationsModelRequired within parentExpand Create an Account Session — response body — components documents
tax_settingsModelRequired within parentExpand Create an Account Session — response body — components documents

Referenced models: Create an Account Session — response body — components account management, Create an Account Session — response body — components documents, Create an Account Session — response body — components payments, Create an Account Session — response body — components financial account, Create an Account Session — response body — components financial account transactions, Create an Account Session — response body — components instant payouts promotion, Create an Account Session — response body — components issuing card, Create an Account Session — response body — components issuing cards list, Create an Account Session — response body — components payment disputes, Create an Account Session — response body — components payment method settings, Create an Account Session — response body — components payouts

Create an Account Session — response body — components account management
FieldTypePresenceDescription and constraints
$objectRoot
enabledbooleanRequired within parentWhether the embedded component is enabled.
featuresModelRequired within parentExpand Create an Account Session — response body — components account management features

Referenced models: Create an Account Session — response body — components account management features

Create an Account Session — response body — components documents
FieldTypePresenceDescription and constraints
$objectRoot
enabledbooleanRequired within parentWhether the embedded component is enabled.
featuresModelRequired within parentExpand Create a Payment Method — response body — zip

Referenced models: Create a Payment Method — response body — zip

Create an Account Session — response body — components payments
FieldTypePresenceDescription and constraints
$objectRoot
enabledbooleanRequired within parentWhether the embedded component is enabled.
featuresModelRequired within parentExpand Create an Account Session — response body — components payments features

Referenced models: Create an Account Session — response body — components payments features

Create a Payment Method — response body — zip
FieldTypePresenceDescription and constraints
$objectRoot

SDK function policy ID: stripe.postaccountsessions. Catalog operation: PostAccountSessions. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"Stripe-Version": "2026-09-30.endive"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.