Pagination and sorting
Below are the endpoints that return a list of objects to support pagination and sorting.
Query parameters
When making a GET
request, you can specify the following parameters to move between pages and sort the results included in the response.
The below parameters are optional. If not provided, the Soldo Business API will automatically apply a default.
Parameter | Description | Default |
---|---|---|
p | The specific page to display (the counter starts from zero). | 0 |
s | The number of objects per page (The maximum is 50, but you can contact our business support team if you want to increase it). | 50 |
d | How the results are ordered (ASC , DESC ) based on the fields specified with the props parameter. | N/A |
props | The response fields on which the sorting should be applied. To apply sorting on multiple parameters, set the props parameter in the request multiple times, e.g. props=id&props=status | N/A |
Response
The response contains the following fields which can be used to determine the number of pages, their total size and the results included in them.
Field | Description |
---|---|
total | The total number of objects. |
pages | The total number of pages. |
page_size | The maximum number of objects per page. |
current_page | The current page (the counter starts from zero). |
results_size | The total number of objects included in the results array for the current page. |
results | An array containing the JSON objects of the specific page currently displayed. |
Example:
# Request to search all Wallets
curl --request GET \
--url https://api.soldo.com/business/v2/wallets?p=0&s=50&d=DESC&props=id&props=name \
--header 'accept: application/json' \
--header 'authorization: Bearer {access_token}'
# Snippet of the response containing the list of Wallets
{
"total": 168,
"pages": 4,
"page_size": 50,
"current_page": 0,
"results_size": 50,
"results": [
{
"id": "8a358051-19ba-11e7-b7cf-06f210f068eb",
"name": "AAA",
"currency_code": "GBP",
"available_amount": 1234567.89,
"blocked_amount": 0.0,
"primary_user_type": "main",
"label": "AA",
"visible": true,
"creation_time": "2021-09-22T11:22:19Z",
"last_update": "2022-11-22T20:37:47Z"
},
...
]
}
Updated 10 months ago