Friday 8th August, 2014

Business: UK VAT exchange rates

This post is a little bit off the beaten path for the DataTables blog. Rather than discussing DataTables or its extensions, here I will present one of the tools that SpryMedia uses to help conduct its day to day business for invoicing, conforming to UK tax rules: a web API for VAT exchange rates.

In future I'll be publishing others APIs that I use to run the business (specifically a version and release notes API) and thoughts on setting up and running a business, but this post will only really be of interest to those of you are are running a business in the UK, are VAT registered and invoice in a currency that is not Sterling. If that is you, this API might make life a little bit easier, if not, then you probably won't be too interested in this article!

VAT requirements

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 (See the API documentation for accepted codes).
  • [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
  • 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
}

Notes

I'm delighted to make the service freely available. It has been a lot of work getting the accounts infrastructure up and running for SpryMedia and I hope that other businesses in the UK will be able to benefit from at least some of this work through this API.

If you are in the UK and trade internationally, such as in software as is the case here, I would very much recommend looking into selling in currencies that aren't just Sterling if you don't already. It does take work to get everything setup to meet the requirements of HMRC and your own accounting, but anecdotally (unfortunately exact numbers are possible as there have been a lot of other changes that would effect our sales at the same time as when Dollars and Euros were added as payment options) sales have increased by 33% just from this one change.

I'm always interested to hear from other companies and bootstrappers. If you are in the UK and fancy talking start up, drop me a line, even if just to say "Hi"!

Legal

There are a few important 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.