Stripe Custom Payment flow on multi-tenant SaaS

1,190 views
Skip to first unread message

sh22gr

unread,
Feb 22, 2023, 1:30:12 PM2/22/23
to Stripe API Discussion
I need your advice on how to best implement Custom Payment flow on a SaaS with multi-tenant, where each of the Saas users have their own Stripe account and use the software to charge their clients, for their services.
My concerns are about implementing Webhooks correctly.

User would enter their Stripe details (Keys) into their dashboard, stored into the DB.
On checkout, the corresponding keys will be retrieved and custom payment flow will be triggered, according to my clients goods they offer for sell.

How can i implement Webhooks correctly, since they are bound to each individual Stripe accounts and settings are also individual?

Has anyone ever made experience with that?

Cheers!

Amanda Lee

unread,
Feb 22, 2023, 1:48:15 PM2/22/23
to Stripe API Discussion, sh2...@gmail.com
Hello,

For a setup like yours I'd recommend building this using Stripe Connect (https://stripe.com/docs/connect/explore-connect-guide), which will allow you to make API requests on behalf of your connected accounts without needing to store their Stripe API keys on your end. More specifically, you can accomplish what you want by giving each of your users a Standard Connect account (https://stripe.com/docs/connect/standard-accounts) and creating direct charges on their accounts by using the Stripe-Account header and your own API keys (https://stripe.com/docs/connect/direct-charges). 

Connect also makes it much easier to handle webhook events. Instead of needing to create individual webhook endpoints for each account, you can create a single Connect webhook endpoint on your own account that will receive events from all your connected accounts. You can read more about this here: https://stripe.com/docs/connect/webhooks

Hope that helps!
Amanda

sh22gr

unread,
Mar 27, 2024, 7:05:38 AM3/27/24
to Stripe API Discussion, ah...@stripe.com, sh22gr
Dear Amanda, dear Stripe team,

i need your help again in how to implement the Connect flow.
As i said, i have two scenarios: a) onboarding (connecting) existing accounts & b) onboarding new users with Connect & Standard accounts.

Problem A
Until now i was prepared to use:
a) OAuth for existing accounts
b) Stripe hosted flow for creating new accounts
However, the post here states that OAuth is a legacy integration and 'Account Link' is preferable.
Is 'Account Link' the recommended way for existing accounts as well (not OAuth)? Because the official documentation states something different




Problem B
Testing (onboarding new accounts)
I am successful in creating a new account and redirecting to Stripe flow.
Since verifiication needs entering a phone number, i should be able to skip the form entirely (in test mode)...but i have no such option.
That option is only available in OAuth.
However (whether using the API, or creating user from within the dashboard), created accounts are 'restricted' and useless to use for testing payments on_behalf_of etc etc

HELP needed:
A) What is the correct way in testing the 'flow' implementation using the test data from your documentation?

B) Is 'Account Link' the recommended way for existing accounts as well (not OAuth)?

C) How do i create a new account verified and available for testing purposes?



Thank you for your support

Remi J.

unread,
Apr 9, 2024, 2:20:17 PM4/9/24
to api-d...@lists.stripe.com
(re-posting my earlier answer as it failed delivery on the mailing list)

Hello,

The alternative is focused more on new platforms creating brand new Stripe accounts for their users which is what is recommended. This path is easier to integrate with and ensures that you only have your own platform's activity in that Stripe account, separate from the merchant's own business or integration with other platforms. The idea is that you use the Create Account API [1] to create that new Stripe account and then you use the Create AccountLink API [2] to send them through our onboarding flow and provide all the information about their business.

Since you want to connect existing Standard accounts to your platform you will still have to use OAuth  for this instead and can disregard the warning.

If you have any follow up questions, I recommend reaching out to our support team for 1:1 support directly: https://support.stripe.com/contact

Best,
Remi


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

MD

unread,
Apr 10, 2024, 10:54:18 AM4/10/24
to api-d...@lists.stripe.com
Hello Remi,

thank you for your input, I really appreciate that.
But it is exactly the opposite to a response i got, from one of your colleagues, when asking for the preferred way of implementing Connect.
And now i am even more confused..

Yes, OAuth is not recommended for use cases where you will be connecting to existing accounts to process payments; it's only really intended for "read only" use cases where you have a need to read data from existing accounts(though these use cases should also migrate to Stripe Apps). Instead, yes, you should always be creating a new Account object in the API and using AccountLink
 If the user has an existing Stripe account, they will be able to claim the new account and link it with their main Stripe "user". Their account under your platform will appear in the drawdown account switcher in their Dashboard for instance. This is the recommended way to implement this(your platform has one-account-per-user and the user might have multiple accounts) as it's better from a data visibility perspective. See the links below for details on how this works. 

I already contacted Stripe support and they answered back, asking if i have webhooks setup so i can control everything trough webhooks, since testing with Create Account & Create AccountLink API seems to be impossible.
To me it seems like NOT testing the flow is the best.
But not being sure what to implement (because of different recommendations from Stripe) makes things harder.

Warm regards
Dimitrios

Remi J.

unread,
Apr 10, 2024, 10:58:50 AM4/10/24
to api-d...@lists.stripe.com
I'm sorry I don't really follow the context of what you quoted compared to the person originally asking about this email thread.

You are asking to be able to connect to an existing Stripe account. If you want to do that, you can not simply create a new Stripe account, since it would be a separate Stripe account. If your use-case requires being connected to an existing Stripe account then you can use OAuth or build a Stripe App instead.
If instead you want to create a brand new Stripe account to process transactions specific to your platform then using the Create Account API is the right approach.

At this point, the next step will be to work 1:1 with our support team instead of this public list so that they can provide you the best advice based on your detailed business model and all extra information necessary to guide you: https://support.stripe.com/contact

Best,
Remi
Reply all
Reply to author
Forward
0 new messages