docs.lithic.com Open in urlscan Pro
2606:4700::6810:f276  Public Scan

Submitted URL: https://mktemail.lithic.com/MTAzLUpJVS02OTEAAAGO7UV1diuxt_fkRHVx68N-mArMo6L2_GKx5-UdyIc923fTeMCmsmWjRyY3a2Z2oSTRIUghpuE=
Effective URL: https://docs.lithic.com/changelog/october-5-2023?utm_source=email&utm_medium=email&utm_campaign=es-comprehensive-102023&...
Submission: On October 25 via api from US — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

Jump to Content

GuidesAPI ReferenceChangelog

--------------------------------------------------------------------------------

Log InDashboardGet StartedStatus
Changelog
Log InDashboardGet StartedStatus
GuidesAPI ReferenceChangelog

Ctrl+K
All
Guides
Reference
Changelog

START TYPING TO SEARCH…

Back to All


OCTOBER 5, 2023

21 days ago by Kamil Sindi

CURSOR-BASED PAGINATION FOR ALL API ENDPOINTS!

We're excited to announce an enhancement to the pagination system for all Lithic
API endpoints: Cursor-based Pagination!


WHAT'S CHANGING?

Previously, our top-level API resources like accounts, cards, and transactions
employed an offset-based pagination method. By specifying the page and page_size
parameters, you could retrieve data. A typical response would appear as:

JSON
{
  "data": [...],
  "page": 1,
  "total_entries": 100,
  "total_pages": 10
}



Acknowledging the need for a more efficient and flexible pagination system,
especially for large datasets, we introduce the Cursor-based Pagination!


INTRODUCING CURSOR-BASED PAGINATION!

Cursor-based pagination is now available for all our top-level API resources.
This new approach allows you to efficiently retrieve a list of items like
events, disputes, and settlement records in reverse chronological order.

Use parameters like page_size, starting_after, and ending_before. If neither
starting_after nor ending_before is provided, the API will return the newest
objects on the first page in chronologically descending order. Use
starting_after to fetch older items after a specific item, or ending_before to
get newer items before a certain item. Note that items within a page will always
appear in reverse chronological order, and only one of starting_after or
ending_before can be specified at a time.

The new response structure is:

JSON
{  
  "data": [...],  
  "has_more": true  
}



WHY MAKE THE SWITCH?

Cursor-based pagination offers:

 1. Speed: Lower latency, especially for large datasets.
 2. Consistency: Fetching data remains consistent even if new data is added.
 3. Flexibility: Easily traverse your dataset forwards or backwards based on
    specific items.


TRANSITIONING FROM OFFSET-BASED TO CURSOR-BASED PAGINATION:

For backwards compatibility, existing customers will have offset-based fields in
their response.

If you're using offset-based pagination and wish to migrate:

 1. Include the header X-Lithic-Pagination: cursor in your API requests. This
    will send back cursor-based fields.
 2. Contact Lithic Support if you want to set cursor-based pagination as the
    default for all your endpoints.

All Lithic client libraries will now use cursor-based pagination by default. We
advise you to update your libraries to the latest version to leverage this
enhancement.

Although offset-based pagination will still be supported for the foreseeable
future, we strongly encourage the migration to the new system for its manifold
benefits.

Thank you for being a valued part of the Lithics community. We remain committed
to enhancing our platform for your benefit. For detailed guidelines on using
cursor-based pagination, please refer to our official documentation.