Pagination
In this guide, we will look at how to work with paginated responses when querying the Aella for Merchants API. By default, most list endpoints return results with pagination support. You can control the number of results per page and navigate through pages using query parameters.
When an API response returns a list of objects, pagination is typically supported. In paginated responses, objects are usually nested in a data attribute along with pagination metadata that indicates whether there are more results available. You can use the page and limit query parameters to navigate through pages.
Example using page-based pagination
In this example, we request page 2 of sub-accounts with a limit of 10 items per page. The response includes pagination metadata indicating the current page, total pages, and whether there are more results available.
- Name
page- Type
- integer
- Description
The page number to retrieve (starts from 1). Default is 1.
- Name
limit- Type
- integer
- Description
The number of items to return per page. Default is 10, maximum is 100.
Pagination using cURL
curl -G "https://api.aellaapp.com/wallets/sub-accounts?page=2&limit=10" \
-H "Authorization: Bearer {your_secret_key}"
Paginated response
{
"status": true,
"message": "Sub-accounts retrieved successfully",
"data": [
{
"id": "b1613516-e974-40dc-b266-173ee1b711b7",
"accountName": "Customer Wallet",
"accountNumber": "0480819436",
"bankName": "Guaranty Trust Bank",
"balance": 50000.00,
"createdAt": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"currentPage": 2,
"totalPages": 5,
"totalItems": 47,
"itemsPerPage": 10,
"hasNextPage": true,
"hasPreviousPage": true
}
}