Pagination

Many Tsara API endpoints return lists of data — such as transactions, customers, or wallets.
To make these results manageable, all list endpoints are paginated using page and limit query parameters.


🚀 Overview

Pagination helps you control how many results are returned per request and allows efficient navigation through large datasets.

Base format:

GET /resource?page=1&limit=20

⚙️ Parameters

ParameterTypeDescriptionDefault
pageIntegerThe page number to retrieve.1
limitIntegerThe number of items per page (max 100).20

💡 You can adjust limit for performance — smaller values reduce payload size, larger values reduce total requests.


🧾 Example Request

Retrieve a paginated list of transactions for a wallet:

curl -X GET "https://sandbox.tsara.ng/v1/wallets/wal_123/transactions?page=2&limit=10" \
  -H "Authorization: Bearer YOUR_SECRET_KEY"

Response

{
  "success": true,
  "data": [
    {
      "id": "txn_021",
      "type": "incoming",
      "amount": "50.00",
      "asset": "USDC",
      "status": "success",
      "created_at": "2025-10-17T11:00:00Z"
    },
    {
      "id": "txn_022",
      "type": "outgoing",
      "amount": "25.00",
      "asset": "USDC",
      "status": "pending",
      "created_at": "2025-10-17T11:10:00Z"
    }
  ],
  "pagination": {
    "page": 2,
    "limit": 10,
    "total": 35
  },
  "request_id": "req_abc789"
}

🧮 Pagination Object

FieldDescription
pageThe current page number.
limitThe number of items per page.
totalThe total number of items available for that resource.

💡 You can calculate total pages as:

total_pages = ceil(total / limit)

🔁 Recommended Practices

  1. Use pagination for all list endpoints to avoid large payloads.
  2. Cache paginated responses for high-traffic endpoints (e.g., transactions).
  3. Display page, limit, and total in admin dashboards for transparency.
  4. Combine pagination with filters (coming soon) for flexible querying.

⚡ Supported Endpoints

EndpointDescription
/walletsList all stablecoin wallets.
/wallets/{id}/transactionsList wallet transactions.
/bank-accountsList virtual bank accounts.
/customersList all customers.
/bank-transfersList transfer records.

🔗 Related Pages

  • Errors — Handle pagination and validation errors properly.
  • Wallets — Paginated wallet transactions.
  • Customers — Paginated customer lists.