#kur1nkato
1 messages · Page 1 of 1 (latest)
Adding @steady lynx for visibility, he is my colleague
Hi!
We are seeing this error, when after this api call when we get the the account id:
const response = await stripe.oauth.token({ grant_type: 'authorization_code', code: code })
After this call we try to update the account settings, with this call as well:
await stripe.accounts.update(response.stripe_user_id, { company: { name: orgDetails.name }, email: email, metadata: { orgID: orgDetails.id }, })
Can you share the request ID (req_xxx) with that error? You can find it here https://dashboard.stripe.com/test/logs
Also, that account is not showing on our connected accounts list.
The parameters you are trying to update can only be updated for custom accounts, as mentioned here https://stripe.com/docs/api/accounts/update
But the account is actually a Standard account. So it's expected to not work.
And why is the account not showing on our connected accounts list?
If the connection was successfuly done, except the part where we try to update the account details.
Did the customer disconnect it?
It was disocnnected on 2023-11-16 at 09:36:53 UTC. Not sure why for now.
Foudn the issue!
The OAuth Token was consumed twice, which disconnected this account from the platform
So there's an issue in your code. When you consume the Oauth token twice, then Stripe automatically disconnect the account
Oh ok, we think we may have figured out what happened then.
Another question, is there a way to distinguish between a custom and a standard account when connecting? Do we recieve something different?
The reason is so we do not execute code which only works for custom accounts on it.
Looks like you are using OAuth to connect to an existing account? In this case this just doesn't work with custom accounts. It's only for Standard and Express accounts.
and can express and standard accounts be distinguished when we recieve the callback?
It's actually two different flow to use Standard or Express, so you should know which is witch:
But note that we no longer recommend using OAuth, instead it's better to directly create the new accounts with this endpoint: https://stripe.com/docs/api/accounts/create
ok, so we are using the standard one, so back to our original error. What can we do about the platform controls?
we have a connect account at the moment, which we do not have platform controls for
If you want Platform Controls, then you should not use OAuth and instead use this: https://stripe.com/docs/connect/standard-accounts
However I don't think this will solve your issue, since the field you are trying to update cannot be updated for Standard accounts, as mentioned here https://stripe.com/docs/api/accounts/update