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 that use cards, your platform name appears on statement descriptors and the charge is attributed to the connected account. With destination charges that use alternative payment methods (APMs), your platform name appears on statement descriptors but the charge is attributed to your platform.

    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_TYooMQauvdEDq54NiTphI7jx',
      {stripeAccount: "{{CONNECTED_STRIPE_ACCOUNT_ID}}"},
    );
    
    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.

    Cloning 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 cloned to a connected account to create direct charges there.

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

    curl https://api.stripe.com/v1/sources \
      -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
      -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_4eC39HqLyjWDarjtT1zdp7dc'
    
    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_4eC39HqLyjWDarjtT1zdp7dc'
    
    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_4eC39HqLyjWDarjtT1zdp7dc');
    
    $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.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";
    
    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
    const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc');
    
    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_4eC39HqLyjWDarjtT1zdp7dc"
    
    params := &stripe.SourceObjectParams{
      Customer: stripe.String("cus_AFGbOSiITuJVDs"),
      OriginalSource: stripe.String("src_19YP2AAHEMiOZZp1Di4rt1K6"),
      Usage: stripe.String(string(stripe.SourceUsageReusable)),
    }
    params.SetStripeAccount("{{CONNECTED_STRIPE_ACCOUNT_ID}}")
    s, err := source.New(params)
    

    Card Sources are generally reusable. However, when cloning them, you can override the usage to constrain how the connected account uses them. You do so by specifying the usage as single_use when cloning 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 and Customers for more details on how to attach and manage Sources on Customers.

    Related resources

    Was this page helpful?

    Thank you for helping improve Stripe's documentation. If you need help or have any questions, please consider contacting support.

    On this page