Quote a conversion between two of one customer's deposit accounts on the current approved customer sheet (conversion service)
/ledger/fx/quotesOnly the conversion service (a service token with ledger:fx:convert, no API key) quotes; every other identity is 403. The source and target must be two open, unprotected deposit accounts of the same customer in different currencies the ledger holds (ledger.currency_unsupported, 422, otherwise). Exactly one of source_amount or target_amount is fixed, in the account currency's minor units. The price comes from the most recently approved, valid, unwithdrawn customer sheet (ledger.fx_rate_unavailable, 409, when there is none): the customer sells at mid less the sell spread and buys at mid plus the buy spread, arbitrary precision, rounding once in the bank's favour; USD equivalents are at mid and their difference is the spread. A quote over a line's per-conversion limit or the customer's remaining daily limit is ledger.fx_limit_exceeded (422). The quote holds for FX_QUOTE_TTL (60 seconds by default), never past the sheet's validity. The Idempotency-Key is bound to the request body.
Headers
Idempotency-KeystringRequiredSend on every write that creates or changes money or state; a replay with the same key returns the original result with 200.
Body parameters
source_amountintegerOptionalsource_ledger_account_idstringRequiredExample lacc_2tVh8nqLxq4GbDe0K1F6S9zRcWm
target_amountintegerOptionaltarget_ledger_account_idstringRequiredExample lacc_2tVh8nqLxq4GbDe0K1F6S9zRcWm
Returns
200 OK
callerstringRequiredcreated_atstring · date-timeRequireddaily_limit_usd_minorintegerRequireddaily_used_usd_minorintegerRequiredexpires_atstring · date-timeRequiredidstringRequiredownerstringRequiredpriceobjectRequiredConversionPrice is the exact result of pricing a conversion on a customer sheet.
10 child attributes
customer_ratestringRequiredTarget major units per source major unit, ten decimals, for display only
source_amountintegerOptionalsource_currency_codestringRequiredsource_usd_equivalentintegerRequiredsource_usd_per_majorstringRequiredspread_usd_minorintegerRequiredtarget_amountintegerOptionaltarget_currency_codestringRequiredtarget_usd_equivalentintegerRequiredtarget_usd_per_majorstringRequiredrate_sheet_idstringRequiredsource_amountintegerOptionalsource_ledger_account_idstringRequiredExample lacc_2tVh8nqLxq4GbDe0K1F6S9zRcWm
target_amountintegerOptionaltarget_ledger_account_idstringRequiredExample lacc_2tVh8nqLxq4GbDe0K1F6S9zRcWm
Errors
Every error is a problem document with a stable code. See Errors.
400401403404409412413422424429500503