Introduction
    Authentication
    Connected Accounts
    Errors
    Expanding Responses
    Idempotent requests
    Include-dependent response values (API v2)
    Metadata
    Pagination
    Request IDs
    Versioning
Core Resources
    Balance
    Balance Transactions
    Charges
    Customers
    Customer Session
    Disputes
    Events
    Eventsv2
    Event Destinationsv2
    Files
    File Links
    Mandates
    Payment Intents
    Setup Intents
    Setup Attempts
    Payouts
    Refunds
    Confirmation Token
    Tokens
Payment Methods
    Payment Methods
    Payment Method Configurations
    Payment Method Domains
    Bank Accounts
    Cash Balance
    Cash Balance Transaction
    Cards
    Sources
Products
    Products
    Prices
    Coupons
    Promotion Code
    Discounts
    Tax Code
    Tax Rate
    Shipping Rates
Checkout
    Checkout Sessions
Payment Links
    Payment Link
Billing
    Credit Note
    Customer Balance Transaction
    Customer Portal Session
    Customer Portal Configuration
    Invoices
    Invoice Items
    Invoice Line Item
    Invoice Payment
    Invoice Rendering Templates
    Billing Profilev2
    Billing Intentsv2
    Alerts
    Meters
    Meter Events
    Meter Eventsv2
    Meter Event Adjustment
    Meter Event Adjustmentsv2
    Meter Event Streamsv2
    Meter Event Summary
    Meter Usage Data
    Credit Grant
    Credit Balance Summary
    Credit Balance Transaction
    Plans
    Billing Cadencesv2
    License Feesv2
    License Fee Subscriptionsv2
    Metered Itemsv2
    Custom Pricing Unitsv2
    Licensed Itemsv2
    Service Actionsv2
    Rate Cardsv2
    Rate Card Subscriptionsv2
    Pricing Plansv2
    Pricing Plan Subscriptionsv2
    Quote
    Subscriptions
    Subscription Items
    Subscription Schedule
    Tax IDs
    Test Clocks
Capital
    Financing Offer
    Financing Summary
Connect
    Accounts
    Login Links
    Account Links
    The Account Link objectCreate an account link
    Account Session
    Application Fees
    Application Fee Refunds
    Capabilities
    Country Specs
    External Bank Accounts
    External Account Cards
    Person
    Top-ups
    Transfers
    Transfer Reversals
    Secrets
Reserves
    Overview
    Reserve Holds
    Reserve Plans
    Reserve Releases
Fraud
    Early Fraud Warning
    Reviews
    Value Lists
    Value List Items
Issuing
    Authorizations
    Cardholders
    Cards
    Disputes
    Funding Instructions
    Personalization Designs
    Physical Bundles
    Tokens
    Transactions
Terminal
    Connection Token
    Location
    Reader
    Terminal Hardware Order
    Terminal Hardware Product
    Terminal Hardware SKU
    Terminal Hardware Shipping Method
    Configuration
Treasury
    Financial Accounts
    Financial Account Features
    Transactions
    Transaction Entries
    Outbound Transfers
    Outbound Payments
    Inbound Transfers
    Received Credits
    Received Debits
    Credit Reversals
    Debit Reversals
Entitlements
    Feature
    Product Feature
    Active Entitlement
Sigma
    Scheduled Queries
    Query Run
Reporting
    Report Runs
    Report Types
    Report Runsv2
    Reportsv2
Financial Connections
    Accounts
    Account Owner
    Session
    Transactions
Tax
    Tax Calculations
    Tax Registrations
    Tax Transactions
    Tax Settings
Identity
    Verification Session
    Verification Report
Crypto
    Crypto Onramp Session
    Crypto Onramp Quotes
Climate
    Climate Order
    Climate Product
    Climate Supplier
Forwarding
    Forwarding Request
Privacy
    Redaction Job
    Redaction Job Validation Error
Webhooks
    Webhook Endpoints
Sandboxes
    Claimable Sandboxesv2
  • Ruby SDK 15.5.0 • Basil
  • API Reference
  • Docs
  • Support
  • Sign in →

Create an account link 

Connect
Account Links
Create an account link

Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow.

Parameters

  • accountstringRequired

    The identifier of the account to create an account link for.

  • typeenumRequired

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

    Possible enum values
    account_onboarding

    Provides a form for inputting outstanding requirements. Send the user to the form in this mode to just collect the new information you need.

    account_update

    Displays the fields that are already populated on the account object, and allows your user to edit previously provided information. Consider framing this as “edit my profile” or “update my verification information”.

  • refresh_urlstringRequired

    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.

  • return_urlstringRequired

    The URL that the user will be redirected to upon leaving or completing the linked flow.

More parameters

  • collectenumDeprecated

    The collect parameter is deprecated. Use collection_options instead.

    Possible enum values
    currently_due
    eventually_due
  • collection_optionshash

    Specifies the requirements that Stripe collects from connected accounts in the Connect Onboarding flow.

    • collection_options.fieldsenum

      Specifies whether the platform collects only currently_due requirements (currently_due) or both currently_due and eventually_due requirements (eventually_due). If you don’t specify collection_options, the default value is currently_due.

      Possible enum values
      currently_due
      eventually_due
    • collection_options.future_requirementsenum

      Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. The default value is omit.

      Possible enum values
      include
      omit

Returns

Returns an account link object if the call succeeded.

POST /v1/account_links
Stripe.api_key = 'sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2'
account_link = Stripe::AccountLink.create({
account: 'acct_1Mt0CORHFI4mz9Rw',
refresh_url: 'https://example.com/reauth',
return_url: 'https://example.com/return',
type: 'account_onboarding',
})
Response
{
"object": "account_link",
"created": 1680577733,
"expires_at": 1680578033,
"url": "https://connect.stripe.com/setup/c/acct_1Mt0CORHFI4mz9Rw/TqckGNUHg2mG"
}