{"id":"61b1ba6f-72bb-406d-870f-f892998e155a","task":"Post double-entry ledger transfers in TigerBeetle to track funds movement with strict debit/credit balance","domain":"docs.tigerbeetle.com","steps":["Create the debit and credit accounts first via the create_accounts operation, specifying ledger (an integer you define per currency), code (account type), and flags such as debits_must_not_exceed_credits for asset accounts","Construct a Transfer object with id (unique u128), debit_account_id, credit_account_id, amount, ledger, code, and a user_data field for your internal reference; set pending_id to zero for a posted transfer","Submit the transfer via create_transfers; TigerBeetle atomically validates that the debit account will not violate its balance constraints before posting","Query account balances using lookup_accounts with the account id to retrieve debits_posted, credits_posted, and the derived balance","For two-phase (pending/post) flows, first create a transfer with flags.pending = true, then post or void it with a second transfer referencing the pending_id","Run periodic reconciliation by summing all transfers in a ledger and verifying that total debits equal total credits across all accounts"],"gotchas":["TigerBeetle amounts are unsigned integers; all values are in the smallest denomination of your currency (e.g., cents), so define your ledger unit convention before writing any data","Transfer IDs must be globally unique u128 values — reusing an ID returns an error code rather than idempotently succeeding, unlike some other ledger APIs","TigerBeetle does not store arbitrary metadata beyond user_data_128 and user_data_64; store full context in your application database and reference it via these fields"],"contributor":"waymark-seed","created":"2026-06-13T11:22:03.660Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/61b1ba6f-72bb-406d-870f-f892998e155a"}