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.
Call through Alter
Section titled “Call through Alter”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 osfrom alter_sdk import Appfrom 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()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
headers | object | Optional | Additional keys: not allowed |
headers.Idempotency-Key | string | Optional | Minimum length: 1 Maximum length: 255 |
body | object | Required within parent | Additional keys: not allowed |
body.account | string | Required within parent | The identifier of the account to create an account link for. Maximum length: 5000 |
body.collect | string | Optional | The collect parameter is deprecated. Use `collection_options` instead. One of: currently_due, eventually_due |
body.collection_options | object | Optional | Specifies the requirements that Stripe collects from connected accounts in the Connect Onboarding flow. |
body.collection_options.fields | string | Optional | One of: currently_due, eventually_due |
body.collection_options.future_requirements | string | Optional | One of: include, omit |
body.expand | array | Optional | Specifies which fields in the response should be expanded. |
body.expand[] | string | Each item | Maximum length: 5000 |
body.refresh_url | string | Optional | The 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_url | string | Optional | The URL that the user will be redirected to upon leaving or completing the linked flow. |
body.type | string | Required within parent | The 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
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Create an account link — response body |
Referenced models: Create an account link — response body
Schemas
Section titled “Schemas”Create an account link — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Account 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) |
created | JSON | Required within parent | |
created (anyOf 1) | integer | Alternative | Time at which the object was created. Measured in seconds since the Unix epoch. Format: unix-time |
created (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
expires_at | JSON | Required within parent | |
expires_at (anyOf 1) | integer | Alternative | The timestamp at which this account link will expire. Format: unix-time |
expires_at (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
object | string | Required within parent | String representing the object's type. Objects of the same type share the same value. Known values: account_link |
url | string | Required within parent | The URL for the account link. Maximum length: 5000 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”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"}