To get customers store credits.
獲取商店購物金紀錄。
Strongly recommended: use cursor-based pagination (limit + previous_id) instead of offset (page + per_page).
強烈建議使用 cursor 翻頁(limit + previous_id),不要用 page + per_page。
How to switch to cursor / 如何切換: simply pass limit (and previous_id from the previous response's last_id for next pages). Response will return last_id instead of pagination.
帶 limit 即啟用 cursor,後續頁帶上一次的 last_id 作為 previous_id。Response 回 last_id 取代 pagination。
Filters + cursor coexist / 篩選 + cursor 同時使用:
Filter params (end_at_after, end_at_before, created_at_*) apply BEFORE cursor. Every page returns items already matching the filter — cursor paginates within the filtered set.
篩選參數先套用,cursor 在篩選後的結果集內翻頁。每頁回的都是符合篩選條件的資料。
Example — fetch all credits expiring in the next 30 days / 撈未來 30 天到期名單:
Page 1 — pass filter + limit (no previous_id on first page):
GET /v1/user_credits?end_at_after=2026-05-19T00:00:00Z&end_at_before=2026-06-18T23:59:59Z&limit=200
→ { items: [200 items, all expiring 2026-05-19 ~ 2026-06-18], last_id: "6a056255..." }
Page 2 — repeat filter + pass previous_id from previous last_id:
GET /v1/user_credits?end_at_after=2026-05-19T00:00:00Z&end_at_before=2026-06-18T23:59:59Z&limit=200&previous_id=6a056255...
→ { items: [200 more items, still within filter], last_id: "69faf974..." }
...repeat until items.length < limit OR last_id is null (whichever comes first):
→ { items: [...remaining items, fewer than limit...], last_id: null }
Stop condition / 停止條件: items.length < limit OR last_id === null.
Note: when total count is an exact multiple of limit, last_id may still be non-null on the final full page; the next call will return empty items with last_id = null. Always check both conditions.
注意:當總筆數剛好是 limit 倍數時,最末頁 last_id 仍會回非 null;下一次呼叫才會回空陣列 + last_id = null。請同時檢查兩個條件。
Offset mode is retained only for backward compatibility and will not receive new improvements.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
