Collections & Pagination
Some endpoints within the Send Payments API return collections which may contain large numbers of objects.
We provide the following optional query parameters to allow you to limit the number of objects returned per request to a size that is manageable for you.
page
limit
sortBy
sortOrder
In the Send Payments Ecosystem all JSON objects that can be part of a collection have the following key value pairs:
createdAt
(YYYY-MM-DDThh:mm:ss.sssZ) The UTC date time that the object was created.updatedAt
(YYYY-MM-DDThh:mm:ss.sssZ) - The UTC date time that the object was last updated.
The default order for all collections is first by createdAt
ascending then by updatedAt
ascending.
The maximum number of objects returned per GET response is currently limited to 1000
regardless of whether pagination parameters have been provided in the URL.
When interacting with the Send Payments API do not assume this value will be the same between requests as we may
change default value at our discretion without notice and without changing the version of the API.
If you require access to more objects than is allowed by the default then use the pagination parameters.
All Endpoints that apoint to a collection return a response that contains the following:
- An array containing zero or more objects from the collection up to the maximum - this is the requested data from the collection.
- An object representing metadata about the response including pagination details.
Body parameter key (JSON) | Underlying data type | Description |
---|---|---|
items[] | Array[Object] | An array of objects from the collection |
meta | Object | Object containing metadata details such as record counts and pagination |
meta/itemCount | int64 | The amount of items on this specific page |
meta/totalItems | int64 | The total amount of items |
meta/itemsPerPage | int64 | The amount of items that were requested per page |
meta/totalPages | int64 | The total amount of pages in this paginator |
meta/currentPage | int64 | The current page this paginator "points" to |
Response example for GET/payments?limit=3&page=1
{
"data" : [
{
"objectName" : "myObjectName1",
"objectId" : "xxxx_1111111",
"createdAt" : "2023-09-01T08:00:22Z",
"updatedAt" : "2023-09-01T08:10:22Z"
},
{
"objectName" : "myObjectName2",
"objectId" : "xxxx_2222222",
"createdAt" : "2023-09-01T08:00:22Z",
"updatedAt" : "2023-09-01T08:00:22Z"
},
{
"objectName" : "myObjectName3",
"objectId" : "xxxx_3333333",
"createdAt" : "2023-09-01T08:00:19Z",
"updatedAt" : "2023-09-01T08:00:19Z"
}
],
"meta" :
{
"itemCount": 3,
"totalItems": 30,
"itemsPerPage": 3,
"totalPages": 10,
"currentPage": 1
}
}
The totalItems
key shows that there are 30 objects in the collection and the itemCount
shows that within this request there are 3 objects.
Not Seeing What You're Looking For?
We are always looking to improve our API documentation to ensure Sends systems are easy to understand and quick to build against. If you're struggling to find the answer to a question we either haven't made it easy enough to find the relevant docs or we haven't had a chance to write something up for it yet.
Either way we want to hear from you!
Head over to our Discussion Board and leave us a note. We keep a close eye on this and want to ensure we make these docs as useful as they can be so will jump on any posts quickly.
Updated 6 months ago