#benji_list-pagination
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1273400109257981974
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- benji_best-practices, 15 hours ago, 5 messages
- benji_webhooks, 18 hours ago, 23 messages
What API version are you using?
im using python stripe==10.7.0
and the api version is set to
stripe.api_version = "2024-06-20"
Do you have a request ID I can look at?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
You'll have to filter on GET to see these types of requests
req_RqG10dxhaH9obF
the api respose will tell me
"has_more": true,
"object": "list",
"url": "/v1/checkout/sessions"
but not what page is next
Why are you specifying a limit if you want all Checkout Sessions?
to test the pagination, works for example for invoices too.
but there we have an next_page argument
we will likely limit it to 100, but then still its not possible to get all the data
does .list() send an ulimited amount of sessions?
If you remove limit, do you see a next_page?
no
What's the exact payload you're receiving? Can you copy/paste it?
its a bit long because we have a lot of sessions, i can only send it as .txt file
results = stripe.checkout.Session.list()
print(results)
You can remove the Checkout Sessions if you want. I mostly want to see the Event object. So everything above data .
ok sec
thats all, that remains if i remove data : {}
{
"has_more": true,
"object": "list",
"url": "/v1/checkout/sessions"
}
results = stripe.checkout.Session.list()
del results["data"]
print(results)
Ah, I see what's going on. There's no next_page with the List All API. That's only for the Search API
but there is also no search api for stripe.checkout.Session.search (not implemented)
at least in the python package
or does it have a different name?
i used .search for stripe.Customer before
but for stripe.checkout.Session seems to be missing
You can't use Search API for Checkout Sessions. You use the LIst All API then using starting_after, you want to specify the last object ID in list for the previous request to make a subsequent List All API request. We explain that here: https://docs.stripe.com/api/pagination
There's also auto-pagination, which sounds like it might be what you're actually after here: https://docs.stripe.com/api/pagination/auto?lang=python
okay i see. this works too then, bit confusing. did not expect that this would differ from .search this much.
i will change my implementations and use starting_after arguments when we access a list endpoint
thank you
benji_list-pagination