#Dev-Ahmed-Hasnain-pagination
1 messages · Page 1 of 1 (latest)
Hey, I guess you'd persist the next_page value of the previous request somewhere in your application state and that can act as a 'back'
i did that, in the 1st call i am not sending any next page parameter as mentioned by stripe, in the next call if there is a next page if will sent the id in the response, i save that id in the nextPage variable, and send this in the next request which gives another nextPage if there is one, so i save the nextPage id in previousPage and the new id as the nextPage id, but when pagination ends it will return null as next_page then problem starts, now when is send previousPage id as a parameter in the call it will return me the next id which is null.
Hi! I'm taking over this thread.
ok thanks
but when pagination ends it will return null as next_page then problem starts
If there is no next page, then it's expected that thenext_pageisnull.
If you want to be able to go back in the pagination, you have two main options: store next_page value of the previous request as ynnoj mentioned. Or use the ending_before parameter https://stripe.com/docs/api/pagination#pagination-ending_before
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
i have used that too and it is working fine thank you, but i am now working on search api. please guide me about this.
backword pagination in search api.