Pagination

Commerce exposes paginated list endpoints for every high-volume resource (orders, balance transactions, payouts, and more). Each resource ships a /page endpoint that accepts a page_number and page_size, then returns a page object containing the records for that slice and metadata you can use to request additional pages.

Pagination is 1-based—requesting page_number: 1 gives you the newest data, and subsequent page numbers step backwards in time. You can request up to 256 items per page, though smaller window sizes (25–100) often make it easier to re-request failed pages and keep dashboards responsive. Every response echoes the parameters you sent so you always know which window you are looking at.

Request parameters

  • Name
    page_number
    Type
    integer
    Description

    1-based index for the page you want. Always start with 1 and increment until the response contains fewer records than page_size, which indicates you've reached the end.

  • Name
    page_size
    Type
    integer
    Description

    Number of objects to include per page (1–256). The default is 25. Choose a value that balances payload size with the number of requests your integration can comfortably make.

Example request

In this example we request the first page of recent orders. The response returns two orders along with page_number and page_size so we can continue paging through historic activity. Subsequent requests should increment page_number by one until the response includes fewer objects than requested.

Fetch orders page

curl https://api.zebo.dev/orders/page \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "page_number": 1,
    "page_size": 2
  }'

Response

{
  "page": {
    "page_number": 1,
    "page_size": 2,
    "orders": [
      {
        "id": "kAVwBsk6EhQVv2YBUhYAqMf0lktEoQ0S7ZR8y2xi",
        "status": "requires_payment",
        "initiated_at": "2025-04-09T00:11:47.74569+01:00",
        "line_item_group": {
          "products_count": 2,
          "total": { "currency": "ghs", "value": 220 }
        },
        "customer": {
          "id": "N4IX542ZKixJJhIbc4bQBntdPrRb0DQ7KqEYSyqc",
          "name": "Gloria Kesewaa",
          "phone_number": "+233544998605"
        }
      },
      {
        "id": "48ZW7BGvYUBWc1i6WBkL2jr0iPQP5jUy76mmmHpt",
        "status": "completed",
        "initiated_at": "2025-09-14T16:24:41.137708909Z",
        "completed_at": "2025-09-14T16:29:45Z",
        "line_item_group": {
          "products_count": 1,
          "total": { "currency": "ghs", "value": 200 }
        }
      }
    ]
  }
}

Was this page helpful?