Tax and customs exchange rates

A tax return or customs declaration in a foreign currency has to be converted to local currency, and the rate is usually set by the authority, not the market. Using another rate can change the tax or duty owed.

How authorities publish rates

PatternWhat it means for software
Fixed rate per week or monthLook up the rate by the period the transaction falls in, not by the day.
New table on fixed days of the monthThe rate changes on notification days only; store the effective date range.
Yearly average or year-end rateUsed for converting annual income or balances, one rate per currency per year.
Points to the central bank rateUse the central bank table for the date the rules name, often the day before.

Common cases

Fetching an authority's table

Tax and customs authorities use the same endpoints as central banks, with their own codes. For example, the US Treasury reporting rates:

curl -H "Authorization: Bearer $ALLRATES_KEY" \
  https://allratestoday.com/api/v1/central-bank/ustreasury/latest

The tax and customs exchange rate API page lists all 68 authorities with their codes and schedules.