#Hamze-limit

1 messages · Page 1 of 1 (latest)

scarlet wadi
proud galleon
#

Great question! You can either write your code to leverage the has_more response parameter in conjunction with the starting_after input parameter, or the easier approach would be to leverage our auto-pagination functionality to do that for you. More information on auto-pagination can be found here:
https://stripe.com/docs/api/pagination/auto

gleaming charm
#

I need to return from the first customer to customer number 1000 how could I do it

proud galleon
#

Which of our SDKs are you using for your implementation?

gleaming charm
#

I am doing flutter with dart just consuming endpoints

#

this endpoint returns customers but returns only the first 100

proud galleon
#

Gotcha, if you're just consuming the endpoints, then you'll need to build the pagination logic into your code.

I'm not familiar with flutter/dart so I'm not sure what functionality they have to support this approach, but I'll outline what I've done before to build this logic.

If you want to retrieve 1000 customers then you'll need to make the call 10 times (assuming you're setting the limit at 100). I'd probably put this in a for loop since you know the max number of times you'll make the call. After each call you'll need to check the has_more parameter of the response to ensure there are more records to retrieve. You'll then need to find the ID of the last customer in the previous response list and pass that into the starting_after parameter of the next call.

I'd suggest taking a look at the customers parameters found here:
https://stripe.com/docs/api/customers/list?lang=curl#list_customers

And our pagination guide found here:
https://stripe.com/docs/api/pagination