Skip to content

Stripe: Create an account link

Stripe accountLinks.postAccountLinks: arguments, response, policy and SDK examples.

← Account links operations · Get started

Operation stripe.postaccountlinks

Provider route: POST /v1/account_links. 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["accountLinks"]["postAccountLinks"]>[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.accountLinks.postAccountLinks(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_links.post_account_links(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 link for.
Maximum length: 5000
body.collectstringOptionalThe collect parameter is deprecated. Use `collection_options` instead.
One of: currently_due, eventually_due
body.collection_optionsobjectOptionalSpecifies the requirements that Stripe collects from connected accounts in the Connect Onboarding flow.
body.collection_options.fieldsstringOptionalOne of: currently_due, eventually_due
body.collection_options.future_requirementsstringOptionalOne of: include, omit
body.expandarrayOptionalSpecifies which fields in the response should be expanded.
body.expand[]stringEach itemMaximum length: 5000
body.refresh_urlstringOptionalThe URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link’s URL so they can continue with Connect Onboarding. If a new account link cannot be generated or the redirect fails you should display a useful error to the user.
body.return_urlstringOptionalThe URL that the user will be redirected to upon leaving or completing the linked flow.
body.typestringRequired within parentThe type of account link the user is requesting.

You can create Account Links of type `account_update` only for connected accounts where your platform is responsible for collecting requirements, including Custom accounts. You can’t create them for accounts that have access to a Stripe-hosted Dashboard. If you use [Connect embedded components](/connect/get-started-connect-embedded-components), you can include components that allow your connected accounts to update their own information. For an account without Stripe-hosted Dashboard access where Stripe is liable for negative balances, you must use embedded components.
One of: account_onboarding, account_update

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 link — response body

Referenced models: Create an account link — response body

Create an account link — response body
FieldTypePresenceDescription and constraints
$objectRootAccount Links are the means by which a Connect platform grants a connected account permission to access
Stripe-hosted applications, such as Connect Onboarding.

Related guide: [Connect Onboarding](https://docs.stripe.com/connect/custom/hosted-onboarding)
createdJSONRequired within parent
created (anyOf 1)integerAlternativeTime at which the object was created. Measured in seconds since the Unix epoch.
Format: unix-time
created (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
expires_atJSONRequired within parent
expires_at (anyOf 1)integerAlternativeThe timestamp at which this account link will expire.
Format: unix-time
expires_at (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: account_link
urlstringRequired within parentThe URL for the account link.
Maximum length: 5000

SDK function policy ID: stripe.postaccountlinks. Catalog operation: PostAccountLinks. 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.