GUIDE  ·  11-Minute Read

Customs Duty Calculation Software: Inside a Freight and Landed Cost Engine

Customs duty calculation software is the server-side code that turns a shipment description into a priced quote: chargeable weight, freight, the customs value, import duty read from the goods’ Harmonized System code, import value added tax (VAT) and clearance fees, computed in that order. This guide covers the inputs it needs, the rules that change most often, the failure modes behind wrong quotes, and how the freight and customs engine in Pacifrica Express works.

Pacifrica Express cross-border logistics homepage: Shipping from China made easy, with Send Package and How it works buttons

A forwarder’s margin lives in the quote, and so do its mistakes. Pricing a cross-border shipment is a chain of calculations in a fixed order, each governed by a rule some authority outside the business changes on its own schedule. The proof behind this guide is Pacifrica Express, a China-to-Africa cross-border logistics platform Sigi Technologies built end to end, whose server-side engine computes freight, import duty, import VAT and a clearance fee for 34 destination countries. Scope for work of this shape sits with Sigi’s logistics software practice.

What does customs duty calculation software actually calculate?

Customs duty calculation software reads three kinds of input. Physical facts: the dimensions, weight and count of each package. Commercial facts: goods value, currency, delivery term and insurance. Classification facts: commodity code, country of origin and destination. It returns freight, duty, import tax and fees as separate lines, not one number.

The order is fixed because each step feeds the next: chargeable weight sets the freight, freight enters the customs value in many countries, the customs value sets duty, import VAT is charged on a base that usually includes that duty, and flat charges such as clearance come last. Reorder the steps and the total moves.

  • Landed cost is goods value plus freight, insurance, import duty, import tax and clearance charges; a customs duty calculation is one line inside it, not the whole answer.
  • The World Customs Organization states that the Harmonized System comprises more than 5,000 commodity groups identified by a six-digit code, is used by more than 200 countries and economies, and classifies over 98% of merchandise in international trade.
  • Chargeable weight is the higher of actual and volumetric weight, so a carrier contract’s divisor is a pricing input, not a constant.
  • Duty rates, tax bases and low-value thresholds change without notice, so they belong in effective-dated tables an operations team can edit, never in code.
  • In 2026 both the United States and the European Union removed duty relief for low-value parcels, invalidating the assumption that small consignments clear duty free.

How do you calculate chargeable weight, and why does it set the freight price?

Chargeable weight is the higher of a shipment’s actual weight and its volumetric weight, and it is what the carrier bills. Volumetric weight converts the space a package occupies into a weight. IATA’s guidance on air cargo tariffs gives the general rule as dividing the volume in cubic centimeters by 6,000, and states that whichever is higher, volumetric or actual, is used for pricing. Its own illustration: a metric ton of feathers costs more to fly than a metric ton of steel.

The divisor is not universal. Express services publish their own, and the figure a forwarder applies comes from its carrier contract, not a standard. The Pacifrica Express engine divides by 5,000, the divisor that business uses with its carriers, and the quote page restates the rule under the total so a customer can check it. Treat the divisor as configuration per carrier and service: hard-coding 6,000 against a 5,000 contract understates volumetric weight by about 17% on every bulky parcel.

How do you calculate customs duty and import VAT?

What counts as the customs value

The customs value is what the destination applies its duty rate to. The WTO Agreement on Customs Valuation makes the transaction value the primary basis, the actual price of the goods to be valued, generally shown on the invoice, with five further methods applied in sequence when it cannot be used. What the destination adds to that price is a national decision: some assess duty on the goods alone, others on goods plus freight and insurance. So the engine needs a per-country flag for whether freight and insurance enter the base; one global formula will be wrong somewhere on the list.

Duty, then tax, in that order

Most duty is ad valorem: a percentage of the customs value, read from the destination’s tariff against the goods’ commodity code. Some lines are specific instead, charged per unit, kilogram or liter, and some combine both, so a schema holding only a percentage cannot express them. Import VAT or goods and services tax is charged on a base that in most systems already includes the duty, so it runs after duty, not beside it. The UK Trade Tariff publishes whether there is duty or VAT to pay against the same commodity code. That is the shape the engine wants: one lookup, two rates.

What does an HS code do in the engine, and who owns the classification?

An HS code is a commodity code from the Harmonized System, the World Customs Organization’s classification of traded goods. The WCO states that it comprises more than 5,000 commodity groups, each identified by a six digit code, is used by more than 200 countries and economies as a basis for their customs tariffs, and classifies over 98% of the merchandise in international trade. Those six digits are the shared part. Countries extend them to eight or ten digits for their own tariff lines, and the rate lives on the national line.

