Pagination

List endpoints return a bounded number of items, newest first, wrapped in a consistent list envelope.

The list envelope

Every list endpoint returns an object with object: "list" and a data array of the requested resource. This wrapper is stable, so client code can treat all lists the same way.

application/json
{
  "object": "list",
  "data": [
    { "object": "invoice", "id": "inv_3n8Kd0Qz", "status": "paid" },
    { "object": "invoice", "id": "inv_9x2Lp1Ab", "status": "open" }
  ]
}

Limiting results

Use the limit query parameter to control how many items come back. It accepts 1–100 and defaults to 50. Items are always ordered newest first by creation time.

curl "https://markgroup.app/api/v1/invoices?limit=10" \
  -H "Authorization: Bearer $MG_API_KEY"

Filtering

Some lists accept filters in addition to limit — for example, invoices can be filtered by status, and payments by invoice_id. See each endpoint in the API reference for its supported parameters.

Cursor pagination is coming

Today, lists return the most recent items up to your limit. Cursor-based pagination for walking through long histories is on the roadmap. Until then, use filters and a higher limit to narrow results.