#benji_list-pagination

1 messages ¡ Page 1 of 1 (latest)

vernal coralBOT
#

👋 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.

feral perchBOT
#

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.

spring fox
#

What API version are you using?

idle coral
#

im using python stripe==10.7.0
and the api version is set to

stripe.api_version = "2024-06-20"

spring fox
#

You'll have to filter on GET to see these types of requests

idle coral
#

req_RqG10dxhaH9obF

#

the api respose will tell me

  "has_more": true,
  "object": "list",
  "url": "/v1/checkout/sessions"

but not what page is next

spring fox
#

Why are you specifying a limit if you want all Checkout Sessions?

idle coral
#

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?

spring fox
#

If you remove limit, do you see a next_page?

idle coral
#

no

spring fox
#

What's the exact payload you're receiving? Can you copy/paste it?

idle coral
#

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)
spring fox
#

You can remove the Checkout Sessions if you want. I mostly want to see the Event object. So everything above data .

idle coral
#

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)
spring fox
#

Ah, I see what's going on. There's no next_page with the List All API. That's only for the Search API

idle coral
#

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

spring fox
#

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

idle coral
#

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

vernal coralBOT
astral bone
#

benji_list-pagination