Ledger
Parity’s own double-entry books. Every movement is one record whose debits equal its credits, and balances are summed from lines, never stored.
What this is, and is not
Sandbox only: 403 sandbox_only in live mode
This endpoint models a balance held by Parity, which a live operator does not have. It exists so an integration can be learned against simulated money.
In production you own your customers' cash ledger. Parity returns the exact amounts to apply against it (operatorMoney, operatorExitMoney, settlementCredit) and never holds a player's funds. Do not build the live integration on this endpoint.
This page describes Parity's internal accounting, not your customers' wallet. Read it to understand the sandbox and how a reconciliation is proved, not to build a live balance.
The part of this that belongs to the live integration is the reconciliation surface, which is available to every operator: a verdict, and a resumable stream of the money facts recorded for you.
The chart of accounts
There are six account kinds.
| Kind | Type | Per user | Holds |
|---|---|---|---|
user_available | liability | yes | Cash the player may spend. |
user_reserved | liability | yes | Cash earmarked against a working order. Still the player’s money. |
position_cost | liability | yes | What open contracts cost: never what they are worth. |
treasury_cash | asset | no | Funds held in the operator treasury wallet. |
fee_revenue | income | no | Parity’s commission. |
house_equity | equity | no | Sandbox funding source, and the counterparty trading P&L is booked against. |
Swipe the table sideways for more columns.
position_cost is cost, not a mark
A position's value moves with every price; the cash that bought it does not, and only cash belongs in a ledger. What a holding is worth today comes from prices, not a balance.
Movement types
Every entry carries a movementType, so a statement can be grouped without separate counters.
| Movement | Effect on the player’s cash |
|---|---|
SANDBOX_CREDIT | Increase. Test funds, from house equity. Sandbox tenants only. |
DEPOSIT | Increase. A funded, credited deposit. |
WITHDRAWAL | Decrease. |
ORDER_RESERVE | Neutral. Moves cash from available to reserved. |
RESERVE_RELEASE | Neutral. Moves it back. |
BUY | Decrease. Cash becomes position cost. |
FEE | Decrease. Cash becomes fee revenue. |
SELL | Increase. |
SETTLEMENT | Increase by the payout. A split result (a void the source settled by dividing the payout between both sides) posts here, at the split payout, with the fee kept. |
VOID_REFUND | Increase. An annulled market: everything committed, fee included. |
ADJUSTMENT | Either. A correction, always pointing at the entry it corrects. |
HOSTED_SPEND | Decrease. A fill drew the operator float and the player’s own wallet reimbursed it. |
HOSTED_PAYOUT | Increase. Sale proceeds, a win or a void refund reaching that wallet. |
VENUE_FEE | Decrease. The fee the venue itself kept on a fill. |
Swipe the table sideways for more columns.
Treat movementType as open, not as an enum
This list grows without a new API version, as the last three rows did. Handle the movements you need and pass any others through unchanged; do not validate against a closed list.
ORDER_RESERVE and RESERVE_RELEASE net to zero on the player's cash total, which is why a reconciliation proves available + reserved, and not available alone.
HOSTED_SPEND and HOSTED_PAYOUT are a pair, and they appear only for a customer whose wallet Parity holds. Every cash leg of a trade posts against the operator float, so for a hosted customer these two move their own balance in step with it: the float pays the venue and the customer's money reimburses the float. Over a whole trade the float ends where it started.
The order path posts into these books: a buy writes BUY and FEE, an exit writes SELL and its own fee, and settlement writes SETTLEMENT or VOID_REFUND. The same postings happen for a live tenant. What differs is that a live tenant has no per-user cash accounts to read back, because those customers' cash is on your books.
The three rules that make it trustworthy
Entries balance before they are written
Debits and credits are summed and compared before the insert, so an unbalanced entry cannot exist, even briefly.
Nothing is ever edited
A database trigger rejects UPDATE on entries and lines outright. A correction is a new entry carrying correctsEntryId, so both the original and the correction are kept.
One fact posts once
(operatorId, idempotencyKey) is unique, and the key is derived from the fact (the settlement, the fill, the deposit), never from the attempt. A replayed settlement, retried fill or redelivered bridge webhook hits that index instead of paying twice.
Why that matters to you
So retrying after a timeout is safe on any money-moving call: the second attempt returns the original and writes nothing.
Reading a sandbox balance
{id} is your id for them: the same value you send as X-Parity-User. Optional ?currency=, default USD. Scope ledger:read. 403 sandbox_only in live mode.{
"userId": "your-own-player-id",
"status": "active",
"currency": "USD",
"mode": "sandbox",
"available": 240.00,
"reserved": 10.00,
"cash": 250.00,
"positionCost": 62.50,
"asOf": "2026-08-21T17:04:12.115Z"
}available: spendable now.reserved: committed to a working order and still unspent.cash:available + reserved. The only figure here that is cash.positionCost: shown separately, outside the total, because a position cannot be spent.modecomes from your operator record, not from anything in the request. It is the reliable way to tell which tenant a figure belongs to.- Reading a balance does not create a player. An id that has never traded or deposited returns
404 unknown_user, so a typo shows as an error, not a zero.
Reading the movements
?limit= defaults to 50 and caps at 200; ?cursor= continues the page. Scope ledger:read. 403 sandbox_only in live mode.{
"userId": "your-own-player-id",
"movements": [
{
"id": "…",
"type": "SETTLEMENT",
"amount": 68.61,
"currency": "USD",
"referenceType": "position_settlement",
"referenceId": "…",
"memo": null,
"correctsEntryId": null,
"createdAt": "2026-08-21T17:04:12.115Z"
}
],
"count": 1,
"nextCursor": "…",
"hasMore": true
}amountis the entry's magnitude and is always positive. Its direction comes fromtype. Switch on the movement, not a sign: aFEEand aWITHDRAWALboth reduce cash but mean different things.referenceTypeandreferenceIdpoint at the fact that caused the movement (an order, a position settlement, a deposit), so a statement can be joined to your own records.correctsEntryIdis non-null on a correction, naming the entry it supersedes. Neither entry is ever removed.- Page until
nextCursorisnull. The cursor is an entry id, not a timestamp, becausecreatedAtis stored to the microsecond and serialises to the millisecond, so a timestamp cursor would skip rows in the same millisecond. - The debit and credit lines are not exposed, so Parity's chart of accounts is not part of the partner contract.
The identity a reconciliation proves
Every term in a statement is a sum of lines against the two user cash accounts, grouped by movement, so the identity checks that the movements add up to the balance held.
opening
+ deposits (SANDBOX_CREDIT, DEPOSIT)
+ sales (SELL)
+ settlements (SETTLEMENT, VOID_REFUND)
+ adjustments (ADJUSTMENT)
+ hostedTransfers (HOSTED_SPEND, HOSTED_PAYOUT)
− purchases (BUY)
− fees (FEE)
− withdrawals (WITHDRAWAL)
− venueFees (VENUE_FEE)
= endinghostedTransfers is a signed figure, not an inflow and an outflow, because the pair is a transfer between the two pots: net money in on one side is net money out on the other.
GET /api/v1/reconciliation returns both expectedEnding (what the identity predicts) and ending (what the accounts say), plus their difference and a reconciled flag, so a mismatch is visible. That endpoint is not sandbox-gated. See Reconciliation.