Pagination, Sorting & Filtering
list type API methods support a few functions to help prepare or navigate the list. These functions are:
To do pagination, you will need to set these variables.
|Page size||Page number|
|Number of objects to be returned in a page. Default page size is 10 and max page size is 1000.||The page number you want returned.|
When you make the API call, include
page[number]= to set the variables above.
Sorting allows you to sort lists according to one or more criteria fields, for example, you might want to sort based on the
createdAt date time. To sort, pass in a
?sort= as part of the call.
The sort order for each sort field is ascending by default. If you need to sort by descending, prefix the sort field parameter with a minus.
See the example below, where we want to list
disbursements with the latest disbursements shown first.
Each list type API method will have its own specific filtering methods. Please find their filtering methods in the specific API sections. Here is an example of how to filter a list response:
For timestamps, please note that when you send the request, the timestamp should be url-encoded like this:
For listing of
disbursements, these are the filters you can use:
|createdAfter||timestamp||State the time in Time.iso8601|
|createdBefore||timestamp||State the time in Time.iso8601|
|status||string||Disbursement Statuses: 'processing', 'completed', or 'failed'|
Payment Statuses: "paid", "completed"
|referenceId||string||State the specific referenceId if any.|
Updated 9 months ago