#Code-Mario
1 messages · Page 1 of 1 (latest)
I think so. I set up the StripeFetch as below.
export const stripeApi = new Stripe(STRIPE_API_KEY, { httpClient: createHttpClient(), apiVersion: '2020-08-27', });
Then I do:
await stripeApi.accounts.retrieve()
Hmm what version of our Node SDK are you using?
9.8.0
acct_1FqpMqAg7It2SgG9
Invariant Violation: stripeApiFetch does not support /v1/accounts/ at invariant
Are you trying to do this via Stripe Apps?
Yea
Thanks
Wait that is the platform account that you are trying to retrieve though, right?
As opposed to one of its Connected Accounts
The idea is to get the account of the current account using the app. So I am guessing that's the connected account?
And you have connected_account_read permission enabled?
Yea
Yeah overall not sure this is possible. Let me check with a colleague
Is there a way to get the default currency of a stripe account?
And more importantly, is the extensionContext for the connected accounts or the platform account?
Hi there 👋 taking over, as my colleague needs to step away
Just to confirm my understanding, you want to know if you can retrieve the account that the Stripe App is actually installed on?
Hello,
Yea, connected account
But can you just confirm if the extensionContext is different for each connected account or is it that of the platform account?
When a Stripe App UI loads, one of the injected variables is the userContext which we call out here (https://stripe.com/docs/stripe-apps/build-ui#access-stripe-objects). This is an object defined as:
(parameter) userContext: { id: string; name?: string | undefined; account: { country: string; id: string; name?: string | undefined; }; locale: string; }
It gives the Stripe App access to the account ID, country, and name associated with the Account.
If you want to get access to the full Account object, that is only accessible from server-side code. You would need to make a signed request (https://stripe.com/docs/stripe-apps/build-backend#send-a-signed-request) to your back-end, validate it, and access the Stripe Account there.