Creating a Subscription on a Connected Account

139 views
Skip to first unread message

Vitor

unread,
Mar 19, 2023, 11:44:32 PM3/19/23
to Stripe API Discussion
Hey there,

I'm building a Platform that uses Direct Charges on Connected Accounts. I want the Customer to input their card details at the very beginning of the subscription process and for those to be stored on the Platform, so I can enable one-click subscriptions on other Connected Accounts, for that Customer.

Here's the process I eventually mangled together through trial and error and following the guides
  1. Create a Customer on the platform.
  2. Collect the Customer's card details using a SetupIntent on_behalf_of the Connected Account. This will create a Payment Method on the platform's Customer.
  3. Create a Customer on the Connected Account using data already collected on the platform's Customer.
  4. Clone the latest Payment Method on the platform's Customer, to the Connected Account.
  5. Attach the cloned Payment Method to the Connected Account's Customer.
  6. Update the Customer's default_payment_method to the just-attached Payment Method.
  7. Create the Subscription, on the Connected Account, with off_session = true.
Is this the correct way of going about it? Is there a simpler or better way of doing it?

Thanks!

Remi J.

unread,
Mar 19, 2023, 11:47:38 PM3/19/23
to api-d...@lists.stripe.com
Hello Vitor,

If you want to save card details on the platform first then this is the correct way to set this up. You could combine step #3, #5 and #6 in one API request to simplify so my recommended flow would look like this:

1. Create a Customer on the platform.
2. Collect the Customer's card details using a SetupIntent on_behalf_of the Connected Account. This will create a Payment Method on the platform's Customer.
3. Clone the latest Payment Method on the platform's Customer, to the Connected Account.
4. Create a Customer on the Connected Account using data already collected on the platform's Customer. Also pass the id of the Payment Method created at step 3 in `payment_method` and `invoice_settings[default_payment_method]` which can all be done in one call
5. Create the Subscription, on the Connected Account, with off_session = true.

Hope this helps!
Remi


--
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.

Vitor

unread,
Mar 20, 2023, 12:37:37 PM3/20/23
to Stripe API Discussion, re...@stripe.com
I'll use your suggestion when creating Customers and keep mine when updating the PaymentMethod on an existing Customer.
Thanks for the help, Remi.
Reply all
Reply to author
Forward
0 new messages