Ecommerce Website Developer

JournalAbout 2 min read

Tax and delivery rules are not an edge case

They are where most ecommerce builds accumulate their worst complexity, and they are usually gathered far too late.

Written by

Nazir AbbasApproved contributor

Contributed by

Javed IqbalApproved contributor

Published

Abstract measured panel in the brand colours

Key takeaways

  • Gather the real rules, including exceptions, before development starts
  • Mixed baskets are where simple rules collapse; decide the behaviour explicitly
  • Zero rated and exempt behave differently in the accounts even if both show no tax
  • Delivery by dimension or weight is a catalogue data problem as much as a checkout one
  • Build the test cases from the exceptions, not the happy path
  • Get tax treatment confirmed in writing by whoever does the accounts

On a typical build, the catalogue takes the time everyone expected and the checkout takes the time nobody did. The reason is almost always tax and delivery.

These rules are treated as configuration, discovered in week six, and retrofitted badly.

Gather the real rules, including the exceptions

Ask the business these questions before development starts, and write the answers down:

  • Which products have a different tax treatment, and why
  • Whether you sell to customers outside the UK, and what changes if you do
  • Whether trade customers are priced or taxed differently
  • Which products cannot be delivered to certain areas
  • What happens when a basket mixes products with different delivery rules
  • Whether delivery is priced by weight, size, value, or something else entirely

The last two are where the complexity hides.

Mixed baskets are the hard part

A basket containing a small item and a large item, or a deliverable item and a collect-only item, is where simple rules collapse.

Decide explicitly:

  1. Does the basket split into multiple deliveries, with multiple charges?
  2. Does the most restrictive rule apply to the whole basket?
  3. Can the customer choose, and if so what do they see?

Each answer is defensible. What is not defensible is discovering in production that nobody chose.

Zero rated is not the same as exempt

This catches people out regularly. A zero rated product and an exempt product behave differently in the accounts even though both show no tax at checkout. If your catalogue contains both, the distinction has to exist in the product data, not just in the display.

Get this confirmed by whoever does the accounts, in writing, rather than inferring it from the current site.

Delivery rules that depend on the product

If delivery cost depends on product dimensions, weight or handling class, then every product needs those attributes populated correctly, and somebody has to maintain them.

That is a catalogue data problem as much as a checkout problem, and it is worth surfacing early. A delivery engine with perfect logic and incomplete product data produces confidently wrong prices.

Test the exceptions, not the happy path

The straightforward basket will work. Build the test cases from the exceptions:

  • A basket mixing tax treatments
  • Delivery to an excluded postcode
  • A trade customer with a contract price
  • An order that qualifies for free delivery by one penny, and one that misses it by one penny

Those four find most of the bugs.

Frequently asked

Questions readers ask

Why do checkout rules take longer to build than expected?

Because tax and delivery are treated as configuration and discovered in week six. Mixed baskets, product-specific delivery restrictions and customer-specific pricing are rarely in the original brief but are usually in the business.

How should a mixed basket handle different delivery rules?

Decide explicitly whether the basket splits into multiple deliveries with multiple charges, whether the most restrictive rule applies to everything, or whether the customer chooses. Each is defensible. Not choosing is not.

What is the difference between zero rated and exempt?

Both show no tax at checkout but behave differently in the accounts. If your catalogue contains both, the distinction must exist in the product data rather than only in the display, and should be confirmed in writing by whoever does your accounts.

About the authors

Nazir Abbas

Written by

Nazir AbbasApproved contributor

Web Developer & Co-Founder

Builds and maintains ecommerce sites in React, Next.js and WordPress, and handles the technical side of search.

Javed Iqbal

Contributed by

Javed IqbalApproved contributor

SEO Specialist & Co-Founder

Leads search, with more than five years in ecommerce and technical SEO for businesses in the UK, the US and the UAE.

Editorial process: every article is written by one of the two co-founders and reviewed by the other before publication. Technical claims are checked against how the systems actually behave, and anything we cannot evidence is left out rather than asserted.

Related reading