That shapes the data model. Store the six-digit code as the item’s classification, then resolve the national code and rate per destination. A single duty-rate column on a product row goes wrong the first time that product ships to a second country. Providers reflect the same structure: Zonos documents landed cost coverage for over 200 countries and territories using up to 10-digit HS codes.

Classification is a declaration, and the importer or its agent answers for it. The engine should hold the code, show which one a quote used and record who chose it, not guess silently. Keep any suggested classification editable and audited: an operations team can defend a code it can see.

Which rules change most often, and how do you keep rates current?

Every number in the engine has an outside owner. Two changes in 2026 removed an assumption much cross-border software was built on: that small parcels clear duty free.

  • United States. US Customs and Border Protection stated on 24 June 2026 that its regulations indefinitely suspend duty-free de minimis treatment for low-value imports valued at $800 or less, following the executive order effective 29 August 2025.
  • European Union. European Commission guidance published 8 June 2026 sets a EUR 3 temporary customs duty on consignments valued up to EUR 150, from 1 July 2026 until 1 July 2028 under Council Regulation (EU) 2026/382, after which normal tariffs apply. It applies per item, by tariff classification, so five T-shirts attract EUR 3 and one T-shirt plus one watch attracts EUR 6.
  • Import VAT moved separately. The Commission’s rules for low value consignments abolished the VAT exemption for goods below EUR 22 on 1 July 2021, require an import declaration whatever the value, and added the Import One Stop Shop for collecting VAT on consignments not exceeding EUR 150.

Those figures will date again. The lesson is that thresholds, rates and start dates belong in effective-dated tables behind an admin screen, so a change is a data edit made by whoever read the notice, on the day it takes effect. A rate table with no valid-from date cannot reprice yesterday’s order or explain last month’s invoice. Store the rate version on every quote too. Every rate above is as published on the date given and changes without notice: the destination’s tariff service is the authority, and a customs broker advises on a specific consignment.

Who pays the duty, and how does the delivery term change the checkout?

Incoterms are the International Chamber of Commerce rules that allocate cost, risk and obligation between seller and buyer, and the 2020 edition has 11 rules. For a duty engine the split that matters is DAP against DDP. The ICC Academy puts it plainly: under DAP the buyer is responsible for carrying out and paying for import clearance, while with DDP the seller assumes that responsibility.

In software that is the difference between quoting a landed cost and collecting one. Under DDP the platform charges duty and tax at checkout and pays the customs bill, so a wrong estimate is the seller’s loss. Under DAP the estimate is guidance and the carrier bills the receiver on arrival, a common source of refused deliveries. The same note warns that some authorities require a local importer to clear the goods, so DDP is not always available. Pacifrica takes the honest route: the order summary itemizes freight, import duties, import VAT, clearance fee and insurance, and calls instant quotes estimates that exclude the goods and the supplier’s delivery to the warehouse. Consolidation then changes the measured weight again, as on the Shipping Hack parcel forwarding platform.

Where do freight and customs engines go wrong?

These failure modes appear in production, not in a specification. Each is cheap to design out and expensive to retrofit.

  • Weight measured twice. Declared and warehouse-measured dimensions rarely match. Quote from the declaration, invoice from the measurement, and give operations a manual adjustment for what automation cannot anticipate, such as a repack that changes billable weight.
  • Pricing in the browser. A client-side calculator is a price the client can edit. Compute server-side and treat the on-screen number as a display of the server’s answer.
  • Cached reference data with no invalidation path. Caching tariff tables is right; with no way to clear a changed row, an edit reaches customers only when the cache expires.
  • Floating-point money and a single exchange rate. Tax is a percentage of a base containing a percentage, and goods, freight and duty can sit in three currencies. Use integer minor units or a decimal type, set the rounding rule per line once, and record which rate was used and when.
  • Shipment-level freight on a multi-item consignment. Several products mean several duty rates, so allocating freight by value, weight or volume is a choice that changes each item’s customs value.
  • Silent zeros. When a destination, code or rate is missing, an engine that returns zero duty is worse than one that refuses to quote and says why.

Should you build a landed cost engine or buy one?

Buy when the calculation is the whole requirement and the catalog is large and general. Commercial landed cost APIs classify products, hold tariff data for most of the world and maintain it. Zonos publishes coverage of over 200 countries and territories and a commercial guarantee that if customs charges more than it calculated, it pays the difference. That guarantee is the real product: a small team cannot self-insure a wrong duty rate.

