Get Store Credits

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.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Query Params
date-time

Filter store credits by those created after specific time (inclusive).
取得 created_at 大於等於指定時間的購物金。
Accepts ISO 8601 format. Use UTC (Z suffix) to avoid timezone ambiguity.
接受 ISO 8601 格式,建議帶 Z 明確指 UTC,避免時區歧義。

date-time

Filter store credits by those created before specific time (inclusive).
取得 created_at 小於等於指定時間的購物金。
Accepts ISO 8601 format. Use UTC (Z suffix) to avoid timezone ambiguity.
接受 ISO 8601 格式,建議帶 Z 明確指 UTC,避免時區歧義。

date-time

Filter store credits expiring after specific time (inclusive).
取得 end_at 大於等於指定時間的購物金(撈「快到期」名單時可帶 now)。
Accepts ISO 8601 format. Use UTC (Z suffix) to avoid timezone ambiguity.
接受 ISO 8601 格式,建議帶 Z 明確指 UTC。

date-time

Filter store credits expiring before specific time (inclusive).
取得 end_at 小於等於指定時間的購物金(撈「快到期」名單時可帶 now + N days)。
Accepts ISO 8601 format. Use UTC (Z suffix) to avoid timezone ambiguity.
接受 ISO 8601 格式,建議帶 Z 明確指 UTC。

integer

Page Number (offset mode).
頁數
Ignored when limit or previous_id is provided (cursor mode).

integer

Numbers of items per page (offset mode).
每頁顯示 n 筆資料
Ignored in cursor mode; use limit instead.

integer
1 to 999
Defaults to 24

Cursor mode page size (default 24, max 999).
cursor 模式每次回傳筆數。
Presence of this param enables cursor mode (response returns last_id instead of pagination).
limit 即啟用 cursor,response 不再含 pagination
Larger values reduce total round trips for large batch jobs (e.g. fetching 60k records with limit=999 takes ~60 calls vs ~2500 with limit=24).
大批次任務建議用較大值以減少請求次數。

string

Cursor for the next page: the _id from the previous response's last_id.
上一頁回傳的 last_id。第一頁不需帶。
Presence of this param also enables cursor mode.
Recommended for large batch / external integrations (avoids ES offset depth limit).

excludes[]
array of strings

Could exclude certain parameters in the response
結果要排除哪些參數

excludes[]
fields[]
array of strings

Could only show certain parameters in the response
結果只顯示哪些參數

fields[]
Response

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json