Pagination & Filtering

List procedures across the Inklura API do not share a single pagination contract. Each router defines its own inputs and response shape, so always check the procedure you are calling.

Common patterns

The inputs you will meet most often:

Pattern Inputs Seen in
Page and limit page, limit products.list
Page and page size page, per_page (or pageSize elsewhere) orders.getOrders
Offset and limit offset, limit invoices.getInvoices
Cursor cursor, limit reviews.listPendingReviews

Page numbering differs too: products.list and orders.getOrders count pages from 0.

Example: products.list

products.list takes a zero-based page (default 0) and a limit (default 10), plus optional filters and sorting:

curl -G "https://manage.inklura.fr/api/trpc/products.list" \
  -H "Authorization: Bearer $INKLURA_TOKEN" \
  --data-urlencode 'input={"json":{"page":1,"limit":50,"search":"miel","sortBy":"name","sortOrder":"asc"}}'

It returns the page of items with paging metadata, under result.data.json as always:

{
  "result": {
    "data": {
      "json": {
        "items": [ { "id": "…" } ],
        "total": 137,
        "page": 1,
        "limit": 50,
        "pages": 3
      }
    }
  }
}
  • items: the page of results.
  • total: the total number of matching items.
  • page / limit: the values applied.
  • pages: the number of pages.

sortBy accepts name, price, salePrice, stock, reference, active, menuOrder and updatedAt, in the direction given by sortOrder (asc or desc, default desc). Any other value, including the default createdAt, sorts by creation date, newest first.

Example: orders.getOrders

orders.getOrders takes a zero-based page (default 0) and a per_page (default 10, at most 10000), with optional search and sort inputs:

curl -G "https://manage.inklura.fr/api/trpc/orders.getOrders" \
  -H "Authorization: Bearer $INKLURA_TOKEN" \
  --data-urlencode 'input={"json":{"page":0,"per_page":25}}'

The response, under result.data.json, is not shaped like the products.list one:

{
  "data": [ { "id": "…" } ],
  "total": 412,
  "page": 0,
  "pageSize": 25,
  "pageCount": 17,
  "hasNextPage": true,
  "hasPrevPage": false
}

Here the items are in data, and hasNextPage tells you whether to ask for the next page.

Example: invoices.getInvoices

invoices.getInvoices paginates by offset: limit (1 to 100, default 50) and offset (default 0). By default it returns a plain array of documents. Pass includeTotal: true to get { "items": […], "total": … } and learn the total number of matching documents:

curl -G "https://manage.inklura.fr/api/trpc/invoices.getInvoices" \
  -H "Authorization: Bearer $INKLURA_TOKEN" \
  --data-urlencode 'input={"json":{"limit":50,"offset":100,"type":"INVOICE","includeTotal":true,"sort":"invoiceDate:desc"}}'

sort is written field:asc or field:desc, with invoiceNumber, invoiceDate, createdAt, dueDate, subTotal, totalAmount, invoiceStatus or client. An unknown field keeps the default order (newest first).

Cursor pagination

reviews.listPendingReviews returns at most limit items (1 to 200, default 50) as a plain array, newest first. For the next page, pass the id of the last item you received as cursor. A page shorter than limit means you reached the end.

Warning

Not every list procedure paginates, and those that do name and shape their inputs and response differently. Check each procedure's contract rather than assuming any of the shapes above. An out-of-range value (for example a limit of 500 on invoices.getInvoices) fails the call with BAD_REQUEST (see Errors & Rate Limits).

Filtering & search

Filtering and search inputs also vary per router. Many list procedures accept a search string and status filters (products.list accepts search, active, isBuyable, categoryId, vendorId and packagingTypeId; invoices.getInvoices accepts search, status and type), but the available filters and their names depend on the domain. Look up the procedure in the router catalog.