#olezz

1 messages · Page 1 of 1 (latest)

vernal yokeBOT
daring mulch
dry prairie
#

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?

daring mulch
#

have you gone through that link i shared?

dry prairie
#

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.

daring mulch
#

based off what i'm reading from that page, pagination is reverse chronological

dry prairie
#

so just to confirm, coz this is a little confusing for me haha
to get the transactions associated with a payout:

  1. 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
  2. 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?

daring mulch
#

not really. If you use the auto-pagination which comes with our SDKs, you don't need to call the list balance transaction again

dry prairie
#

wait... wouldnt i still need to call list balance transaction again? (but this time without the ending before param since its auto paginated

daring mulch
#

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

dry prairie
#

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?

daring mulch
#

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

dry prairie
#

ah ok, thank you! is there anywhere that i can run this? since my actual balance transactions is still < 100 objects for now

daring mulch
#

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