Pagination

Pagination for First-Level Entities API

Introduction

Pagination is essential for managing large datasets when retrieving information from an API. It allows clients to retrieve a specific page of data with a defined number of entities per page. Our API uses a pagination strategy for first-level entities in the API, using the page and limit parameters.

Request Pagination Parameters

page Parameter

The page parameter defines the page number of the entities to retrieve. a page calculated by the limit parameter.

  • Type: Integer
  • Default: 1

limit Parameter

The limit parameter defines the maximum number of entities to include on each page.

  • Type: Integer
  • Default: 10
  • Maximum: 100

Response Pagination Parameters

hasMore Parameter

The haseMore A boolean flag indicating whether there are more chargebacks available for retrieval.

  • Type: boolean

Example

Endpoint Description

Retrieve a paginated list of chargebacks.

  • Endpoint: GET /chargebacks

Request Parameters

  • page (optional): The page number of chargebacks to retrieve.
  • limit (optional): The maximum number of chargebacks to retrieve per page.

Example Request

GET /chargebacks?page=3&limit=20

Example Response

{
  "data": [
    {
      "id": "cb041",
      "amount": 150.99,
      "status": "disputed"
    },
    // ... (19 more chargebacks)
  ],
  "hasMore": true
}

Response Explanation

  • data: An array containing chargeback entities for the specified page.
  • hasMore: A boolean flag indicating whether there are more chargebacks available for retrieval.

Best Practices

  • Use the page parameter to navigate through the dataset and retrieve specific pages.
  • Set a reasonable limit based on the number of entities desired per page.
  • Handle pagination systematically, considering potential rate limits and performance implications.