#marc_connect-account-header
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1257365632350163087
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Hi ๐
These error messages mean that you are attempting to access a Stripe object on the wrong account
The request to /v1/refunds (https://dashboard.stripe.com/logs/req_0c391usrQtrz2X) was made on the account acct_1GmLc7J4IokeiRsT but the Payment Intent (pi_3PTWYDH8cn3oh6tC0BIUeKuD) exists on account acct_1HTTKBH8cn3oh6tC
Yes that's what I mentioned under "What have you already attempted?"
So you need to make the requet on the right account
The payment intent exists on the platform account so that's where you need to make the request
Oh, sorry I got the IDs mixed up.
This is a Standard account
You need to use the Stripe Account header on the Refund request
So the Payment Intent exists on the Connected Account (acct_1HTTKBH8cn3oh6tC) because the Checkout Session that created this request was made on the Connected Account https://dashboard.stripe.com/logs/req_6AEQkO6dSjm9cA
Ah yes sorry ... I switched my integration from Standard to Express so older connected accounts are Standard
Oh yeah, so likely you are making Destination Charges on the Express accounts and, in that case, the objects exist on the platform
Easy to mix those flows up
Yes for standard accounts, I am using direct charges
Yeah those are both the recommended flows for each account type
OK if I add the header, will it cause refunds to payments made via Express connected accounts to fail?
... i.e. do I need to detect the type of connected account and conditionally add the header?
I'm afraid so
Hehe no worries
But, on the plus side, once you get that logic in place you can switch back and forth depending on which account types suite your use case
Yeah I'm not too worried ... it's like three lines of code ๐
Nice ๐
I am using the Node.js SDK and I'm looking at the docs ... how do I set the account header?
Oh I found it I think
You should be able to set the language for the code snippets to Node
So you get something like this
const paymentIntent = await stripe.paymentIntents.create(
{
amount: 1000,
currency: 'usd',
automatic_payment_methods: {
enabled: true,
},
},
{
stripeAccount: '{{CONNECTED_ACCOUNT_ID}}',
}
);
The first object has the parameters for the API, the second contains headers
Great ๐ I'm glad we could help ๐