Skip to main content

Pagination

Debitura APIs use offset-based pagination for list endpoints. All paginated responses include metadata to help you navigate through results.

Defaults​

Default PageSize varies by endpoint:

  • Cases endpoints (Customer, Collection Partner, Referral Partner): default PageSize 10
  • Users list endpoints (Customer, Collection Partner APIs): default PageSize 50, capped at 100
  • Referral Partner Clients endpoint (GET /clients): default PageSize 50
  • Maximum PageSize: 100 (validated on the Referral Partner API /cases and /reporting/transactions endpoints, which reject out-of-range values with 400. The Referral Partner /clients endpoint silently clamps to this range instead; Customer API and Collection Partner API endpoints do not enforce a maximum, but using values above 100 is discouraged for performance and consistency)

Paginated Endpoints​

APIEndpoint
CustomerGET /cases, GET /Payments
Collection PartnerGET /cases, GET /managed-cases
Referral PartnerGET /cases, GET /clients, GET /reporting/transactions

Request Parameters​

ParameterTypeDescription
PageintegerPage number (1-indexed). Defaults to 1.
PageSizeintegerResults per page. Defaults to 10 for Cases endpoints; Users list endpoints default to 50 (capped at 100), and the Referral Partner Clients endpoint also defaults to 50. The 1–100 range is validated only on the Referral Partner API /cases and /reporting/transactions endpoints (not on /clients).
GET /cases?Page=2&PageSize=25
XApiKey: {api_key}

All APIs use PascalCase parameters consistently.

Response Metadata​

Every paginated response includes a page object:

{
"cases": [ ... ],
"page": {
"totalResults": 147,
"pageSize": 25,
"currentPage": 2,
"responseCount": 25,
"totalPages": 6
}
}
FieldDescription
totalResultsTotal items matching your query
pageSizeItems per page (as requested or default)
currentPageCurrent page number
responseCountItems returned in this response
totalPagesTotal pages available

Iterating Through Pages​

Increment Page until currentPage equals totalPages:

let page = 1;
let totalPages = 1;

do {
const response = await fetch(`/cases?Page=${page}&PageSize=100`);
const data = await response.json();

// Process data.cases

totalPages = data.page.totalPages;
page++;
} while (page <= totalPages);

Alternatively, stop when responseCount is less than pageSize.

Combining with Filters​

Pagination works with filtering and sorting. The totalResults reflects the filtered count, not the total dataset.

GET /cases?Statuses=Active&Sort=date:desc&Page=1&PageSize=50