#jonthings

1 messages ยท Page 1 of 1 (latest)

outer kernelBOT
stuck knot
#

Hi there!

#

What is your question?

azure phoenix
#

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

stuck knot
azure phoenix
#

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

stuck knot
#

So what exactly is the issue? Do you get an error message?

azure phoenix
#

when i pass on the header the stripe account,
and on the query the customer id and i get no results

stuck knot
azure phoenix
#

req_JY0SrGoiE2acks

stuck knot
#

Thanks! Give me a few minutes to look into this.

hazy umbra
#

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?

azure phoenix
#

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

hazy umbra
#

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.

azure phoenix
#

So what other way i have to search on the connected account?

hazy umbra
#

What is your goal?

azure phoenix
#

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

hazy umbra
#

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.

azure phoenix
#

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?

hazy umbra
#

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.

azure phoenix
#

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?

hazy umbra
#

Correct, that is not a field that is available to be used with our Search API for Charges.

azure phoenix
#

so what are the available fields?
cuz customer and the other fields listed on docs don't work with the connected acc, right?

hazy umbra
#

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.

azure phoenix
#

yes i use destination charges, but i will lose the pagination doing that way :/
but it seems the only approach here

hazy umbra
#

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.

azure phoenix
#

any ideas to update this endpoint in near future to be able to search in connected accounts?

hazy umbra
#

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.

azure phoenix
#

i understand i just wanted to provide the payments for clients without changing the flow ๐Ÿ˜…

kindred turtle
#

Hi taking over for toby here as they have to step out

#

Can you summarize what you are blocked on at the moment?

azure phoenix
#

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

kindred turtle
#

Oh and these charges are on your platform?

azure phoenix
#

yes

kindred turtle
#

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

azure phoenix
#

i guess i will have to do a trade off and lose the pagination :/

kindred turtle
#

Yeah unfortunately that's the only option currently