Inspiration

In August 2025 the US stopped letting low-value parcels in duty-free. Now almost every cross-border order owes import duty, yet most checkouts still show only the item price and shipping. The duty turns up later as a surprise bill, or the seller absorbs it.

Sellers feel it too. One major marketplace's main shipping program for sellers in Japan now ships US orders under $2,500 duty-paid by default, but leaves sellers to work out the duty themselves. I'm planning a small export business from Japan myself, so this was a problem I wanted solved.

What it does

Landed adds duty-aware, delivered-duty-paid (DDP) checkout to PayPal, in four parts:

  • Checkout with duty shown up front. Every quote shows goods + shipping + US import duty before the PayPal button, with the official tariff line and the government text behind each dollar. PayPal authorizes the exact amount. A code-only policy then checks the approval, the amount, spend caps, quote age and rate version, and only then does Landed capture the payment; otherwise it voids it. Sellers can also send a PayPal invoice with the duty as its own line.
  • An AI shopping agent that can't spend your money. Tell it what you want and your delivered budget. It searches, compares by delivered price, and proposes the best option. In the demo the cheapest sticker price (China) isn't the cheapest delivered (Germany). It has no tool to approve or pay; you do that. It can also read an order's status through PayPal's Agent Toolkit, read-only, seeing only the status and amounts, never the payer's details. Listings that try to give the AI instructions are withheld.
  • Estimate mode for any product. Describe any product in any language, plus where it was made and the price. The AI picks likely lines from the official US tariff schedule (19,926 lines). Code computes the duty from official data, using a human-verified rate first where one exists. When the product needs a fact (for example, "is the steel at least 15% of the weight?"), it asks. When it can't be sure, it refuses and explains why instead of guessing.
  • A seller console built on AG Grid. Uncertain classifications wait in a review queue for a human. Every order sits in a ledger with its duty, tariff line and the exact rate version it was quoted under, with filters, a captured-duty total and CSV export. A read-only demo is public so judges can explore it.

The rule throughout: the AI proposes, code decides, a human approves every payment.

How we built it

  • Stack: Next.js (App Router, TypeScript), PostgreSQL with Drizzle, hosted on Render.
  • PayPal: Orders v2 with intent AUTHORIZE, then policy-gated capture or void; Invoicing v2 for DDP invoices; webhooks; and the PayPal Agent Toolkit (read-only get_order, with an allow-list so no payer data reaches the model).
  • AI: Claude via the Vercel AI SDK, for classification, the shopping agent's reasoning and drafting tariff rules. Every AI output is checked by code: quotes must appear in the official text, codes must exist in the schedule, and amounts are never taken from the model.
  • Data: the official HTS 2026 Rev. 21 schedule and Chapter 99 notes, imported and version-pinned. 13 products have rates I verified by hand against primary sources, and golden tests reproduce every verified duty to the cent.
  • AG Grid Community for the review queue and the order ledger.
  • Quality: 1,000+ unit tests, Playwright end-to-end tests with accessibility checks, a secret scanner on every push, and a classifier eval: on 11 verified products, 0 of 33 answers were wrong and auto-accepted.
  • Built with Claude Code as my pair programmer, with me reviewing every plan and change.

For a Japanese-origin watch, the duty is the higher of the standard (MFN) rate and the 12.5% combined rate:

$$\text{duty} = \max\big(\text{MFN},\; 0.125 \times v\big)$$

For the $300 watch: MFN = $16.93, 12.5% × $300 = $37.50, so the duty is $37.50. Code computes this from the official text; the AI never supplies a number.

Challenges we ran into

  • Tariffs changed four times in about 14 months. Rates had to be versioned, every order had to keep the version it was quoted under, and the app needed to refuse rather than use stale rules.
  • Some rules can't be applied safely by a model. A build gate checks every AI-drafted rule against the official text. It caught one AI-drafted exemption that would have undercharged.
  • Being honest when the product is ambiguous. An early version could show a confident figure from a 1%-likely line while the likely lines couldn't be estimated. Now the headline only shows a figure when it covers every likely line, and anything less likely is disclosed.
  • PayPal has no "duty" field, so the duty travels in the tax field, and the app labels it clearly as US import duty everywhere it shows.
  • A new tariff revision days before submission. When HTS Revision 22 took effect on Oct 30, I compared it against Rev. 21 line by line: nothing Landed uses changed.

Accomplishments that we're proud of

  • A real authorize → policy check → capture-or-void flow, with an AI agent that has no way to pay.
  • Estimate mode that works for any product, yet says "can't estimate" rather than guessing.
  • Every duty figure traceable to official text, with a rate version on every order.

What we learned

Getting an answer from the model was easy. Knowing when that answer was safe to use was the real work. Letting the model propose and the code verify ended up safer, and simpler to build.

What's next

  • More countries of origin (all EU member states, Switzerland, Korea).
  • Seller-confirmed web research that fills in product facts from a model name.
  • Seller tools that show the full landed cost per item before listing.

Built With

Share this project:

Updates

Submission history