Exytab.CustomsLens
0.1.0
dotnet add package Exytab.CustomsLens --version 0.1.0
NuGet\Install-Package Exytab.CustomsLens -Version 0.1.0
<PackageReference Include="Exytab.CustomsLens" Version="0.1.0" />
<PackageVersion Include="Exytab.CustomsLens" Version="0.1.0" />
<PackageReference Include="Exytab.CustomsLens" />
paket add Exytab.CustomsLens --version 0.1.0
#r "nuget: Exytab.CustomsLens, 0.1.0"
#:package Exytab.CustomsLens@0.1.0
#addin nuget:?package=Exytab.CustomsLens&version=0.1.0
#tool nuget:?package=Exytab.CustomsLens&version=0.1.0
CustomsLens
Offline .NET library that determines whether a shipment requires customs clearance — including intra-country cases where both addresses share the same country code but belong to different customs territories.
The problem
Most shipping logic treats countryFrom == countryTo as "domestic, no customs needed." But that's wrong for dozens of real-world routes:
| From | To | Same country? | Customs needed? |
|---|---|---|---|
| New York, US | Guam, US | ✅ | ✅ |
| London, GB | Belfast, GB | ✅ | ✅ |
| Madrid, ES | Tenerife, ES | ✅ | ✅ |
| Milan, IT | Livigno, IT | ✅ | ✅ |
| Hamburg, DE | Heligoland, DE | ✅ | ✅ |
CustomsLens knows about these territories and resolves them by state code or postal/ZIP prefix.
Install
dotnet add package Exytab.CustomsLens
Usage
using CustomsLens;
var from = new ShippingAddress
{
CountryCode = "US",
StateCode = "NY",
PostalCode = "10001"
};
var to = new ShippingAddress
{
CountryCode = "US",
StateCode = "GU",
PostalCode = "96910"
};
var result = CustomsTerritoryResolver.Evaluate(from, to);
result.RequiresCustoms // true
result.Reason // IntraCountryCustomsTerritory
result.Description // "Intra-country customs required: US mainland → Guam. ..."
Northern Ireland (resolved by postal prefix)
var from = new ShippingAddress { CountryCode = "GB", PostalCode = "SW1A 1AA" };
var to = new ShippingAddress { CountryCode = "GB", PostalCode = "BT1 5GS" };
var result = CustomsTerritoryResolver.Evaluate(from, to);
// RequiresCustoms: true — Windsor Framework applies
Query available zones
var zones = CustomsTerritoryResolver.GetCustomsZones("ES");
// Canary Islands, Ceuta, Melilla
var countries = CustomsTerritoryResolver.GetCountriesWithIntraCustoms();
// US, GB, ES, IT, DE, NO, FI, GR, PT, AU
Covered territories
| Country | Zones |
|---|---|
| 🇺🇸 US | American Samoa, Guam, U.S. Virgin Islands, Northern Mariana Islands |
| 🇬🇧 GB | Northern Ireland |
| 🇪🇸 ES | Canary Islands, Ceuta, Melilla |
| 🇮🇹 IT | Livigno, Campione d'Italia |
| 🇩🇪 DE | Heligoland, Büsingen am Hochrhein |
| 🇳🇴 NO | Svalbard |
| 🇫🇮 FI | Åland Islands |
| 🇬🇷 GR | Mount Athos |
| 🇵🇹 PT | Azores, Madeira |
| 🇦🇺 AU | Norfolk Island |
Note: Territories with their own ISO country code (HK, MO, FO, GL, GI, etc.) are already handled as international shipments by the
countryFrom != countryTocheck. CustomsLens focuses on the tricky cases where the country code is the same.
How it works
- Different country codes →
InternationalShipment(always requires customs) - Same country code → looks up the address against known customs zones by:
- State/province code (e.g.
GU,VI,AS,MP) - Postal/ZIP prefix (e.g.
BTfor Northern Ireland,35/38for Canary Islands)
- State/province code (e.g.
- Both in mainland →
DomesticShipment(no customs) - Both in the same zone →
SameCustomsZone(no customs) - One in a zone, other in mainland (or different zone) →
IntraCountryCustomsTerritory(customs required)
Carrier-agnostic
CustomsLens is not tied to any specific carrier. Use it as a pre-validation step before calling FedEx, UPS, DHL, or any other shipping API.
Contributing
Found a missing territory? PRs welcome! The zone data lives in CustomsTerritoryResolver.Data.cs in the Zones dictionary.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 318 | 3/17/2026 |