VAT API

In the UK, if you (as a business or individual) are VAT registered and invoice in currencies other than Sterling, your invoices and VAT accounting are required to show the Sterling equivalent prices for the original currency price. The HMRC site states:

You can buy and sell in any currency, but when you keep your VAT accounts, amounts in foreign currencies must be converted into sterling. Invoices must always show sterling figures for the net totals and VAT for each VAT rate, even if they also show foreign currency figures. Source

There are two standard ways in which HMRC accepts the conversion from the transaction currency to Sterling:

  • UK market selling rate at time of supply (as published in national newspapers)
  • Period rate of exchange

It is the latter method that we are interested in here. HMRC publish exchange rates that are accepted for a given time period, with adjustments when required. The rate for the period at the time of supply can be used to convert to Sterling and for VAT accounting.

The API presented here provides that information through simple HTTP GET requests, in a JSON format, for integration with your own invoicing system.

API

This HTTP API accepts only GET requests and does so in two formats:

  • GET http[s]://api.datatables.net/vat/exchange-rate/[currency]
  • GET http[s]://api.datatables.net/vat/exchange-rate/[currency]/[date]

where:

  • [currency] - case insensitive three letter name of the transaction currency (ISO 4217 - see below for all available currencies and the countries that use them).
  • [date] - the date that the exchange rate is required for. This is in the ISO 8601 date format: YYYY-MM-DD. This parameter is optional and if not given, today's date (as it is in the UK - GMT/BST), will be used.

The returned JSON object contains the following properties:

  • currencyCode - three letter currency code (ISO 4217)
  • currencyName - Full name of the currency
  • effectiveFrom - ISO 8601 date indicating when this rate was active from
  • rate - the exchange rate (transactionCurrencyValue / rate = sterlingValue)

Examples

Get US Dollar (USD) exchange rate for today:

Request

GET https://api.datatables.net/vat/exchange-rate/usd

Response

{
    "currencyCode":  "USD",
    "currencyName":  "Dollar",
    "effectiveFrom": "2014-08-01",
    "rate":          1.7042
}
Get Euro (EUR) exchange rate for 1st August 2014:

Request

GET http://api.datatables.net/vat/exchange-rate/eur/2014-08-01

Response

{
    "currencyCode":  "EUR",
    "currencyName":  "Euro",
    "effectiveFrom": "2014-08-01",
    "rate":          1.2658
}

Currency names

The following table shows the currency codes, currency name, country name and country code that use the currency for easy lookup to check what currencies you can use with this API.

