Reconciliation
A verdict and a stream. The verdict says whether Parity’s records, the cash ledger and the venue agree; the stream is every money fact Parity recorded for you, totally ordered and resumable.
The verdict
ledger:read. Optional ?from=, an ISO-8601 timestamp; defaults to the accounting epoch, since earlier trades predate the ledger.{
"ranAt": "2026-08-22T09:00:04.118Z",
"from": "2026-01-01T00:00:00.000Z",
"ok": true,
"trialBalance": { "debits": 41230.5, "credits": 41230.5, "difference": 0, "balanced": true },
"cashStatement": { "side": "hosted", "accountsInScope": 0, "opening": 0, "ending": 0,
"expectedEnding": 0, "difference": 0, "reconciled": true },
"collateralStatement": { "side": "operator_collateral", "accountsInScope": 1,
"opening": 0, "ending": 12840.25,
"expectedEnding": 12840.25, "difference": 0, "reconciled": true },
"scanned": { "entries": 1841, "lines": 4102, "accounts": 37 },
"venueAgreement": { "exits": 96, "agrees": 96, "disagrees": 0, "unknown": 0 },
"findings": []
}ok: falsemeans at least one finding needs a person. Retrying will not clear it.- The cash statement carries both
expectedEnding(what the identity predicts) andending(what the accounts hold), so a mismatch is visible. - Of the two statements,
collateralStatementis about your money: every cash leg of every trade posts against your collateral at the venue.cashStatementcovers a Parity-held player balance and is all zeroes unless we hold your players' wallets. - Read
accountsInScopebeforereconciled. Over zero accounts the identity reportstruewithout proving anything. - The trial balance is zero if every entry balanced when posted and none was edited. A non-zero difference means something wrote outside the posting engine: alert on it.
venueAgreementcounts exits where the venue's report matched Parity's.unknownis not a disagreement: the venue has not answered yet.
Findings
{
"check": "position_cost_mismatch",
"severity": "critical",
"detail": "position cost 24.70 vs ledger 24.69",
"subjectType": "user",
"subjectId": "player-8421"
}subjectType tells you which id space subjectId is in. user means your own id for a customer; record means a Parity id (an entry, order, position or account) you can quote to support. Parity's internal user uuid is never published, in subjectId or in detail.
Each statement carries externalUserId, your id for the customer it is scoped to, which is null on this report because it covers your whole operator. operatorUserId is still present, always null, and deprecated: read externalUserId instead. operatorId is your own operator id, the same value an embed session returns.
The fact stream
ledger:read. ?cursor= opaque, ?type= repeatable, ?externalUserId=, ?limit= (default 100; above 500 reads as 500). An unknown type is 400 invalid_type and names the supported ones; an unknown externalUserId is 404 unknown_user.Store nextCursor and send it back to receive every fact recorded since, and nothing you have already seen.
{
"items": [
{
"id": "c9b3e8f2-…",
"type": "ledger.posted",
"cursor": "…",
"occurredAt": "2026-08-21T04:43:40.301Z",
"externalUserId": "player-8421",
"positionId": null, // always null on ledger.posted
"orderId": null, // the entry names what it posts in detail
"money": {
"currency": "USD",
"amount": "24.70",
"lines": [ // the balanced posting itself
{ "accountId": "…", "debit": "24.70", "credit": "0.00" },
{ "accountId": "…", "debit": "0.00", "credit": "24.70" }
]
},
"detail": {
"movementType": "BUY",
"memo": null,
"referenceType": "order",
"referenceId": "3dd27f36-…",
"correctsEntryId": null
}
}
],
"nextCursor": "…",
"hasMore": true
}| Item type | The fact it records |
|---|---|
order.state_changed | An order moved between states. |
order.filled | A fill landed against an order. |
fee.assessed | A fee was charged. |
collateral.moved | Collateral was committed or returned. |
ledger.posted | A double-entry movement was written. |
position.exited | A position was reduced or closed. |
position.settled | A position resolved. |
webhook.emitted | An event was queued for delivery. |
Swipe the table sideways for more columns.
What money and detail carry, per type
| Item type | money | detail |
|---|---|---|
order.state_changed | The entry money block: authorizationAmount, actualDebit, releaseAmount, tradeAmount, platformFee, venueFee, venueFeeKnown. | fromState, toState, reason, side, action, orderStatus, simulated. |
order.filled | null: the order’s money is on order.state_changed, once per transition, so summing fills cannot double-bill. | quantity, price, side. |
fee.assessed | currency, amount. | kind, bps. |
collateral.moved | currency, amount, balanceAfter, committedAfter. | kind, memo, ledgerEntryId. |
ledger.posted | currency, amount, lines (accountId, debit, credit). | movementType, memo, referenceType, referenceId, correctsEntryId. |
position.exited | The exit money block: sellProceeds, platformFee, venueFee, venueFeeKnown. | side, quantity, quantityRemaining, exitPrice, entryPrice, simulated, venueAgrees, venueFeeKnown, costBasis, entryFeeShare, realisedPnl. |
position.settled | currency, settlementCredit, voidCredit. | resolution, side, contracts, realisedPnl, lifetimeRealisedPnl, outcome. |
webhook.emitted | null. | eventType, dedupeKey. |
Swipe the table sideways for more columns.
Reading does not consume
The same cursor always returns the same items, so a consumer that crashes mid-batch reads again. Advance your stored cursor only once the batch is applied, never on receipt.
Apply idempotently on id, the fact's own id.
let cursor = await store.readCursor();
for (;;) {
const page = await parity.readFeed({ cursor, limit: 500 });
for (const fact of page.items) await apply(fact); // idempotent on fact.id
if (!page.nextCursor) break;
cursor = page.nextCursor;
await store.writeCursor(cursor); // only after applying
if (!page.hasMore) break;
}hasMore: falsemeans caught up; poll later with the same cursor. Caught up means everything final so far: the head waits for in-flight writes, so a row may arrive a moment after it committed but always arrives.- An unrecognised
typeis400 invalid_type, so a misspelled filter does not return an empty feed that looks complete. - A malformed cursor is
400 invalid_cursor, not a restart from the beginning. - Items carry
externalUserId(your own id) ornullfor operator-level facts. Never Parity's internal uuid.
Which surface answers which question
| Question | Where |
|---|---|
| What must I credit this customer? | GET /api/v1/settlements |
| What is still open on our book? | GET /api/v1/positions?status=open |
| What happened to this one order? | GET /api/v1/orders?externalUserId=&clientOrderId= |
| Rebuild our own ledger from scratch | GET /api/v1/reconciliation/feed |
| Do the books agree right now? | GET /api/v1/reconciliation |
| What has this player been doing? | GET /api/v1/players/{id}/activity |
Swipe the table sideways for more columns.
None of these is a balance. Parity holds no customer funds; reconciliation lets you check your own ledger against the facts Parity recorded.