For some business models, it’s useful to reuse your customers’ payment information across connected accounts. For example, a customer who makes a purchase from one of your connected sellers wouldn’t need to re-enter their credit card or bank account details to purchase from another seller.
With Connect, this is possible by storing all Stripe Customer objects on the platform account. Whenever you’d like to reuse customer payment information, you’ll make an extra token creation API request to fetch the relevant data from Stripe.
Storing Stripe customers
Normally, without shared customers, you would save the Stripe Customer objects on each individual Stripe account. To share customers, you’ll instead save the customers on your (the platform owner) Stripe account.
Be sure to use your own secret and publishable keys instead of the connected user’s authorization credentials. You want to save the customer objects on your own Stripe account, not on your users’ accounts.
Charging a customer
When you’re ready to charge a saved customer, you’ll need:
- The Stripe account ID (it looks something like
acct_MRREArjDJIBLA7aE) of the Stripe user for whom you’re making the charge
- The customer ID (it looks something like
cus_1P1d620xooSYxZ3s) of the customer (in the platform account) being charged. Note that the customer object must be stored on the platform’s Stripe account.
- The card or bank account ID for that customer, if you want to charge a specific card or bank account rather than the default.
Make a create token API request, passing in the customer ID (and optionally, the card or bank account ID):
Like a regular token creation, this returns a token that acts as a credit card number. You can use the token to create a one-time charge or even save the customer (again) to the connected account. If you save the customer on a connected account, you can also create a subscription for them (to a plan defined on the connected account).
Read up on the rest of this section to discover what other functionality is available for your users.