The ledger is the history of a wallet: one entry for every grant, spend, pack delivery and refund, never edited and never deleted. Read it to show a player their history, to answer a support request, or to reconcile your own records. The examples on this page continue from the setup.
200 OK: a page of LedgerEntry objects and the cursor of the next page.
Field
Type
Description
entries
array
The entries of the page, newest first.
nextCursor
string or null
Pass it as cursor to get the next page. null on the last page.
To get the next page, pass the cursor back; the other parameters stay the same:
The SDKs can follow the cursors for you. iterate fetches a page only when your loop reaches it, so you can stop whenever you want; limit is the page size:
limit is not a whole number from 1 to 100 (details.fieldErrors.limit); currency is malformed; cursor is not one this API issued (CURSOR_INVALID); the player reference is malformed (PLAYER_REF_INVALID)
Fix the parameter. Never edit a cursor: pass back the one you received.
404
NOT_FOUND
The player does not exist
An ext: player exists after its first write; before that it has no history.
Every entry carries balanceAfter, the balance right after it, so you can display a running balance without adding anything up. paidDelta and bonusDelta are negative for a spend.
ref.itemSku is set on a purchase of an item and ref.orderId on an entry caused by an order (pack delivery, refund). The entry types are listed in Objects.
Entries are never edited: an error is corrected by a new entry, not by changing an old one.
A parameter this API does not know is ignored, not refused. A currency that is well-formed but unknown to the game is not an error either: you get an empty page.
Ids sort by creation time. Paging goes back in time from the newest entry, so entries written while you page do not shift the pages behind you.