#Bossin

1 messages · Page 1 of 1 (latest)

robust mortarBOT
somber timber
fresh prawn
#

Thanks, Jack! Didn’t know that was encouraged. Will update my requests to suit that. Super easy to do the other requests that way too.

#

Sorry @somber timber, I just noticed that the Stripe secret is still required. How would I get the connected account ID for a secret provided by my client (to their Stripe account)?

somber timber
fresh prawn
#

I’m not sure I follow. It is a server side request. There are multiple secrets that I have, one is mine and the others are my customers. I need to be able to swap the secret based on the action I’m doing. So for example, if I’m charging my customers for their subscription I need to use my secret. When creating a payment link that my customer will send to their customer, I need to use their secret which is stored in the DB.

somber timber
#

Again, using connected account's secret directly is discouraged.

  1. Your connect account can roll the secret anytime
  2. you are responsible to keep the secret safe.
#

Instead of using the key, you should specify the account ID in the Stripe-Account header so that you can make API request on behalf of the connected accounts. You can find out details in the doc I sent earlier.

fresh prawn
#

The docs you sent uses the secret and the connected account in the header. How do I use the customers account with my secret? There has to be a way to get their account ID, right? I didn’t think it was possible to perform requests on behalf of them with my secret.

somber timber
#

The secret is your secret (e.g., platform), not connected account's secret.

fresh prawn
#

So to clarify, I can use my Stripe secret to perform actions on another Stripe account by using the account ID in the header? E.g. using ‘Stripe.apiKey = {{my secret}}’ then using their account ID in the header

somber timber
#

Yes you are right

fresh prawn
#

How would I get their user account ID? Would this have to be manual from them?

#

And store that instead of their secret?

#

It just seems a little unconventional to me and doesn’t make sense. If a user used their secret and just happened to randomly use my account ID, they could create payouts from my account. Is that right?

somber timber
#

No they can't. Only the controlling platform can create API request on behalf of connected accounts

fresh prawn
#

Connect is exactly what I was after. Thanks Jack 👍