Octane

Pagination

The transactions endpoint pages with an opaque cursor. Pass next_cursor with the same filters until has_more is false. No skipped or duplicate records.

To page through results, repeat the request with cursor=<next_cursor> and the same filters until has_more is false. The cursor is opaque and keyset-based, so new transactions arriving mid-sync never cause skips or duplicates.

The transactions endpoint uses cursor-based (keyset) pagination. Every response includes a pagination object:

{
  "pagination": {
    "limit": 100,
    "has_more": true,
    "next_cursor": "eyJ0IjoiMjAyNi0wOS0yMFQwODo1OTozNi4zNDBaIiwiaWQiOjE4NTQzMn0"
  }
}
FieldDescription
limitThe page size that was applied.
has_moretrue if another page exists.
next_cursorOpaque token for the next page. null when has_more is false.

How do I page through results?

  1. Make the first request with your filters and no cursor.
  2. While has_more is true, repeat the request with the same filters and cursor=<next_cursor>.
  3. Stop when has_more is false.

Results are ordered newest first by created_at, then by id. Because the cursor encodes the position of the last record rather than an offset, transactions that arrive while you are paging do not cause records to be skipped or repeated.

Rules

  • Treat the cursor as opaque. Its format may change; do not parse or construct it.
  • Always pass the same from, to, corporate_id, corporate_group_id and status values with every page. A cursor only makes sense for the query that produced it.
  • Use limit=100 for bulk syncs to reduce the number of requests against your rate limit.

Example: fetch a full range

async function* transactions(apiKey, filters) {
  const base = 'https://prod-app.octanetech-api.com/api/v1/integration/transactions';
  let cursor;

  do {
    const url = new URL(base);
    for (const [k, v] of Object.entries(filters)) url.searchParams.set(k, String(v));
    url.searchParams.set('limit', '100');
    if (cursor) url.searchParams.set('cursor', cursor);

    const res = await fetch(url, { headers: { 'X-API-Key': apiKey } });
    if (!res.ok) throw new Error(`Octane API ${res.status}: ${await res.text()}`);

    const { data, pagination } = await res.json();
    yield* data;
    cursor = pagination.has_more ? pagination.next_cursor : undefined;
  } while (cursor);
}

for await (const tx of transactions(process.env.OCTANE_API_KEY, {
  from: '2026-09-01T00:00:00Z',
  to: '2026-09-30T23:59:59Z',
})) {
  console.log(tx.id, tx.status, tx.fees.total_amount);
}

How do I fetch more than 31 days?

A single request covers at most 31 days. To sync a longer period, split it into consecutive windows and page through each one:

function* windows(from, to, days = 31) {
  let start = new Date(from);
  const end = new Date(to);
  while (start < end) {
    const next = new Date(Math.min(start.getTime() + days * 86_400_000, end.getTime()));
    yield [start.toISOString(), next.toISOString()];
    start = next;
  }
}

On this page