Build when the calculation is not the product but a step inside it. A forwarder’s price is its own negotiated freight table, its own service options and its own clearance fee, over a fixed destination list. For Pacifrica Express and its 34 countries, a rate table the operations team maintains is cheaper and more accurate than a general classification service. The practical middle is to build the pipeline yourself and source duty rates from a provider or the national tariff. If one engine serves several forwarders, those tables become tenant-scoped data, the subject of multi-tenant SaaS architecture.

What does it cost, and in what order should you build it?

As a planning estimate, a quoting and booking portal with payments, documents and a light admin sits in the $80k to $180k band. A multi-surface platform with an operations panel and live tracking runs $150k to $350k and above, matching Sigi’s guide to how much it costs to build a mobile app. Those are typical-scope figures, not a quote and not a number attached to any named client.

  1. Model the shipment before the price. One record holds packages, declared and measured dimensions, items with commodity codes and values, origin, destination and delivery term.
  2. Build the reference tables next, each with effective dates and an admin screen: freight by country and service, duty by code and destination, tax rates and bases, thresholds, clearance and handling fees.
  3. Write the pricing pipeline as small, pure functions in the fixed order, returning itemized lines rather than one total, so each step can be tested alone.
  4. Add the quote record, storing the inputs, the rate versions and every line, so any quote can be re-run and explained months later.
  5. Attach the surfaces last: customer calculator, operations override, customs documentation and payment. The commercial invoice, waybill and declaration restate the same priced lines, so generate them from the quote record rather than re-keying. Pacifrica emails a PDF waybill at order placement and takes payment only after the warehouse confirms weights.
  6. Test with a fixture per destination, including the awkward ones: a zero-rate code, a specific-duty line, consignments just under and just over a threshold, and a repack that changes billable weight.

Time at the border is money. The World Bank reports a 21% reduction in trade times and $108.7 million in private-sector cost savings from its Trade Facilitation Support Program. In the Journal of African Economies in 2025, de Melo, Sorgho and Wagner estimate that WTO Trade Facilitation Agreement measures could cut time in customs by 3.7 days for imports and 1.9 for exports, tariff equivalents of 3.5% to 7% on imports. Correct paperwork is the part a private operator controls.

Related reading

The full write-up of this engine is the Pacifrica Express cross-border logistics case study; the multi-warehouse side of forwarding is the Shipping Hack parcel forwarding case study. For the status layer beside pricing, see real-time tracking architecture and how to build a delivery app. For the stock a shipment moves through, see how to build a warehouse management system. To scope a duties engine of your own, start with Sigi’s logistics software services or custom software development.

Questions this guide answers

Customs duty calculation software is the server-side code that turns a shipment description into a priced quote. It takes package dimensions and weight, goods value, commodity code and destination, then returns chargeable weight, freight, import duty, import tax and clearance fees as separate lines. It is usually one part of a wider cross-border shipping platform rather than a standalone tool.

Landed cost is goods value plus freight, insurance, import duty, import tax and clearance charges. The calculation runs in order: chargeable weight sets freight, freight may enter the customs value depending on the destination, the customs value sets duty, and import VAT is charged on a base that usually includes the duty. Fixed fees are added last.

Chargeable weight is the higher of actual weight and volumetric weight. IATA gives the general air cargo rule as dividing the shipment volume in cubic centimeters by 6,000, and says the higher of the two figures is used for pricing. Express carriers publish their own divisors, so the number belongs in a carrier configuration table rather than in code.

Not in the United States or the European Union. US Customs and Border Protection says its regulations indefinitely suspend duty-free de minimis treatment for imports valued at $800 or less. The European Commission has set a temporary EUR 3 customs duty per item on consignments up to EUR 150 from 1 July 2026 to 1 July 2028. Thresholds elsewhere still vary and change.

It depends on the Incoterms rule in the contract. The ICC Academy states that under DAP the buyer carries out and pays for import clearance, while under DDP the seller assumes that responsibility. DDP means a platform must collect duty and tax at checkout and absorb any shortfall. DAP means the carrier bills the receiver on arrival.

Yes. Sigi Technologies built Pacifrica Express, a China-to-Africa cross-border logistics platform on ReactJS, Node.js, Express, MySQL and Redis with Paystack and PayPal payments. Its server-side engine derives billable weight, per-country freight, HS-code duty, import VAT and a clearance fee for 34 destination countries, with rates and codes held in admin-editable tables.