Get account ID of connected stripe account

14,721

I came here from a Google search with a similar issue. It is actually easy to get from the OAUTH flow, the documentation just does not make it clear which field it is. In short, the missing link is that the CONNECTED_STRIPE_ACCOUNT_ID is the stripe_user_id that you get at the end of the OAUTH flow when the account is connected as per https://stripe.com/docs/connect/standalone-accounts

In their example response at the end of the flow

{
"token_type": "bearer",
"stripe_publishable_key": PUBLISHABLE_KEY,
"scope": "read_write",
"livemode": false,
"stripe_user_id": USER_ID,  //this is it
"refresh_token": REFRESH_TOKEN,
"access_token": ACCESS_TOKEN
}
Share:
14,721
Richard Testani
Author by

Richard Testani

Web developer & designer. Love working with PHP, JavaScript and CSS.

Updated on June 26, 2022

Comments

  • Richard Testani
    Richard Testani almost 2 years

    When I run a test for connecting a user to accept payments through my application, I will need the account id to charge their account.

    Stripe\Token::create(
    array("customer" => CUSTOMER_ID, "card" => CARD_ID),
    array("stripe_account" => CONNECTED_STRIPE_ACCOUNT_ID) // id of the connected account
    );
    

    In this snippet (from Stripe), the CONNECTED_STRIPE_ACCOUNT_ID implies the connecting about id which starts with acct_

    How do I obtain this ?

    Thanks, Rich.

  • Isuru Fonseka
    Isuru Fonseka over 7 years
    The way to get your connected user's account Id is to extract the user ID from the StripeOAuthToken. What is confusing is StripeUserID = AccountID