#TheUchi007 - invalid request
1 messages · Page 1 of 1 (latest)
You mean the btok token?
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Give me a second
req_6y061tQihtjvRE
Just for reference, I am creating the token by using stripe.createToken
Hm I can't find that request id in our system. Where did you grab it from?
Ah there we go. Originally you sent it with a zero instead of an "o"
One moment
btok_1LPWtGCwBIolfz2F1SuxPd6w exists on a different account
You created it on acct_1KO5YHCwBIolfz2F but the request above was made on acct_1LNMIfQ1COGLGhJT
Ah ok. So, if a bank account exists already on another account, it will give me the token error?
Yeah exactly. Because that API request is looking for the bank token on the account that the request is made on
And it doesn't find it so you get the above error
Hmmm
Is there a way for me to determine that? Or is the invalid token something I will always get?
Or rather, will using Financial Connection Session help with adding a bank account?
It's the way you're creating the token. You are either using a different api key or passing a connect account header
Can you share the request id for where you created the token?
to create the token I used stripe.createToken
Then I passed it to my BE, where I used:
const account = await stripe.accounts.createExternalAccount(stripeAcc, { external_account: token, }); return account;
Where stripeAcc is the ID of the user that I am adding the bank account to
Can you share the request id for where you created the token?
Hmm I am not sure where to get that. Would it be on the logs too?
Try these ones:
req_xImEgGkoLf7GzB
req_YqfKq18GwlJzSi
Those are the only 2 ones I see right before the one with the error
Yeah you get it from the request logs. Those are just get requests to retrieve an account
Can you share the code snippet for creating the token?
Want to see how you form the request
Sure thing
So, the method I using is this:
stripe.createToken("bank_account", bankData)
The data object looks like this:
const bankData = { country: "US", currency: "usd", routing_number: values.routing_number, account_number: values.account_number, account_holder_name: values.account_holder_name, account_holder_type: values.account_holder_type, };
Then, once I get a response, I either pass the token to the BE that uses:
stripe.accounts.createExternalAccount(stripeAcc, { external_account: token, });
And after that, I just get a response back to the frontend. This setup works well on local build, but on deployed build, I get the error I mentioned earlier
the bank data I am getting it from a form I created
You're using the wrong public key it looks like. You're using the public key for acct_1KO5YHCwBIolfz2F but then you try to add the external account to acct_1LNMIfQ1COGLGhJT
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
The request id wasn't showing in your request logs because it was made on a different account
Oooh
Ok, that would make sense then why it is not showing up on logs
So the API key might be the problem, you reckon?
Hello! Taking over and catching up...
Yep, the API keys you're using appear to be mismatched. Sorting that out should resolve the issue.
Let me know if you need any help with it!
Will do. For now, I will handle it later today. I really do appreciate helping me out with this!