SellOrchard

Guides

Pagination & filtering

List endpoints return results in pages. Use the cursor from one page to fetch the next.
On this page

Cursor pagination

ParameterDescription
limitResults per page. Default 50, maximum 250.
cursorThe next_cursor value from the previous response. Omit it for the first page.

Every list response has the same envelope:

JSON
{
  "data": [
    {
      "id": 1042,
      "title": "Stoneware mug"
    },
    {
      "id": 1043,
      "title": "Linen apron"
    }
  ],
  "has_more": true,
  "next_cursor": "eyJpZCI6MTA0M30"
}

When has_more is false, next_cursor is null and you’ve reached the end. Cursors are opaque — don’t build or modify them, and keep the same filters while following one.

Fetching every page

async function* allProducts() {
  let cursor = null;
  do {
    const url = new URL("https://api.sellorchard.com/v1/products");
    url.searchParams.set("limit", "250");
    if (cursor) url.searchParams.set("cursor", cursor);

    const res = await fetch(url, {
      headers: { Authorization: `Bearer ${process.env.SELLORCHARD_API_KEY}` },
    });
    const page = await res.json();
    yield* page.data;
    cursor = page.has_more ? page.next_cursor : null;
  } while (cursor);
}

for await (const product of allProducts()) console.log(product.id, product.title);

Filtering

Most lists accept these filters, plus resource-specific ones listed in the reference (for example status on orders and products):

ParameterDescription
updated_sinceOnly results updated at or after this ISO-8601 time.
created_sinceOnly results created at or after this ISO-8601 time.
Shell
curl "https://api.sellorchard.com/v1/orders?payment_status=paid&updated_since=2026-11-01T00:00:00Z&limit=100" \
  -H "Authorization: Bearer $SELLORCHARD_API_KEY"

Incremental sync

To keep another system in step without re-reading everything:

  1. Do a full sync once, paging through the whole list.
  2. Remember the time you started that sync.
  3. Next time, request updated_since=<that time> and page through the changes.
For near real-time updates, subscribe to webhooks and use updated_since as a periodic safety net in case a delivery is missed.