The all new Trade Tariff tool

Yesterday the new Trade Tariff tool on GOV.UK was released as part of the wider ‘international trade’ release. Matthew Ford, Ruby on Rails developer from Bit Zesty explores the tool in more detail.

When we were first tasked with rebuilding the trade tariff tool, my initial reaction was ‘that looks fairly straight forward’ and on the surface, it is. However it’s only when you delve into the underlying data that you start to understand the true complexity of the system. But before we go into that, the question most people ask when presented with the tariff is, what’s it for?

Let’s pretend that I wanted to import 20 bags of coffee from Columbia. As part of the customs declaration procedure, I would need to declare the commodity code for the coffee (known as the TARIC code) and the tariff tool allows you to find that. It also gives you details of duty you’ll have to pay and any legal restriction or documents you might need to present. So in the case of Colombian coffee if it’s roasted and not decaffeinated, the code would be 0901210000 and because Columbia happens to be in a country group with a preferential tariff, there is no extra duty to pay.

The EU publishes the TARIC code data to its member states and the UK then overlays its own tax rates and restrictions. The application we are building has to integrate the data from TARIC and the UK Customs Handling of Import and Export Freight system (CHIEF), in order to display the correct data for the UK tariff.

The most visible change so far is the user interface. The GDS design team have done an excellent job at simplifying the interactions and trying to make the dense data more user friendly.
UK trade tarrif old screenshot

New Trade Tariff tool

What has been done so far?

  • EU TARIC data schema (see below)
  • Searching by commodity code and description
  • A new user interface
  • Integrated the application within GOV.UK

The technical bit

The new Trade Tariff is comprised up of two applications, an API provider and a web front-end. Both applications are built on Ruby on Rails, using MySQL for the database and ElasticSearch for search.

The source code is now public on Github:

As the schema is complex we are using Sequel to do custom SQL queries, below is a ERD diagram of part of the database schema:


Click to enlarge image

What’s up coming next?

As ever, this first release of the product is a “beta release”. We know there are gaps, which we will address by adding to and improving the data and product features in the coming weeks. For now, please continue to access the existing trade tariff tool for real-world usage. In the next few weeks we’ll be implementing:

  • UK specific measures
  • Daily data updates
  • Chapter notes
  • Improving search with common synonyms for commodities (e.g. searching for “laptop computer” should return the commodity code 8471 30 00 00)

Feedback and user testing

We’re releasing this now because we want to learn how people use the new Trade Tariff tool and make improvements where necessary. We’ll be doing structured user testing using qualitative and quantitative methods, including several sessions with users of the existing trade tariff tool. We’d also love your feedback to help us work out out what needs to be improved. Tell us what you think in the comments or by sending us an email.


  1. Hi Matt, hows it going? Nice work, anything that makes importing/exporting a bit simpler is a good thing in my book. What seems particularly interesting to me about this project is its a government department but the source code is in github and the database schema is on the blog. Wow!

  2. I really like it. One minor comment is that it is easy to think that the tool continues into the top part of the page without much delineation so you see Home All sections Business and you have another link saying View all sections (of the tool itself). I accidentally clicked All sections when I meant View all sections.

  3. How easy is it for administrators to add new items to the tool or change rates of duty? Have they been involved?

    1. Hello Liz,

      Thank you for your feedback, we are aware of the confusion the top level sections and tariff sections poses and we are working on trying to make this less confusing.

      With regards to administrators, most the of the data is controlled either via automated updates from the EU or the UK’ Chief system so there is little human involvement with the tool directly. That being said, we are working with HMRC to ensure the transition to the new tariff tool goes as smoothly as possible and that all the data (rates etc) are kept up to date.

  4. Searching for codes, if I copy and paste 4401 and put it in search it doesn’t work because of the space at the end.

  5. It says to search by commodity code, but it’s possible you would search by heading code if you have been using the guidance. Suggest: name/code

  6. Are you going to introduce the capabilities of the businesslink Tariff such as ‘bookmarking’ commodities, and adding your own notes? Also being able to sign up for alerts? Being able to look at chapter updates? Filtering by country so you don’t have to look at all measures?

    Personalising the Tariff is a key added value function of the current site, as you don’t want to have to keep drilling down/searching each week/month to find out what rates etc are.

    The thing that really needed improving was is the search. You can’t find any results for ipad, sat nav, uggs, knickers etc. This should be made more intuitive.

    The coffee example is quite simple, but try something more complicated like exporting land rovers to the Australian government, or a set of table and chairs from indonesia.

    1. Hello Louise,

      Thank you for your feedback, we are focusing on the search results from next week so hopefully you will see improvements, however named brands not mentioned in the Tariff such as uggs need to be manually added.

      Also some of the features you have mentioned are on our backlog of work for after the launch, such as viewing a result from one country and seeing the updates in a chapter.

      As for classification, its a tricky process and granted coffee beans are quite simple when compared to motor vehicles or other items composed of many things, we do have a guide which should help with the classification process

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s