#jonthings
1 messages ยท Page 1 of 1 (latest)
So im trying to search payments in connected account.
Im using the search charges, on header passing the stripe account id,
then idk what to pass on the query to search on the connected acc
You can list all PaymentIntent with this: https://stripe.com/docs/api/payment_intents/list
Or search PaymentIntent with this: https://stripe.com/docs/api/payment_intents/search
And if it's on a Connected account, you need to pass the Stripe-Account header as mentioned here: https://stripe.com/docs/connect/authentication#stripe-account-header
i currently dont have payment intents since we can't update our sdk for the time being
currently im listing all charges and passing on the header the stripe account.
with that i get all the charges from the connected account.
but then im trying to the same for search
Yes you can also list/search the Charges objects of a Connected account:
https://stripe.com/docs/api/charges/list
https://stripe.com/docs/api/charges/search
So what exactly is the issue? Do you get an error message?
when i pass on the header the stripe account,
and on the query the customer id and i get no results
Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_JY0SrGoiE2acks
Thanks! Give me a few minutes to look into this.
Hi ๐ I'm jumping in as my teammate needed to step away. I'm pulling up that request, and noticed that, at least on my end, it doesn't look like it is a Connect request (I'm not seeing the Stripe-Account header present).
The request that you shared, is that the one that returned no results?
im sending the header tho, im unable to see it on my end as well on stripe logs...
"Stripe-Version: 2022-08-01", 'Authorization: Bearer '.$strPrivate, 'Stripe-Account: '. $my["str_acc"]
when i do the call without the header i get results, but when i add the Stripe-Account header, i get zero results
I think that's because the Customer that you're referencing only exists on one Stripe account. So the query will only be able to find data related to that Customer ID on the account where that Customer object exists.
So what other way i have to search on the connected account?
What is your goal?
so i want to search charges by customer, email, etc
i was able to do that for the platform, cuz i would search first on my db for that info and then would return the customerids and look on stripe search charges.
the problem is that it doesnt filter by connected account, and when i try to add the header stripe account, just returns zero results
That is expected, when you provide the Stripe-Account header, you're telling the API to execute the request as your Connected Account rather than as your Platform account. The query then returns no results because there are no objects matching the criteria in the account where the query is told to look.
If you want to search the Charges that you're creating, then you'll need to do so on the account where those objects exist which sounds like it is your Platform account.
If you need to be able to search for these Charges by destination account, then you will need to add tracking values for that and reference those. You can use the metadata parameter on the charges to store additional information, this is where I would suggest including a way to filter these Charges by including an ID like the destination account's ID.
so since im able to pass the stripe account on header to make requests as connected account, what query i can make that matches objects from the connected acc?
I would suggest you start by listing the Charges for the Connected Account, and then look at the objects that exist to see if there is any identifying information on those objects that you can use to build a search.
yes that what i did, because i needed the list before i started making the search.
and i have the data.source_transfer.source_transaction but i believe i cant access that with query search?
Correct, that is not a field that is available to be used with our Search API for Charges.
so what are the available fields?
cuz customer and the other fields listed on docs don't work with the connected acc, right?
The documentation lists the available fields, and you're right, most of those fields won't have the information that you're trying to use to query because that is on the Charges on your Platform account.
I honestly think searching for the charges on your Platform, then adding a little code to add filtering based on transfer_data.destination (this will be the ID of the Connected Account that you provided when creating the Charge), would be the easiest approach. But please let me know if you're not using Destination Charges (the one Charge I looked at seemed to use this approach) because this won't work if you're using Separate Charges and Transfers.
yes i use destination charges, but i will lose the pagination doing that way :/
but it seems the only approach here
That or adding your own field to metadata so you can include custom data to use for querying are the two approaches that are readily coming to mind.
any ideas to update this endpoint in near future to be able to search in connected accounts?
You can search in Connected Accounts, the problem you're facing is that your flow is creating all the objects with the details that you want to query in your Platform Account.
The query you wrote was running successfully, but found no Charges in the Connected Account associated with the Customer ID that you provided, because that Customer does not exist in the Connected Account.
i understand i just wanted to provide the payments for clients without changing the flow ๐
Hi taking over for toby here as they have to step out
Can you summarize what you are blocked on at the moment?
trying to find a solution for searching charges on connected accounts (When passing Stripe Header account)
since no query parameters provided in the docs work with stripe connected
Oh and these charges are on your platform?
yes
Oh just now had a chance to re-read the thread. Looks like my colleague gave you solutions for this. There's not a built in filter for this unfortunately
i guess i will have to do a trade off and lose the pagination :/
Yeah unfortunately that's the only option currently