Connect Platforms Using the Sources API

    Considerations for Stripe Connect platforms adding support for new payment methods using the Sources API.

    Stripe Connect platform owners can make use of additional payment methods supported with Sources. To learn more about creating payments for connected users, and which approach is best for you, refer to our Connect payments and fees documentation.

    Creating destination charges

    If you opt for destination charges, you should create Sources on your platform directly and create Charges using the appropriate destination parameter. Customers are charged by your platform, which then transfers the necessary amount to the destination account.

    With destination charges, your platform is the merchant of record on the transaction and your platform name will appear on statement descriptors.

    Creating direct charges

    If you opt for direct charges, you will need to make sure that the connected account is onboarded on the payment method you intend to use (see below). Direct charges require creating sources on connected accounts. You can do so by passing source.stripeAccount with a value of a connected account’s ID when using Stripe.js.

    // Set the connected Stripe Account on which the source should be created
    var stripe = Stripe(
      'pk_test_6pRNASCoBOKtIshFeQd4XMUh',
      {stripeAccount: "acct_24BFMpJ1svR5A89k"},
    );
    
    stripe.createSource({
      type: 'ideal',
      amount: 1099,
      currency: 'eur',
      owner: {
        name: 'Jenny Rosen',
      },
      redirect: {
        return_url: 'https://shop.example.com/crtA6B28E1',
      },
    }).then(function(result) {
      // handle result.error or result.source
    });
    

    If you’re creating sources server-side, you can make use of authentication using the Stripe-Account header with any of our supported libraries.

    Shared card Sources

    Card Sources (because they are not intrinsically tied to your platform as they do not require any authentication flow) can be created on your platform and then shared to connected account to create direct charges there.

    Once you created a card Source and attached it to a Customer (see Sources & Customer for more details on how these two objects interact), you can share that card Source on a connected account using the connected account’s ID as Stripe-Account header:

    curl https://api.stripe.com/v1/sources \
       -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
       -d customer=cus_AFGbOSiITuJVDs \
       -d original_source=src_19YP2AAHEMiOZZp1Di4rt1K6 \
       -d usage=reusable \
       -H "Stripe-Account: {CONNECTED_STRIPE_ACCOUNT_ID}"
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    token = Stripe::Source.create({
      :customer => "cus_AFGbOSiITuJVDs",
      :original_source => "src_19YP2AAHEMiOZZp1Di4rt1K6",
      :usage => "reusable",
    }, {:stripe_account => "{CONNECTED_STRIPE_ACCOUNT_ID}"})
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    token = stripe.Source.create(
      customer="cus_AFGbOSiITuJVDs",
      original_source="src_19YP2AAHEMiOZZp1Di4rt1K6",
      usage="reusable",
      stripe_account="{CONNECTED_STRIPE_ACCOUNT_ID}",
    )
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    $token = \Stripe\Source::create(array(
      "customer" => "cus_AFGbOSiITuJVDs",
      "original_source" => "src_19YP2AAHEMiOZZp1Di4rt1K6",
      "usage" => "reusable",
    ), array("stripe_account" => "{CONNECTED_STRIPE_ACCOUNT_ID}"));
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2";
    
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("customer", "cus_AFGbOSiITuJVDs");
    params.put("original_source", "src_19YP2AAHEMiOZZp1Di4rt1K6");
    params.put("usage", "reusable");
    
    RequestOptions requestOptions = RequestOptions.builder().setStripeAccount("{CONNECTED_STRIPE_ACCOUNT_ID}").build();
    
    Source source = Source.create(params, requestOptions);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    var stripe = require("stripe")("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    stripe.sources.create({
      customer: "cus_AFGbOSiITuJVDs",
      usage: "reusable",
      original_source: "src_19YP2AAHEMiOZZp1Di4rt1K6",
    }, {
      stripe_account: "{CONNECTED_STRIPE_ACCOUNT_ID}",
    }).then(function(token) {
      // asynchronously called
    });
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
    
    params := &stripe.SourceObjectParams{
      Customer: "cus_AFGbOSiITuJVDs",
      OriginalSource: "src_19YP2AAHEMiOZZp1Di4rt1K6",
      Usage: "reusable",
    }
    params.SetStripeAccount("{CONNECTED_STRIPE_ACCOUNT_ID}")
    source, err := source.New(params)
    

    Please note that while card Sources are generally reusable, when sharing them you can override the usage to constrain how they are use by the connected account by specifying single-use as usage when sharing the Source.

    If you are creating reusable card Sources on your connected account, you should make sure to attach them to Customers before charging them. Please refer to Sources & Customers for more details on to attach and manage Sources on Customers.

    Onboarding of connected accounts

    We are currently working on enabling Connect platforms to activate payment methods for their users programmatically. If you are interested in this functionality, please get in touch.

    As a fallback, if you are relying on Standard accounts you can direct your users to their payment settings so that they can enable payment methods from the Stripe dashboard. Alternatively you can rely on destination charges with the caveat that your platform will be the merchant of record on these payments, not the connected account.

    Related resources