convert
Convert funds between two currency accounts instantly using the broker quote. Use idempotency key to safely retry without double-converting. Requires --allow-write-operations flag.
Instructions
Instantly convert funds between two currency accounts on the authenticated profile via the Luno broker (e.g. ZAR to ZARU). The conversion is final and applies the broker quote at execution time. Pass idempotency_key to make retries safe; omitting it generates a fresh UUID per call, so retries on network error may double-convert. Write operation: requires the --allow-write-operations flag or ALLOW_WRITE_OPERATIONS=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount of the source currency to convert, as a decimal string (e.g. "100.00"). Must be positive. | |
| idempotency_key | No | Any unique string up to 255 chars. Reuse the same key to safely retry a failed call without double-converting. Auto-generated as a UUID when omitted. | |
| source_account_id | Yes | Numeric ID of the account to debit, as a string (from get_balances). | |
| target_account_id | Yes | Numeric ID of the account to credit, as a string (from get_balances). Must hold the target currency. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| converted_amount | Yes | ||
| id | Yes | ||
| source_account_balance | Yes | ||
| source_currency | Yes | ||
| target_account_balance | Yes | ||
| target_currency | Yes |