Inspiration

Buying from Japan is not a "can't find it" problem — it's a broken pipeline. Product pages are in Japanese, prices auto-convert by destination, and the sticker price is a lie (landed cost = item + domestic shipping + forwarding + FX + import duty). A ¥33,000 backpack ends up ~¥400 more than local purchase.

We built an agent that closes the loop and proves autonomous commerce + financial safety can coexist.

What it does

A 6-step Skill pipeline:

  1. Recognize — parse JP product page, translate, back-calculate JPY original, ask shipping destination first
  2. Route — decision tree: Rakuten direct / Amazon JP + forwarding / proxy buyer for used goods
  3. Compare — Rakuten RWS first-party API; Amazon JP page-snapshot (proxy + UA + /-/en/ path)
  4. Calculate — landed cost with FX snapshot, forwarding bands, destination-specific tax (13%/20%/50% tiers, ¥50 exemption, ¥1,000 postal limit). Every line ships with basis + source.
  5. Confirm — Payment Confirmation Sheet (Reviewer gate: agent stops here)
  6. Pay — only after human confirmation: PayPal sandbox Orders create → approve → capture

Honest scope: Japan → mainland China fully verified. Engine is destination-parameterised: us = $800 de minimis, eu = IOSS ≤€150, sg = 9% GST on CIF, other = explicitly unmodelled (never fabricates duty rates).

How we built it

Layer Implementation
Agent SKILL.md — 6-step SOP + Gotchas + prohibited behaviours
Scripts rakuten_search.py, exchange_rate.py, arrival_price.py, paypal_billing.py
Knowledge references/ — channel routing, formula, forwarding rate card
Payments PayPal sandbox OAuth2 + Orders v2 (intent=CAPTURE, JPY)

Challenges

  • Amazon JP anti-bot → proxy + UA + /-/en/ path
  • Currency display by destination → mandatory JPY back-calculation
  • Zero-result honesty → status=unavailable + explicit MOCK markers
  • Payment safety → create ≠ capture, approve is human-only, credentials env-only

Accomplishments

  • PayPal sandbox full closed-loop run 2026-11-09: create-order → CREATED → sandbox buyer approves → APPROVED → capture → COMPLETED (capture_id=8GY16250C6388210U, JPY 16500). Second capture → already_captured=true (idempotent).
  • Live Rakuten API: ¥33,000 identical across 5 stores
  • 14-tier customs duty matrix sourced from official Chinese publications

What we learned

An agent's most valuable output is sometimes "don't buy this here." Users trust uncertainty honesty more than fake best prices.

Built With

Share this project:

Updates

Submission history