#sergiu_api

1 messages ยท Page 1 of 1 (latest)

tranquil jungleBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1486303374956826786

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

hard scroll
#

Also the documentation is wrong for that endpoint.. The example uses x-www-form-urlencoded to filter account type but i get error asking me to use json only.
Which documentation?

Looking at the request

#

Looks like the Stripe-Context header is not actually passed in the request. Are you sure it's set? If it's nullish I believe it'll be silently dropped

sharp cairn
#

curl -G https://api.stripe.com/v2/core/accounts
-H "Authorization: Bearer sk_test_51TCf0cE4yx9BNG3lWPydPM00jVsHiE666Q3Qu2zD4abstFZyBaAuJlikAy6upM5BS9TDnXkwPhZPpwQaIEMsH4WF008I6PIuk5"
-H "Stripe-Version: 2026-02-25.preview"
-d limit=2
-d "applied_configurations[0]=customer"

#

That's what I'm not understanding... I need to fetch accounts of all the organisation, In docs it does not require stripe-context. Stripe-Context will be needed to fetch transactions for each account, if i understood corectly

hard scroll
#

Yes, because you're using a form encoded body. It needs to be JSON

That's what I'm not understanding... I need to fetch accounts of all the organisation, In docs it does not require stripe-context. Stripe-Context will be needed to fetch transactions for each account, if i understood corectly
No, they don't work like that. The Stripe-Context header is required, you can't use the org key to list all resources for all sub accounts:
You must specify the relevant account using the context and the API version in any API request using an organisation key.

Learn how to create, manage, and use API keys to authenticate requests to the Stripe API.

sharp cairn
#

Ok, so is there any way to acomplish what i need? We have existing flow for normal per account api key. Jobs are produced via cronjob with credentials passed to fetch transactions. This client have org key because he dont want to create a integration per connected merchant account (hundreds of merchants).

In order to acomplish that, we need to dynamically fetch all merchant accounts in org... So we can dynamically fetch transactions. Because the list of accounts are changing pretty often, it's a food delivery app so new restaurants means new merchant account...

#

Should this be done using the platform account id?

Organization (org_6SD3oI0eSQemPzdmaGLJ5j6)
โ”œโ”€โ”€ Platform account (acct_1R3fqDP6919yCiFv)
| โ””โ”€โ”€ Connected account (acct_1032D82eZvKYlo2C)
โ””โ”€โ”€ Standalone account (acct_1aTnTtAAB0hHJ26p)

If the merchants are all connected via a platform account, knowing the platform account ID would give me all connected merchants to the platform account?

hard scroll
#

I don't really think there's an alternative other than paging through the acct_xxx IDs you have and making a request for each, setting them in the Stripe-Context header

hard scroll
sharp cairn
#

Yes, I understand that in order to get transactions i need to pass account-id in stripe context.

What I am trying to understand if there is a way to not have a hardcoded list of accounts id, but rather have a few (platform accounts) that never changes, and to use the accounts list endpoint with the id of platform account to fetch all merchants.

I am 95% positive it's a connect setup

#

I can't say the name but its a global food delivery app

#

Ok now its a bit clearer. I want to ask you if it's enough to have Accounts read permission and to pass platform account id to Stripe-Context in order to fetch all merchants connected to that platform

#

He selected under Connect > Accounts > Read

hard scroll
#

Is this actually a Connect setup though?

#

Still not sure if it'll work though to be honest

sharp cairn
#

I asked right now if it's a connect setup or it's multiple standalone accounts under one org. Is that the correct question for them?

#

Well if it does not work would be pretty rough. Both us and them would need to mantain a list of account ids daily ๐Ÿ˜„

hard scroll
#

Well that's how it'd work in a Connect context depending on the type of payments you're processing

I'm assuming these are direct charges that you need to get from the accounts?

sharp cairn
#

Yes we automate generating chargeback reports, that pdf proof you need to submit in case of a dispute

tranquil jungleBOT
hard scroll
#

But if you're doing direct charges, why does the platform need to handle disputes? Generally they, as the MoR, would handle those directly: https://docs.stripe.com/connect/disputes#direct-charges

Overall, I think you need to get a better understanding of the setup (whether it's Connect, what type of Connect, etc) and then we can help further

But generally I don't think what you want to do is possible โ€“ you can't get all data from all sub accounts without providing the Stripe-Context header

Understand liability and dispute handling for direct charges, destination charges, and separate transfers with embedded component options for connected accounts.

sharp cairn
#

Yes I understand now. If they are ussing connect setupt, we can only store the platform account ids, then to fetch all connected accounts providing Stripe-Context header with value of the platform account on accounts list endpoint.

Then I need to make a call for each account from the result of account list and set stripe context to fetch transactions

#

This should be doable, right?

#

Is it ok to come back here once I get all the info?

wet yew
#

hey there ๐Ÿ‘‹ taking over as Ynnoj needs to step away

yes, if you're providing the Stripe-Context header with the platform account ID, then you can list all connected accounts for that platform