Sign in
An image of the Stripe logo
Create account
Sign in
Home
Payments
Business operations
Financial services
Developer tools
Security
All products
Home
Payments
Business operations
Home
Payments
Business operations
Financial services
Developer tools
Support

Clone customers across accounts

With Connect, you can clone your customers' payment information across multiple connected accounts for reuse.

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 to use your own secret and publishable keys instead of the connect account’s.

curl https://api.stripe.com/v1/customers \ -u
sk_test_4eC39HqLyjWDarjtT1zdp7dc
: \ -d email="paying.user@example.com" \ -d source=tok_mastercard

Creating tokens

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_hsyV4xz7hVCprFYE) that you’re creating the charge for
  • The ID of the customer in your platform account (for example, cus_8CKgJwv8WD4z97) 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
Terminal
curl https://api.stripe.com/v1/tokens \ -u
sk_test_4eC39HqLyjWDarjtT1zdp7dc
: \ -d "customer"="{{CUSTOMER_ID}}" \ -H "Stripe-Account: {{CONNECTED_STRIPE_ACCOUNT_ID}}"

Creating charges

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

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.

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.

Terminal
curl https://api.stripe.com/v1/customers \ -u
sk_test_4eC39HqLyjWDarjtT1zdp7dc
: \ -d "source"="tok_mastercard" \ -H "Stripe-Account: {{CONNECTED_STRIPE_ACCOUNT_ID}}"

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

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

See also

  • Creating charges
  • Creating direct charges
Was this page helpful?
Questions? Contact us.
View developer tutorials on YouTube.
Check out our product changelog.
Powered by Markdoc
You can unsubscribe at any time. Read our privacy policy.
On this page
Storing customers
Creating tokens
Creating charges
Stripe Shell
Test mode
▗▄ ▄▟█ █▀▀ ▗▟████▙▖ ██████ ███▗▟█ ███ ███▗▟██▙▖ ▗▟█████▙▖ ███▖ ▀▀ ███ ███▀▀▀ ███ ███▀ ███ ███ ███ ▝▜████▙▖ ███ ███ ███ ███ ███ █████████ ▄▄ ▝███ ███ ▄ ███ ███ ███▄ ███ ███ ▄▄ ▝▜████▛▘ ▝▜███▛ ███ ███ ███▝▜██▛▘ ▝▜█████▛▘ ███ ▀▘
Welcome to the Stripe Shell! Stripe Shell is a browser-based shell with the Stripe CLI pre-installed. Login to Stripe docs and press Control + Backtick on your keyboard to start managing your Stripe resources in test mode. - View supported commands: - Find webhook events: - Listen for webhook events: - Call Stripe APIs: stripe [api resource] [operation] (e.g. )
The Stripe Shell is best experienced on desktop.
$