#olezz
1 messages · Page 1 of 1 (latest)
hello! you can paginate https://stripe.com/docs/api/pagination/auto
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Oh, using the ending_before parameter? but the response returned from the list balance transaction api will always be reverse chronological right? meaning most recent to least recent?
have you gone through that link i shared?
yup, it says Auto-paginating with ending_before will iterate in forwards chronological order, despite the fact that the order of items in a list API response is always reverse chronological.
based off what i'm reading from that page, pagination is reverse chronological
so just to confirm, coz this is a little confusing for me haha
to get the transactions associated with a payout:
- i list the balance transactions with this payout id -> stripe returns me a list of 100 transactions in reverse chronological order (meaning latest first) e.g Z,Y,X, ..., G
- i get the last transaction and its id (e.g. G) and call the list balance transaction again with ending before G and stripe will return me a list of 100 transactions that were before G in reverse chronological order as well.
so it will be listed as F,E,...,A
is this correct?
not really. If you use the auto-pagination which comes with our SDKs, you don't need to call the list balance transaction again
wait... wouldnt i still need to call list balance transaction again? (but this time without the ending before param since its auto paginated
i'm a little bit confused. Why would you need to call list balance transaction again? The auto-pagaination would automatically paginate through till there's no more results to return
but the max limit for list is 100, so if i have more than 100, don't i need to call list balance transactions again?
but the max limit for list is 100, so if i have more than 100, don't i need to call list balance transactions again?
no, you don't need to call list balance transaction again if you're using auto-pagination. I think it's easier for you to understand if you run it and see what happens for a result that you're expecting more than 100 objects
ah ok, thank you! is there anywhere that i can run this? since my actual balance transactions is still < 100 objects for now
you can test it out with any object really. For example, you can loop and create 101 customers in test mode, then paginate through them