Offset pagination
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, you can use pagination access all transactions. The following fields are used for pagination:pagination.totalCount- the total number of transactions your query would returnpagination.self.limit- the value of limit if specified in the request or 1000 if not specifiedoffset- the number of transaction records to be skipped
How it works
-
Send a request to GET Account Transactions. If
pagination.totalCountis greater thanpagination.self.limitthen you haven’t received the full number of transactions for your request. -
Execute the request again and specify the
offsetproperty to increment the number by X (where X is the value ofpagination.self.limit). This will return the next X transactions. -
Repeat step 2 until
pagination.totalCountis the same as or less thanpagination.self.limit.
Examples
No limit specified
For a call to Get Account Transactions that had 6500 transactions without any limit, calling:GET /accounts/{accountId}/transactionsreturns transactions 1-1000GET /accounts/{accountId}/transactions?offset=1000returns transactions 1001-2000GET /accounts/{accountId}/transactions?offset=6000returns transactions 6001-6500
Specifying a limit
For a call to Get Account Transactions that had 467 transactions with a limit=50, calling:GET /accounts/{accountId}/transactions?limit=50returns transactions 1-50GET /accounts/{accountId}/transactions?limit=50&offset=50returns transactions 51-100GET /accounts/{accountId}/transactions?limit=50&offset=450returns transactions 451-467