#y3ll0wFlash
1 messages · Page 1 of 1 (latest)
Sure
req_zCmREnl6lgwJxs
do you have a request id where this is working for you?
Sure. here is one from another connect account that seems to be working
req_vU37NGZJdbjCd4
I'm looking at the difference between the two accounts
oh sorry I just realized that you've passed the customer to this request req_zCmREnl6lgwJxs as the Platform account and not as a Connected Account
you need to always pass Stripe-Account id to authenticate as a Connect Account when using customer in the tokens API
customer is passed in both of these requests so shouldn't it raise the error in both of these cases?
or do you mean that in the failing request, the customer id is actually the ID of the platform account and not of any connected account?
no, because the other case is a special case since it's cloning a card from the customer on the platform. In that specific endpoint with those specific parameters you can make a request on a connected account but refer to a customer on a platform, but not in any other context
yes
your working example is you doing https://stripe.com/docs/connect/cloning-customers-across-accounts#creating-tokens exactly as documented
your broken example is you making that API call but not doing it correctly (not passing the Stripe-Account option)
do you think it's a bug?
not really
the ID is passed as a HTTP header, not a POST parameter
maybe that's what confuses you
there's no bug here on our side
Sorry I had sent a screenshot alongwith this msg but that wasn't uploaded. so apologies for the confusing msg.
I just checked the stripe's source code and how we send the account ID. I can confirm that we are indeed sending the account ID
Does stripe dashboard show request headers at any place? where we can confirm this from?
I saw the screenshot, no worries
I just checked the stripe's source code and how we send the account ID. I can confirm that we are indeed sending the account ID
you don't need to look at our code, not sure why you're doing that
no, but if you have a request ID req_xxx I'll look for you. But if you pass Stripe-Account correctly, then the request appears on the dashboard of the connected account, and not yours.
let's take a step back. What's your actual question or what are you stuck with right now?
Alright,
so with some accounts, our payments are getting passed, but for some accounts we are getting this Must authenticate as a connected account to be able to use customer parameter error.
yep, because you're not passing Stripe-Account in your code when making that API call.
do you have a request ID req_xxx for an error?
req_zCmREnl6lgwJxs is a failing request.
but I just checked in sentry logs and we are sending the stripe account to stripe SDK.
yep, you are
but it does nothing, since the secret key you pass is the secret key of that same account
the way it should work is
- you use the secret key of your platform account
- you pass Stripe-Account set to the account ID of a connected account
here for some reason you use the wrong key/ID, so it looks to me like what you do is
- you use the secret key of your platform account
- you pass Stripe-Account set to the account ID of your own platform account
which is just the same as not passing Stripe-Account , and just runs the request on your own account.
ah i see
acct_1C3szRCPJwTYUbmR is the ID of your platform account, not one of your connected accounts.
so I should basically have one more connected account created and use that instead of the main platform account
I mean yes, the API request you're trying to make is specifically to copy a payment detail from your platform account to a connected account, so you do need a connected account in mind as the target. https://stripe.com/docs/connect/cloning-customers-across-accounts#creating-tokens
Got it. so either:
- I can't use this same flow (clone users) if I use the platform account
- or I create a new connected account
right?
right. I'm not sure what your overall goal is so it depends
if you're just trying to have your platform charge the customer's saved details that exist in your platform you don't need to do any cloning or enter the part of your code that does that and tries to make that API call
so our platform has multiple tenants where each tenant can charge the customers. Payments go directly to the connected accounts'.