#KarlS - ChargeService
1 messages · Page 1 of 1 (latest)
Hello! It's only valid in the context of paging through list results.
Can you tell me more about what you're trying to do?
Yes. I keep track of Charge, Payment,s and Balances in a local DB.
I sync the records from these 3 sources and trying to determine best way to get latest records (beyond records I have)
Now trying to figure out the AnyOf object type for created.
Ah, yeah, you can use starting_after for this. Here it is on the Balance Transactions list endpoint, for example: https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-starting_after
You need to do it in reverse, though... objects in our list APIs are in newest-first order, so you need to start listing and page through/process the results until you hit the most recent one you already have, then stop.
Does that make sense?
ok, I have the Created date stored in DB. Can't I get MAX(Created) from DB and use that in my query?
And yes, I do see in my DB that my Primary ID field is in reverse of the Created Date.
No, because starting_after means "get results starting after this one" and because the results are in reverse chronological order that means the stuff you get after the object you specify will be older than that object, not newer.
oh wait. I'm here: https://stripe.com/docs/api/charges/list#list_charges-created
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yep, this information applies to that as well. All of our list endpoints work the same way.
See at the top of that section where it says:
Returns a list of charges you’ve previously created. The charges are returned in sorted order, with the most recent charges appearing first.
OK. So if I used created.gt property I should get everything "newer" than the date I pass.
Yep.
ok! now how do I create an AnyOf object in C#? Lol, this is a tricky one.
Sorry, I don't know what that means, I'm not very familiar with C#. That's not a Stripe-specific thing, right? It's a question about C# itself?
it is... I think I got it!