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 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 for the Stripe user for whom you’re making the charge
- The customer ID (it looks something like
cus_N6rVkPGXdsALfGnT) 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 ID for that customer, if you want to charge a specific card rather than the default.
Make a create token API request, passing in the customer ID (and optionally, the card 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.