Skip to main content

Welcome to our Dev Docs!

Pagination

It refers to the practice of breaking up a large set of data into smaller, manageable pieces or pages to improve the efficiency and usability of data retrieval. Pagination prevents overwhelming the merchant requesting the data and to reduce the amount of data transferred over the network.

The process of pagination is important in API design because it helps balance the trade-off between efficient data retrieval and network efficiency.

Pagination in Billwerk+ Subscription Management can be performed using take parameters. However, take pagination has some disadvantages :

  1. It is not a stable cursor: if new elements are added in the mean time, the second page will contain elements that were present on the first page before,

  2. Old entries can be missing if other entries were deleted (edited)

    1. Note

      With from, each object comes out only once and old objects are guaranteed to come out. If it is not guaranteed, it means that a new object is not going to come out in the results.

    2. If the new object comes out - it comes out at the end?

      The position of the id in the output can vary. It often appears at the beginning due to the practice of presenting the highest id (newest) first, there's no guarantee that it will always be shown.

      Warning

      It is not guaranteed because for contract/customer/component subscription etc. order commits and order creation don't necessarily happen in the same order.

      The relevant guarantee is that if an object exists during the whole period during which the pagination runs (and no filter field changes), then it comes out exactly one time.

Alternatively, some resources provide cursor-based pagination, e.g.

https://app.billwerk.com/api/v1/contracts/?from=50f6b3d7eb596a1268f5651e

These cursors are stable and much faster.