Country Currency
Name Code Name Code
Argentina AR Peso ARS
Australia AU Dollar AUD
Austria AT Euro EUR
Belgium BE Euro EUR
Brazil BR Real BRL
Canada CA Dollar CAD
Cyprus CY Euro EUR
Denmark DK Krone DKK
Estonia EE Euro EUR
Finland FI Euro EUR
France FR Euro EUR
Germany DE Euro EUR
Greece GR Euro EUR
Hong Kong HK Dollar HKD
India IN Rupee INR
Ireland IE Euro EUR
Israel IL Shekel ILS
Italy IT Euro EUR
Japan JP Yen JPY
Latvia LV Euro EUR
Luxembourg LU Euro EUR
Malaysia MY Ringgit MYR
Malta MT Euro EUR
Mexico MX Mexican Peso MXN
Netherland NL Euro EUR
New Zealand NZ Dollar NZD
Norway NO Norwegian Krone NOK
Philippines PH Peso PHP
Portugal PT Euro EUR
Saudi Arabia SA Riyal SAR
Singapore SG Dollar SGD
Slovakia SK Euro EUR
Slovenia SI Euro EUR
South Africa ZA Rand ZAR
South Korea KR Won KRW
Spain ES Euro EUR
Sweden SE Krona SEK
Switzerland CH Franc CHF
Taiwan TW Dollar TWD
Thailand TH Baht THB
USA US Dollar USD
European Community EU Euro EUR
Abu Dhabi DH Dirham AED
Afghanistan AF Afghani AFN
Albania AL Lek ALL
Algeria DZ Dinar DZD
Angola AO Readj Kwanza AOA
Antigua AG E Caribbean Dollar XCD
Armenia AM Dram AMD
Aruba AA Florin AWG
Azerbaijan AZ New Manat AZN
Bahamas BS Dollar BSD
Bahrain BH Dinar BHD
Bangladesh BD Taka BDT
Barbados BB Dollar BBD
Belarus BY Rouble BYR
Belize BZ Dollar BZD
Benin BJ CFA Franc XOF
Bermuda BM Dollar (US) BMD
Bhutan BT Ngultrum BTN
Bolivia BO Boliviano BOB
Bosnia- Herzegovinia BA Marka BAM
Botswana BW Pula BWP
Brunei BN Dollar BND
Bulgaria BG Lev BGN
Burkina Faso BK CFA Franc XOF
Burundi BI Franc BIF
Cambodia KH Riel KHR
Cameroon Republic CM CFA Franc XAF
Cape Verde Islands CV Escudo CVE
Cayman Islands KY Dollar KYD
Central African Republic CF CFA Franc XAF
Chad TD CFA Franc XAF
Chile CL Peso CLP
China CN Yuan CNY
Colombia CO Peso COP
Comoros KM Franc KMF
Congo (Brazaville) CG CFA Franc XAF
Congo (DemRep) ZR Congo Fr CDF
Costa Rica CR Colon CRC
Cote d'Ivoire CI CFA Franc XOF
Croatia HR Kuna HRK
Cuba CU Peso CUP
Czech Republic CZ Koruna CZK
Djibouti DJ Franc DJF
Dominica DM E Caribbean Dollar XCD
Dominican Republic DO Peso DOP
Dubai DU Dirham AED
Ecuador EC Dollar ECS
Egypt EG Pound EGP
El Salvador SV Colon SVC
Equatorial Guinea GQ CFA Franc XAF
Eritrea ER Nakfa ERN
Ethiopia ET Birr ETB
Fiji Islands FJ Dollar FJD
Fr. Polynesia PF CFP Franc XPF
Gabon GA CFA Franc XAF
Gambia GM Dalasi GMD
Georgia GE Lari GEL
Ghana GH Cedi GHS
Grenada GD E Caribbean Dollar XCD
Guatemala GT Quetzal GTQ
Guinea Bissau GW CFA Franc XOF
Guinea Republic GN Franc GNF
Guyana GY Dollar GYD
Haiti HT Gourde HTG
Honduras HN Lempira HNL
Hungary HU Forint HUF
Iceland IS Krona ISK
Indonesia ID Rupiah IDR
Iran IR Rial IRR
Iraq IQ Dinar IQD
Jamaica JM Dollar JMD
Jordan JO Dinar JOD
Kazakhstan KZ Tenge KZT
Kenya KE Schilling KES
Korea (North) KP Won KPW
Kuwait KW Dinar KWD
Kyrgyz Republic KG Som KGS
Lao People's Dem Rep LA Kip LAK
Lebanon LB Pound LBP
Lesotho LS Loti LSL
Liberia LR Dollar (US) LRD
Libya LY Dinar LYD
Lithuania LT Litas LTL
Macao MO Pataca MOP
Macedonia MK Denar MKD
Madagascar MG Malagasy Ariary MGA
Malawi MW Kwacha MWK
Maldive Islands MV Rufiyaa MVR
Mali Republic ML CFA Franc XOF
Mauritania MR Ouguiya MRO
Mauritius MU Rupee MUR
Moldova MD Leu MDL
Mongolia MN Tugrik MNT
Montserrat MS E Caribbean Dollar XCD
Morocco MA Dirham MAD
Mozambique MZ Metical MZN
Myanmar MM Kyat MMK
Nepal NP Rupee NPR
New Caledonia NC CFP Franc XPF
Nicaragua NI Gold Cordoba NIO
Niger Republic NE CFA Franc XOF
Nigeria NG Naira NGN
Oman OM Rial OMR
Pakistan PK Rupee PKR
Panama PA Balboa PAB
Papua New Guinea PG Kina PGK
Paraguay PY Guarani PYG
Peru PE New Sol PEN
Poland PL Zloty PLN
Qatar QA Riyal QAR
Romania RO New Leu RON
Russia RU Rouble RUB
Rwanda RW Franc RWF
Saotome & Principe ST Dobra STD
Senegal SN CFA Franc XOF
Serbia XS Dinar RSD
Seychelles SC Rupee SCR
Sierra Leone SL Leone SLL
Soloman Islands SB Dollar SBD
Somali Republic SO Schilling SOS
Sri Lanka LK Rupee LKR
St Christopher & Anguilla KN E Caribbean Dollar XCD
St Lucia LC E Caribbean Dollar XCD
St Vincent VC E Caribbean Dollar XCD
Sudan Republic SD Pound SDG
Surinam SR Dollar SRG
Swaziland SZ Lilangeni SZL
Syria SY Pound SYP
Tajikistan TJ Somoni TJS
Tanzania TZ Schilling TZS
Togo Republic TG CFA Franc XOF
Tonga Islands TO Pa'anga (AUS) TOP
Trinidad/Tobago TT Dollar TTD
Tunisia TN Dinar TND
Turkey TR Turkish Lira TRY
Turkmenistan TM New Manat TMT
UAE HA Dirham AED
Uganda UG Schilling UGX
Ukraine UA Hryvnia UAH
Uruguay UY Peso UYU
Uzbekistan UZ Sum UZS
Vanuatu VU Vatu VUV
Venezuela VE Bolivar Fuerte VEF
Vietnam VN Dong VND
Wallis & Futuna Islands WF CFP Franc XPF
Western Samoa WS Tala WST
Yemen (Rep of) YE Rial YER
Zambia ZM Kwacha ZMW
Zimbabwe ZW Dollar ZWL

Legal

This service is provided in good faith, however there are a number of legal points to make:

  • The information contained on this page does not constitute legal, professional or financial advice (consult your accountant if you need advice on VAT matters).
  • SpryMedia Ltd accepts no responsibility or liability whatsoever with regard to the information obtained using this API.
  • This API is not rate limited, but any abuse of the service will result in IP banning.
  • This API is not an official HMRC API - we consume the data published by HMRC to make it available through this API.
  • SpryMedia Ltd is not affiliated with HMRC in any way.

If you are interested in using the API and require an uptime or maintenance guarantee, please get in touch to discuss your requirements.