Pagination

How pagination works across Mesta API list endpoints.

Pagination

All list endpoints in the Mesta API support pagination. Use query parameters to control the page size and offset.

Query Parameters

ParameterTypeDefaultDescription
pageinteger0Page number (0-indexed)
pageSizeinteger10Number of records per page
sortBystringcreatedAtField to sort by (typically createdAt or updatedAt)
sortOrderstringDESCSort direction: ASC or DESC
searchstringFree-text search query (where supported)

Response Format

Paginated responses include metadata alongside the data array:

{
  "data": [
    { "id": "...", "..." : "..." },
    { "id": "...", "..." : "..." }
  ],
  "total": 47,
  "page": 0,
  "pageSize": 10
}
FieldTypeDescription
dataarrayArray of records for the current page
totalintegerTotal number of records matching the query
pageintegerCurrent page number
pageSizeintegerNumber of records per page

Example

Fetch the second page of orders, 20 per page, sorted by most recent:

GET /v1/orders?page=1&pageSize=20&sortBy=createdAt&sortOrder=DESC

Endpoints Supporting Pagination

  • GET /v1/orders
  • GET /v1/senders
  • GET /v1/beneficiaries
  • GET /v1/payment-methods
  • GET /v1/quotes
  • GET /v1/webhooks
  • GET /v1/external-events
  • GET /v1/merchant-transactions