Pagination

The Commerce API support pagination for all of its bulk GET fetches. The page and pageSize query parameters can be used to limit the response payload by only returning a subset of the requested resources.

All GET endpoints which return a list of items have the following query parameters:

Query Parameter Description
page The page number.
pageSize The number of items on each page.

Paged Response

A paginated endpoint returns a paged response with the following elements:

Element Description
values A list of the requested resources.
metadata Metadata with information about the pagination state.
links Navigation links.

Metadata

The metadata element contains information about the pagination state.

Element Description
total The total number of values available.
size The size of each page.
currentPage The current page of the returned items.
Note:

For some endpoints, the metadata element may also be extended with additional properties, such as totalSum which is the summation of the amount of all requested items. (Including elements not returned in the page.)

Navigation Links

The links object contains a number of navigation links which can be used to traverse the pages.

Element Description
next Uri for retrieving the next page.
prev Uri for retrieving the previous page.
last Uri for retrieving the last page.
first Uri for retrieving the first page.

Example

Request

Copy
Copied
https://settlement-api.zdata.io/api/v1/resource?page=2&pageSize=100

Response

Copy
Copied
{
  "values": [
   ...
  ],
  "metadata": {
    "total": 400,
    "size": 100,
    "currentPage": 2
  },
  "links": {
    "next": "https://settlement-api.zdata.io/api/v1/resource?page=3&pageSize=100",
    "prev": "https://settlement-api.zdata.io/api/v1/resource?page=1&pageSize=100",
    "last": "https://settlement-api.zdata.io/api/v1/resource?page=4&pageSize=100",
    "first": "https://settlement-api.zdata.io/api/v1/resource?page=1&pageSize=100"
  }
}

Example Request (GET Transactions)

RequestResponse
Copy
Copied
https://settlement-api.zdata.io/api/v1/companies/767BDC61-919D-49A5-9E38-16DE2B519B09/transactions?page=2&pageSize=3
Copy
Copied
{
  "values": [
    {
      "id": 20065,
      "amount": 229,
      "transactionType": "Fee",
      "currency": "usd",
      "purchaseDate": "2022-09-20T07:44:54.1866038",
      "settlementDate": "2022-09-20T07:44:54.1866038",
      "externalTransactionId": "ch_3Lk18SE5i7IYJeqi1pvpKIZB",
      "description": "(created by Stripe CLI) - Id ch_3Lk18SE5i7IYJeqi1pvpKIZB",
      "batchId": "e0a6deaf-875c-4235-855d-b10be126d42b",
      "transactionsReference1": null,
      "transactionGroupId": "ad008bd8-064d-48e5-b1dc-bf966ff4ca31",
      "settlementConnectionId": 4006,
      "transactionDate": "0001-01-01T00:00:00",
      "createdDate": "2022-09-20T08:08:01.5166325",
      "transactionStatus": "New"
    },
    {
      "id": 20066,
      "amount": 100,
      "transactionType": "Payment",
      "currency": "usd",
      "purchaseDate": "2022-09-20T07:45:01.0395999",
      "settlementDate": "2022-09-20T07:45:01.0395999",
      "externalTransactionId": "ch_3Lk18aE5i7IYJeqi1KKJ7oyw",
      "description": "(created by Stripe CLI) - Id ch_3Lk18aE5i7IYJeqi1KKJ7oyw",
      "batchId": "f64b9629-4b6a-474a-aa75-158e11261cbd",
      "transactionsReference1": null,
      "transactionGroupId": "c86dbbec-546c-470e-ad9a-f3b4f814cc7d",
      "settlementConnectionId": 4006,
      "transactionDate": "0001-01-01T00:00:00",
      "createdDate": "2022-09-20T08:08:01.5166485",
      "transactionStatus": "New"
    },
    {
      "id": 20067,
      "amount": 100,
      "transactionType": "Payment",
      "currency": "usd",
      "purchaseDate": "2022-09-20T07:44:54.1866038",
      "settlementDate": "2022-09-20T07:44:54.1866038",
      "externalTransactionId": "ch_3Lk18SE5i7IYJeqi1pvpKIZB",
      "description": "(created by Stripe CLI) - Id ch_3Lk18SE5i7IYJeqi1pvpKIZB",
      "batchId": "339a7091-5eda-45c8-9a8f-51f8108295bf",
      "transactionsReference1": null,
      "transactionGroupId": "180ffac7-2aeb-47ea-a589-87770315e939",
      "settlementConnectionId": 4006,
      "transactionDate": "0001-01-01T00:00:00",
      "createdDate": "2022-09-20T08:08:01.5129432",
      "transactionStatus": "New"
    }
  ],
  "metadata": {
    "total": 1948,
    "size": 3,
    "currentPage": 2
  },
  "links": {
    "next": "https://settlement-api.zdata.io/api/v1/companies/767BDC61-919D-49A5-9E38-16DE2B519B09/transactions?page=3&pageSize=3",
    "prev": "https://settlement-api.zdata.io/api/v1/companies/767BDC61-919D-49A5-9E38-16DE2B519B09/transactions?page=1&pageSize=3",
    "last": "https://settlement-api.zdata.io/api/v1/companies/767BDC61-919D-49A5-9E38-16DE2B519B09/transactions?page=650&pageSize=3",
    "first": "https://settlement-api.zdata.io/api/v1/companies/767BDC61-919D-49A5-9E38-16DE2B519B09/transactions?page=1&pageSize=3"
  }
}