Pagination

View as Markdown

Lists return { "object": "list", "data": [...], "has_more": true, "next_cursor": "..." }. Pass next_cursor back as cursor for the next page.

Parameters

limit

How many results per page, from 1 to 100. Defaults to 20.

cursor

Where to continue from: the next_cursor of the previous page. Omit for the first page.

The list object

Every list answers with the same envelope. When has_more is false, you have reached the end.

GET /v2/orders
{
  "object": "list",
  "data": [
    {
      "id": "ord_bfP0GSqKoZFrD72H5Os0rc7HV9XP6eQJu",
      "object": "order",
      "number": "PV-SCN-1701A372",
      "channel": "storefront",
      "status": "in_production",
      "customer": {
        "name": "Ana Popescu",
        "email": "ana@example.com",
        "phone": null,
        "company": null
      },
      "shipping_address": {
        "formatted": "Str. Test 1, Cluj, RO",
        "city": "Cluj",
        "country": "Romania",
        "country_code": "RO"
      },
      "charges": {
        "paid_by": "buyer",
        "items": {
          "amount": 1800,
          "currency": "usd"
        },
        "shipping": {
          "amount": 600,
          "currency": "usd"
        },
        "vat": {
          "amount": {
            "amount": 0,
            "currency": "usd"
          },
          "rate": 0,
          "included": false,
          "country": null
        },
        "sample_credit": null,
        "total": {
          "amount": 2400,
          "currency": "usd"
        }
      },
      "earnings": {
        "manufacturing": {
          "amount": 900,
          "currency": "usd"
        },
        "platform_fee": {
          "amount": 300,
          "currency": "usd"
        },
        "payment_processing": {
          "amount": 102,
          "currency": "usd"
        },
        "refunded": {
          "amount": 0,
          "currency": "usd"
        },
        "net": {
          "amount": 498,
          "currency": "usd"
        }
      },
      "shipping": {
        "tier": "small",
        "carrier": null,
        "tracking_number": null,
        "shipped_at": null
      },
      "external": null,
      "customer_notes": null,
      "qc": {
        "open_tickets": 1,
        "blocks_shipping": true
      },
      "created_at": "2026-10-09T08:39:29Z",
      "updated_at": "2026-10-09T08:40:02Z",
      "item_count": 1
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Cursors

Cursors are signed: pass next_cursor back exactly as received. An edited cursor is refused with invalid_cursor.

Fetch every page
let cursor;
const orders = [];

do {
  const url = new URL('/v2/orders', process.env.DAPI_API_URL);
  url.searchParams.set('limit', '100');
  if (cursor) url.searchParams.set('cursor', cursor);

  const response = await fetch(url, {
    headers: { 'x-api-key': process.env.DAPI_API_KEY },
  });
  const page = await response.json();
  orders.push(...page.data);
  cursor = page.has_more ? page.next_cursor : undefined;
} while (cursor);

Syncing changes

Only orders changed after this time. Use it to sync status changes since your last poll.

For changes as they happen, prefer webhooks.

Paginated lists