withdraw
Record a cash outflow from the ledger in any currency. Fails if the balance is insufficient; bookkeeping only, no real payment system.
Instructions
Record a cash withdrawal from the ledger, in any currency. Fails if the balance is insufficient. Bookkeeping only — no real payment system is connected.
Args: currency: ISO-style currency code, e.g. "CNY", "USD", "AUD". amount: Amount to remove; must be > 0. idempotency_key: Reuse the same key when retrying this exact call; recorded once.
Returns: Updated cash balances, or {"status": "error", "error": ...}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount to remove; must be > 0. | |
| currency | Yes | ISO-style currency code, e.g. 'CNY', 'USD', 'AUD'. | |
| idempotency_key | No | Optional client-generated key (e.g. a UUID4). When retrying this SAME call after a timeout or an unknown result, reuse the same key: the ledger records it once and later calls return {"status": "duplicate"} without touching cash or holdings. Only the key is compared, not the arguments — a different order (other symbol/units/price/amount) needs a new key, or it is silently treated as the retry. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |