#93gaurav93
1 messages · Page 1 of 1 (latest)
hello! yep, you can do that
Which API I can use to fetch transactions and with what filter parameter?
hello! you can use https://stripe.com/docs/api/balance_transactions/list. You will need to make the request with the Stripe-Account header : https://stripe.com/docs/connect/authentication
Okay. Thanks!
Will this API give me the transactions that are there before connecting this account?
it should. you can try things out
Okay
Does Stripe connect support countries other than US and CA?
Because I am trying with Indian account and it is showing "country not supported"
I am using below oAuth flow to connect my Stripe account via "Stripe connect"
https://stripe.com/docs/connect/oauth-reference
I have account A which is the main account. There I have enabled "Stripe connect".
And have an account B which I am trying to connect to Account A via "Stripe connect"
As mentioned in the above document, I have created a authorization URL
https://connect.stripe.com/oauth/authorize?response_type=code&client_id={{CLIENT_ID}}&scope=read_write&redirect_uri=https://sub2.example.com
I replaced client id with the client id provided under Stripe connect setting of account A.
When I go through the oAuth flow and connect account B, I get redirected with code param appended to the redirected URI I have set in the settings.
I used that code in below snippet,
\Stripe\Stripe::setApiKey('sk_test_51KlYu7SFqKQWeEsW8HlLhWzE8PH0aGw5dpW4ACKqavTDUemOGT3svudXRNu24a5gZVCtPFLVqMPyZyzP3HJSJDZy00lvv4WYMD');
$response = \Stripe\OAuth::token([
'grant_type' => 'authorization_code',
'code' => 'ac_123456789',
]);
It is throwing the below error,
Stripe\Exception\OAuth\InvalidGrantException with message 'Authorization code provided does not belong to you'
I simply want to connect Account B to Account A via Stripe connect (Where Stripe connect is enabled on Account A) and fetch the historical transactions of Account B via that "connected account".
I'd not recommend use OAuth
The sk_test key above, belongs to which account in your example? It should be the platform
sk_test belongs to Account A
Also, you need to replace ac_123456789 with the actual code returned in the query parameters
I actually am replacing the code I got in the query. Just didn’t share it here.
I'd not recommend use OAuth
Which flow do you recommend?
via Account Links
But in this flow can I access historical transactions of 1 year ago of connected account?
It's a pre-existing account?
yes
What's the ac_xxx returned from the redirect?
ac_MVaYqnX7mDjpsETvGmUwRFWiM7ZVsRUH
Which acct_xxx are you attempting to connect to
Where I can find the account id of Account A (main account)?
Can I share the client id provided under Stripe connect settings?
I'm already looking at it
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
acct_1LmYE8SFpO0n8cOW
Checking on this
Ok
Can you share the client_id?
ca_MVZYQshJ8baAz1IzwqTKd4UwFG9ZQMjI
That doesn't seem to be the correct client ID for acct_1KlYu7SFqKQWeEsW (the platform)
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
When you're logged into 'account B'
I think we need to take a step back here, this is very confusing as both accounts have the same/identical merchant name
acct_1KlYu7SFqKQWeEsW is the platform, correct?
And you want to connect acct_1LmYE8SFpO0n8cOW via OAuth?
acct_1KlYu7SFqKQWeEsW is id of main account and I'm looking to connect ac_MVaYqnX7mDjpsETvGmUwRFWiM7ZVsRUH
That doesn't make any sense
Which is the platform they're connecting to?
Basically, you have a mismatch between the client ID (ca_xxx) and the API key.
You're using the API key from acct_1KlYu7SFqKQWeEsW, yet the client ID from acct_1LmYE8SFpO0n8cOW. Both values need to be from the same account.
So whichever is the platform account (i.e. the account that the other account(s) are connecting to), use the values from there
Let me stop you there
To which I call "main account"
Let's refer to the accounts using their IDs
Okay
Because your accounts have very similar names
These names?
Every reference point other than the ID is very similar (email, etc)
You can find the IDs for each here: https://dashboard.stripe.com/settings/account
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Let me know which ID is the platform and which is the connected account
Ok, then the issue is as I described here:
Basically, you have a mismatch between the client ID (ca_xxx) and the API key.
You're using the API key from acct_1KlYu7SFqKQWeEsW, yet the client ID from acct_1LmYE8SFpO0n8cOW. Both values need to be from the same account.
So you need to go into the Dashboard for acct_1KlYu7SFqKQWeEsW and get the ca_xxx client ID for that account
Update your URL param to include that new value and it should work
Yup, then it was successful: https://stripe.com/docs/connect/oauth-reference#post-token-response
Now I can use the account id acct_1EVW7aLZnPH2vt8q to fetch the historical transactions right?
Wait, that's a different ID?
Should work, then sure
Awesome. Thank you for the help! 🙂