https://gds.blog.gov.uk/2012/08/10/the-all-new-trade-tariff-tool/

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:
https://github.com/alphagov/trade-tariff-backend
https://github.com/alphagov/trade-tariff-frontend

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:

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.

15 comments

  1. Damon Rand

    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!

    Reply
  2. LizH

    I really like it. One minor comment is that it is easy to think that the tool continues into the top part of the gov.uk 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.

    Reply
  3. LizH

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

    Reply
    • Matthew Ford

      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.

      Reply
  4. LizH

    No way back to top page of the tool from within the tool…

    Reply
  5. LizH

    I did a search on the TTT for ‘video’ and it came back with a lot of repeated results.
    https://www.gov.uk/trade-tariff/search?utf8=%E2%9C%93&search%5Bq%5D=video&search%5Bas_of%5D=2012-06-05&button= … 28 is repeated about six times.

    Reply
  6. LizH

    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.

    Reply
  7. LizH

    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

    Reply
  8. Louise

    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.

    Reply
    • Matthew Ford

      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 https://www.gov.uk/classification-of-goods

      Reply
  9. Iterating the trade tariff tool with HMRC | Government Digital Service

    [...] One of the tools we’ve created on GOV.UK is the Trade Tariff tool. It contains up-to-date and historical information on the duty you have to pay when importing and exporting goods outside the UK and the EU. The tool lets people find what the codes are and duty rates for their goods, and you can read more about how it works in this blog post by Matt. [...]

    Reply
  10. HMRC moving to GOV.UK | HMRC transition to GOV.UK

    […] of the work to shutdown Businesslink and Directgov prior to launch of GOV.UK in October 2012. A new trade tariff tool was also built on GOV.Uk to replace the old Businesslink […]

    Reply

Leave a comment