record_fee
Records a paid fee or tax by debiting ledger cash and leaving positions unchanged, so it is booked as an account cost, not a withdrawal; fails if cash is insufficient.
Instructions
Record a fee or a tax the user already paid: debits ledger cash, positions unchanged. It is an account cost (inside NAV), not a withdrawal. Trade commissions need no separate entry — buy / sell already book the trade. Fails if the currency's cash balance is lower than the amount.
Confirm the amount and date with the user before calling; this moves ledger cash.
Args: amount: Amount paid; must be > 0. currency: Currency of the cash debited. kind: "fee" (default) or "tax". symbol: Related ticker (optional). trade_date: YYYY-MM-DD it was charged (default today). note: Free-text note. idempotency_key: Reuse the same key when retrying this exact call; recorded once.
Returns: Cash debited and new balance, or {"status": "error", "error": ...}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | 'fee' (default: account / remittance / standalone commission) or 'tax' (e.g. dividend tax settled afterwards). | fee |
| note | No | Free-text note stored with the ledger row. | |
| amount | Yes | Amount paid (positive number); must be > 0. | |
| symbol | No | Ticker the fee/tax relates to (optional; omit for account-level). | |
| currency | Yes | Currency the cash left in, e.g. 'CNY', 'USD', 'AUD'. | |
| trade_date | No | Date the event happened, YYYY-MM-DD (default: today). Account performance books it on this date, so pass the real date when back-filling history. | |
| 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 |