Paging, sorting and filtering

Every list is paged, also short ones:

{
  "data": [ { "id": 1 }, { "id": 2 } ],
  "pagination": { "totalItems": 30, "totalPages": 3, "page": 1, "pageSize": 10 }
}
  • page starts at 1. pageSize defaults to 50, at most 1000. Values out of range return 422, never a silently smaller page.
  • A page past the end returns 200 with an empty data.
  • When totalPages > 1 you don't have everything yet: request the next page.

Sorting (where a list supports it): sortBy=createdAtUtc ascending, sortBy=-createdAtUtc descending, several fields comma-separated. Field names are the response's. Each list documents its sortable fields and its default. An unknown field returns 422. id is always the last sort key, so the order is stable. If orders are created or changed while you page through a list, an item can still move to another page: for a complete sync, filter with updatedSince and read again from the last updatedAtUtc you saw.

Filters are one query parameter per field, named after the response field:

  • Several values for one parameter are comma-separated and mean OR: status=sent,canceled.
  • Different parameters mean AND.
  • Ranges use …From (inclusive) and …To (exclusive): all of November is deliveryFrom=2026-11-01&deliveryTo=2026-12-01.
  • Dates are yyyy-MM-dd. Instants are ISO 8601 with Z or an offset (2026-11-09T12:00:00Z); without one they return 422.
  • search is a case-insensitive "contains" over the fields the list documents.
  • An invalid value returns 422 on its field; all invalid parameters come back together.