#HK6

1 messages · Page 1 of 1 (latest)

sand stirrupBOT
elder relic
#

Hi there!

#

No there's no way to filter charges by creation time.

#

So I think the only option here would be to list all charges, and then paginate until you find the oldest charge.

odd sail
#

arf, might be very slow

#

ok, I'll do that and store as connecta ccount meta

#

so I do it once for good

elder relic
#

Yes it's not ideal, but you can only do it once and store the result somewhere.

odd sail
#

thanks a lot

elder relic
#

Happy to help 🙂

odd sail
#

last one

#

they are guaranteed to be returned in descending order right?

#

no need to store them, and take the min

#

I can just reach the last and store?

elder relic
#

they are guaranteed to be returned in descending order right?
Yes

#

I can just reach the last and store?
Yes it should work

sand stirrupBOT
odd sail
#

and,
charges = stripe.Charge.list( on_behalf_of=account_id, limit=100, expand=["data"], status="succeeded" )

Seems the on_behalf is ignored

#

is that supposed to work?

cerulean blade
#

no it's not

#

if you want to get the Charge objects that exist on a connected account, you'd use the Stripe-Account header

odd sail
#

mmmh don't know about this. doc

#

?

#

ah thanks

cerulean blade
#

if you want to get Charges on your platform that used the on_behalf_of param set to a certain account, there's no list API filter for that and you have to filter the results in your code

odd sail
#

ok so I will have to get the transfers then as charges are on the platform

#

works with transfers?