Price in the visitor currency.
Convert a price off the published rate, and carry the moment it was observed beside the amount you charge.
Four keys say which way.
Three pairs touch four currencies. Every couple that includes the base is one published rate and one operation; every couple that does not is two rates and a step of your own.
- 6published, direct
- 6yours to compute
- 4the same currency
| From ↓ / Into → | USD | EUR | GBP | JPY |
|---|---|---|---|---|
| USD | USD into itself needs no rate | |||
| EUR | EUR into itself needs no rate | |||
| GBP | GBP into itself needs no rate | |||
| JPY | JPY into itself needs no rate |
EUR into GBP
yours to compute- Route
- EUR → USD → GBP
- Rate
- 1 EUR = 0.860317 GBP
- EUR/USD
- 1.1385asset EUR · quote USD
- GBP/USD
- 1.32335asset GBP · quote USD
GET /v1/prices/latest?assets=EUR,GBPLIAW publishes neither this pair nor a settlement rate for it. The figure below is computed here, from the two rates above, and it is yours.
- assetstring
- The base of the pair — the side the rate is pricing.
- quotestring
- The side it is priced in, echoed per row, so a lookup cannot mismatch.
- pricestring
- The rate as a decimal string, so a converted total stays exact.
- updated_atstring
- The observation time to store beside any amount you charge.
Two calls, one operation.
One call carries a shared quote.
Both pairs quoted in the base ride one request, so a one in the grid costs one line.
GET /v1/prices/latest?
assets=EUR, GBP The other quote is its own call.
One pair is quoted in yen, and quote is a request-level parameter, so it needs its own call.
GET /v1/prices/latest?
assets=USD& quote=JPY The direction costs nothing.
The row already says which side is priced, so it already says which way to go.
shown = amount ÷ rate · no request
The pair itself is refused.
The parameter refuses the pair itself, so a two in the grid is two rates and your step.
assets=EUR&
quote=GBP · 400 INVALID_QUOTE
Show a rate you can defend.
Read the FX page, or open the live currency board.