Pagination

Learn how to page through a PSU's list of transactions from Yapily's API.


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:

How it works

  1. Send a request to GET Account Transactions. If pagination.totalCount is greater than pagination.self.limit then you haven't received the full number of transactions for your request.
  2. Execute the request again and specify the offset property to increment the number by X (where X is the value of pagination.self.limit ). This will return the next X transactions.
  3. Repeat step 2 until pagination.totalCount is the same as or less than pagination.self.limit .

Examples

No limit specified

For a call to Get Account Transactions that had 6500 transactions without any limit, calling:

  • GET /accounts/{accountId}/transactions returns transactions 1-1000
  • GET /accounts/{accountId}/transactions?offset=1000 returns transactions 1001-2000
  • GET /accounts/{accountId}/transactions?offset=6000 returns 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=50 returns transactions 1-50
  • GET /accounts/{accountId}/transactions?limit=50&offset=50 returns transactions 51-100
  • GET /accounts/{accountId}/transactions?limit=50&offset=450 returns transactions 451-467

Cursor-based pagination

Cursor-based pagination feature is currently available as a Private Beta version. Please contact your Customer Success Manager if you would like to access it.

Yapily's ‘Realtime transactions’ API endpoint is used to fetch transactions in real-time using cursor-based pagination.

It accepts from and before as optional query parameters when sending the initial request, and accepts cursor as optional query parameter in subsequent requests.

How it works

Yapily doesn't set a limit for the maximum number of transactions returned per page, but an individual Institution can set a limit.

The meta object in the response includes count that represents the number of transactions in that page, but doesn't return a field for the total number of transactions.

The data object in the response contains an array of transactions.

The links object in the response returns opaque cursor tokens that can be fed into the subsequent request:

  • first - a cursor or link to the first page
  • prev - a cursor or link to the previous page
  • self - a cursor or link to the current page
  • next - a cursor or link to the next page
  • last - a cursor or link to the last page

Examples

  • GET /accounts/{accountId}/real-time/transactions to fetch transactions in the first page. Returns self , next and last page cursors:
Copy
Copied
"links": {
    "self": "https://api.yapily.com/accounts/{accountId}/real-time/transactions?cursor=aaa",
    "next": "https://api.yapily.com/accounts/{accountId}/real-time/transactions?cursor=bbb",
    "last": "https://api.yapily.com/accounts/{accountId}/real-time/transactions?cursor=zzz"    
 }
  • GET /accounts/{accountId}/real-time/transactions?cursor=ccc to fetch transactions in a middle page. Returns first , prev , self , next and last page cursors:
Copy
Copied
"links": {
    "first": "https://api.yapily.com/accounts/{accountId}/real-time/transactions?cursor=aaa",
    "prev": "https://api.yapily.com/accounts/{accountId}/real-time/transactions?cursor=bbb",
    "self": "https://api.yapily.com/accounts/{accountId}/real-time/transactions?cursor=ccc",
    "next": "https://api.yapily.com/accounts/{accountId}/real-time/transactions?cursor=ddd",
    "last": "https://api.yapily.com/accounts/{accountId}/real-time/transactions?cursor=zzz"    
}
  • GET /accounts/{accountId}/real-time/transactions?cursor=zzz to fetch transactions in the final page. Returns first , prev and self page cursors:
Copy
Copied
"links": {
    "first": "https://api.yapily.com/accounts/{accountId}/real-time/transactions?cursor=aaa",
    "prev": "https://api.yapily.com/accounts/{accountId}/real-time/transactions?cursor=yyy",
    "self": "https://api.yapily.com/accounts/{accountId}/real-time/transactions?cursor=zzz"   
}