Pagination
Learn how to page through a PSU's list of transactions from Yapily's API.
Transaction Limit
By default, Yapily limits the maximum amount of transactions returned in one request to GET Account Transactions to 1000. If you request contains more than this limit, the sections below detail how to know when there are more results and how to access them.
Using Pagination
In cases where the request for transactions exceeds 1000 transactions or when you wish to display a paginated set of results when using the limit parameter, be sure to follow these steps:
- Step 1: Send the initial request. The pagination.totalCount property in the response will tell you how many transactions
you query would return without
pagination.self.limit
. Ifpagination.totalCount
is more than thepagination.self.limit
, proceed unto Step 2. Otherwise, you have received the full amount of transactions for your request - Step 2: Execute the request again and specify the offset property and increment it by the number by X to get the next X
transactions (where X is the value of
pagination.self.limit
). - Step 3: If the count is equal to the
pagination.self.limit
(which is the value of limit if specified in the request or 1000 if not specified) repeat this step as there are more transactions. Otherwise, if the count is less thanpagination.self.limit
, you have reached the end of the paginated results.
Examples
No Limit specified
With a call to GET Account Transactions that had 6500 without any limit, calling:
GET /accounts/{accountId}/transactions
returns transactions 1-1000GET /accounts/{accountId}/transactions?offset=1000
returns transactions 1001-2000GET /accounts/{accountId}/transactions?offset=6000
returns transactions 6001-6500
Specifying a limit
With a call to GET Account Transactions that had 467 transactions with a limit=50, calling:
GET /accounts/{accountId}/transactions?limit=50
returns transactions 1-50GET /accounts/{accountId}/transactions?limit=50&offset=50
returns transactions 51-100GET /accounts/{accountId}/transactions?limit=50&offset=450
returns transactions 451-467