Currency
Currency
Currency conversion helpers for looking up exchange rates by currency pair and date.
Look up an exchange rate
GET
/currency/exchange-rateReturns the exchange rate from from to to for a given date. Results are cached to limit external lookups. Use this to prefill conversion rates on foreign-currency documents.
Request
Query parameters
fromstringrequired
Source currency (ISO 4217). The document/expense currency.
tostringrequired
Target/quote currency (ISO 4217). Usually the entity's base currency.
datestringrequired
Rate date (YYYY-MM-DD). Uses the closest available historical rate when needed.
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.currency.getExchangeRate({
from: "USD",
to: "EUR",
date: "2026-07-09"
});
console.log(response);Response
Returns
{
"data": {
"rate": 0.92,
"source": "auto",
"date": "2026-07-09T00:00:00.000Z",
"from_currency": "USD",
"to_currency": "EUR",
"available": true
}
}Example: