Is pagination supported for obtaining transactions?
Yes, 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 your query would return withoutpagination.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
Comments
0 comments
Article is closed for comments.