Connect platforms using the Payment Methods API

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

    Stripe Connect platform owners can make use of additional payment methods supported with the Payment Methods API. 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 PaymentMethods directly on the connected account

    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. Direct charges require creating PaymentMethods on connected accounts. You can do so by passing paymentMethod.stripeAccount with a value of a connected account’s ID when using Stripe.js.

    // Set the connected Stripe Account on which the PaymentMethod should be created var stripe = Stripe('pk_test_TYooMQauvdEDq54NiTphI7jx', { stripeAccount: "{{CONNECTED_STRIPE_ACCOUNT_ID}}" }); stripe.createPaymentMethod('card', cardElement, { billing_details: { name: 'Jenny Rosen', }, }).then(function(result) { // Handle result.error or result.payment_method });
    // Set the connected Stripe Account on which the PaymentMethod should be created const stripe = Stripe('pk_test_TYooMQauvdEDq54NiTphI7jx', { stripeAccount: "{{CONNECTED_STRIPE_ACCOUNT_ID}}" }); (async () => { const {error, paymentMethod} = await stripe.createPaymentMethod('card', cardElement, { billing_details: { name: 'Jenny Rosen', }, }); // Handle error or paymentMethod })();

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

    Cloning PaymentMethods

    PaymentMethods can also be created on your platform and then cloned to a connected account to create direct charges there.

    After you create a PaymentMethod and attach it to a Customer, you can clone that PaymentMethod on a connected account using the connected account’s ID as the Stripe-Account header. Read more about the Payment Methods API.

    curl https://api.stripe.com/v1/payment_methods \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_GMPh1EIs9pkBxP \ -d payment_method=pm_123456789 \ -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' payment_method = Stripe::PaymentMethod.create({ customer: 'cus_GMPh1EIs9pkBxP', payment_method: 'pm_123456789', }, {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' payment_method = stripe.PaymentMethod.create( customer='cus_GMPh1EIs9pkBxP', payment_method='pm_123456789', 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'); $payment_method = \Stripe\PaymentMethod::create([ 'customer' => 'cus_GMPh1EIs9pkBxP', 'payment_method' => 'pm_123456789', ], ['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_GMPh1EIs9pkBxP"); params.put("payment_method", "pm_123456789"); RequestOptions requestOptions = RequestOptions.builder().setStripeAccount("{{CONNECTED_STRIPE_ACCOUNT_ID}}").build(); PaymentMethod paymentMethod = PaymentMethod.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'); (async () => { const paymentMethod = await stripe.paymentMethods.create({ customer: 'cus_GMPh1EIs9pkBxP', payment_method: 'pm_123456789', }, { 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.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.PaymentMethodParams{ Customer: stripe.String("cus_GMPh1EIs9pkBxP"), PaymentMethod: stripe.String("pm_123456789"), } params.SetStripeAccount("{{CONNECTED_STRIPE_ACCOUNT_ID}}") PaymentMethod, err := PaymentMethod.New(params)
    // 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 StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var paymentMethodOptions = new PaymentMethodOptions() { Customer = "cus_GMPh1EIs9pkBxP", PaymentMethod = "pm_123456789", }; var paymentMethodService = new PaymentMethodService(); var requestOptions = new RequestOptions() { StripeAccount = "{{CONNECTED_STRIPE_ACCOUNT_ID}}", }; PaymentMethod paymentMethod = paymentMethodService.Create(paymentMethodOptions, requestOptions);

    If you want to create PaymentMethods that can be reused multiple times on your connected account, you should make sure to attach them to Customers before using them with PaymentIntents to create charges. You must provide the Customer ID in the request when cloning PaymentMethods that are attached to Customers for security purposes.

    It is possible to clone PaymentMethods to connected accounts without previously attaching them to Customers. However, please note that the original PaymentMethod will be consumed, since PaymentMethods that are not attached to Customers can only be used once.

    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’re 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. When your platform is the merchant of record, the platform’s country and fee structure are used. Additionally, the platform’s name will be displayed in the customer’s bank statement.

    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