Skip to content
Create account or Sign in
The Stripe Docs logo
/
Ask AI
Create accountSign in
Get started
Payments
Revenue
Platforms and marketplaces
Money management
Developer resources
APIs & SDKsHelp
Overview
Versioning
Changelog
Upgrade your API version
Upgrade your SDK version
Essentials
SDKs
API
    Overview
    API v2
    Rate limits
    Authentication
    API keys
    Specify request context
    Domains and IP addresses
    Make requests
    Expand responses
    Pagination
    Search objects
    Localise content
    Testing and data
    Metadata
    Test your application
    Error handling
    Handle errors
    Error codes
Testing
Stripe CLI
Sample projects
Tools
Stripe Dashboard
Workbench
Developers Dashboard
Stripe Shell
Stripe for Visual Studio Code
Features
Workflows
Event Destinations
Stripe health alertsFile uploads
AI solutions
Agent toolkit
Model Context ProtocolBuild agentic AI SaaS Billing workflows
Security and privacy
Security
Stripebot web crawler
Privacy
Extend Stripe
Build Stripe apps
Use apps from Stripe
Partners
Partner ecosystem
Partner certification
United States
English (United Kingdom)
HomeDeveloper resourcesAPI

How pagination works

Learn how to paginate results for list and search endpoints.

Video tutorials

To learn about pagination with video tutorials, see this playlist.

The Stripe API has list and search endpoints that can return multiple objects, such as listing Customers or searching for PaymentIntents. To mitigate negative impacts to performance, these endpoints don’t return all results at once. Instead, Stripe returns one page of results per API call, with each page containing up to 10 results by default. Use the limit parameter to change the number of results per page.

For example, this is an API request to list Customers, with a limit of 3:

The response from Stripe contains one page with 3 results:

Keep in mind the following details when using these endpoints:

  • Objects are inside the data property.
  • Objects are in reverse chronological order, meaning the most recently created object is the first one.
  • The has_more property indicates if there are additional objects that weren’t returned in this request.

Instead of looping over the data array to go through objects, you should paginate results. This prevents you from missing some objects when the has_more parameter is true.

Auto-pagination

To retrieve all objects, use the auto-pagination feature. This automatically makes multiple API calls until has_more becomes false.

Note

When using auto-pagination with a list endpoint and setting ending_before, the results are in chronological order, meaning the most recently created customer is the last one.

Manual pagination

Follow these steps to manually paginate results. This process is different when calling a list endpoint or a search endpoint.

Was this page helpful?
YesNo
  • Need help? Contact Support.
  • Check out our changelog.
  • Questions? Contact Sales.
  • LLM? Read llms.txt.
  • Powered by Markdoc