Yajant Bhawsar
Yajant Bhawsar

Reputation: 51

How to achieve shared customers across accounts in stripe ? (Clone customers across accounts)

I am working on stripe payments, where i require having a shared customer across different connected accounts, that are connected with the platform

I am using "Express Accounts" in stripe connect for connecting the connected accounts, that are linked with the platform account.

On the frontend (client-side) (Angular), using the "Stripe Prebuilt checkout page", for accepting payment and I am verifying the payment in webhooks(checkout.session.completed) at backend using Django Rest Framework.

I am using Destination Charges, for handling the payments and separate charges and transfers. (That i am able to achieve using stripe prebuilt checkout page by specifying payment_intent_data.application_fee_amount and payment_intent_data.transfer_data.destination)

A destination charge means the charge is processed on the platform and then the funds are immediately and automatically transferred to the connected account’s pending balance.

Now I have a requirement where I need to have shared customers and share customers across the connected accounts,

  1. Is it even possible to achieve shared customers using a stripe prebuilt checkout page?
  2. If yes, how can I achieve it?
  3. Or Do I need to go with "Custom payment flow" for accepting a payment?

I tried to follow this article Clone customers across accounts but I have not had any luck, unfortunately.

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

  1. Storing customers, with a payment method, on the platform account

  2. Making 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

  1. For step 2. when do I need to create a token?
  2. After which webhook event (payment_intent.succeeded ? or checkout.session.completed ?), do I need to create the token and Clone customers across accounts?

I can also attach any code for your review and show you what I have tried by now.

Please let me know in the comments if you need it.

Upvotes: 2

Views: 1858

Answers (1)

hmunoz
hmunoz

Reputation: 3351

A big thing to clarify:

  1. If you are using Destination Charges, your cards, customers and payments all live on the Platform account.

Therefore, it isn't clear why you want to create these "shared" customers on the Connect accounts, this sounds like you're approaching this the wrong way. You only need customers on Connect accounts if you're using Direct Charges.

I tried to follow this article Clone customers across accounts but I have not had any luck, unfortunately.

This approach clones "tokens" for you i.e. clone a token from the Platform account to a Connect account. You cannot clone customers on Stripe, the API doesn't support it. You can manually create 'n' customers and have to manage the state between them yourself.

After which webhook event (payment_intent.succeeded ? or checkout.session.completed ?), do I need to create the token and Clone customers across accounts?

If you're using Checkout, you use the checkout.session.completed event.

If you're using PaymentIntents and creating payments using Stripe Elements, you use payment_intent.succeeded

Please let me know if that clarifies things.

Upvotes: 1

Related Questions