Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Developer tools
Get started
Payments
Finance automation
Get started
Payments
Finance automation
Platforms and marketplaces
Money management

Clone customer payment information across connected accountsLegacy

Reuse payment information across multiple connected accounts that share customers.

Caution

The content of this page describes a legacy feature. Support for it might end without notice, so if you use this feature, update your integration to use the current process for reusing payment information across connected accounts. For more information, see Share payment methods across multiple accounts.

For some business models, it’s helpful to reuse your customers’ payment information across connected accounts. For example, a customer who makes a purchase from one of your connected sellers shouldn’t need to re-enter their credit card or bank account details to purchase from another seller.

With Connect, you can accomplish this by following three steps:

  1. Storing customers, with a payment method, on the platform account.
  2. Creating tokens to clone the payment method when it’s time to charge the customer on behalf of a connected account.
  3. Creating charges using the new tokens.

Storing customers

Cloning saved payment methods is only relevant when creating direct charges on connected accounts. It’s not necessary when making charges on your platform account.

When not cloning payment methods, you save the Stripe Customer objects on each individual connected Stripe account. When cloning payment methods, you instead save them on the platform Stripe account.

This is an API call but be sure you use your own secret and publishable keys instead of the connect account’s.

Command Line
cURL
curl https://api.stripe.com/v1/customers \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ --data-urlencode email="paying.user@example.com" \ -d source=tok_mastercard

Creating tokens

Caution

If your platform uses the Sources API, you must create a Source from that customer rather than creating a token. If your platform uses the Payment Methods API, you must create a PaymentMethod from that customer. After following either of these guides, proceed to Creating charges without creating a token.

When you’re ready to create a charge on a connected account using a customer saved on your platform account, create a new token for that purpose. You’ll need:

  • The Stripe account ID of the connected account (for example, acct_gjDVzcEtxL67rz8r) that you’re creating the charge for
  • The ID of the customer in your platform account (for example, cus_aPVvgS5T4TD1dY) being charged
  • The card or bank account ID for that customer, if you want to charge a specific card or bank account rather than the default
Command Line
cURL
curl https://api.stripe.com/v1/tokens \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -H "Stripe-Account:
{{CONNECTED_ACCOUNT_ID}}
"
\ -d customer=
{{CUSTOMER_ID}}

Creating charges

With the token generated in the previous step, attach this token to a customer on the connected account.

Caution

Charges that are made on the cloned customer aren’t reflected on the original customer. This feature is intended for multiple connected accounts that need to charge the same user.

Caution

If your platform uses the Payment Methods API, you must pass the payment method ID as the payment_method parameter instead of passing the source parameter.

Command Line
cURL
curl https://api.stripe.com/v1/customers \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -H "Stripe-Account:
{{CONNECTED_ACCOUNT_ID}}
"
\ -d source=
{{TOKEN_ID}}

Then, use the customer ID (for example, cus_hp6TqtYtQIBXv1) and the payment method ID (for example, card_2TdD2iR1oXF874) returned by the customers.create call to charge the customer.

Command Line
cURL
curl https://api.stripe.com/v1/payment_intents \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -H "Stripe-Account:
{{CONNECTED_ACCOUNT_ID}}
"
\ -d amount=999 \ -d currency=usd \ -d "payment_method_types[]"=card \ -d customer=
{{CUSTOMER_ID}}
\ -d payment_method=
{{PAYMENT_METHOD_ID}}

See also

  • Creating charges
  • Creating direct charges
Was this page helpful?
YesNo
Need help? Contact Support.
Join our early access programme.
Check out our changelog.
Questions? Contact Sales.
LLM? Read llms.txt.
Powered by Markdoc