Customs Duty API

REST API for import duty rates, HS code classification, landed cost calculation, and FTA savings. One API call returns duty + VAT + anti-dumping + documents for any product into any country.

26
Endpoints
523K+
Tariff codes
60+
FTAs
550K+
Pref. rates
Get API Key →   View Docs

Landed Cost

Duty + VAT/GST + anti-dumping + social welfare surcharge. Handles Brazil's 5-tax sequential stack and India's BCD+SWS+IGST+exemptions.

HS Classification

Describe your product in plain English. AI returns the correct HS code with confidence score. Cache-first, vector-search, Claude fallback.

FTA Savings

60+ trade agreements. Automatically finds preferential rates for your origin-destination pair. Shows the agreement name and saving amount.

Sanctions Check

Every tariff lookup checks SANCTIONS_MEASURE first. Blocked routes return immediately with a clear warning. Never cached.

Pricing

Simple, transparent pricing. No per-transaction fees. No annual contracts.

Free
£0
50 lookups/mo
2 countries
Pro
£14/mo
500 lookups/mo
All 51 countries
Business
£39/mo
2,000 lookups/mo
FTA savings + alerts
Enterprise
£99/mo
Unlimited
ERP integration + API

Quick Start

Get your API key by signing up at customs-compliance.ai/app, then start making requests:

cURL
Python
JavaScript
# Get landed cost for importing smartphones (HS 8517) from China to India
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/tariff-lookup \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "commodity_code": "85171400",
    "import_country": "IN",
    "export_country": "CN",
    "customs_value": 10000,
    "currency": "USD"
  }'

Authentication

All requests require an API key in the X-API-Key header:

X-API-Key: ci_live_your_key_here

Get your key by signing up at customs-compliance.ai/app. Free accounts get 50 lookups per month.

Endpoints (26)

Core APIs

classify

POST/functions/v1/classify

Auth: API key or JWT

ParameterSource
confirm_codebody / query
descriptionbody / query
documentbody / query
import_countrybody / query
cURL
Python
JavaScript
# classify
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/classify \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Frozen potato chips, pre-cooked, in 25kg bags",
    "country": "IN"
  }'

enrich-po

Enriches Purchase Orders / Sales Orders with full customs intelligence. For each line item: classify HS code → calculate landed cost → list documents → flag savings.

POST/functions/v1/enrich-po

Auth: API key or JWT

ParameterSource
container_typebody / query
currencybody / query
dest_portbody / query
erp_sourcebody / query
export_countrybody / query
freightbody / query
goods_categorybody / query
import_countrybody / query
incotermbody / query
inland_destbody / query
inland_originbody / query
insurancebody / query
linesbody / query
origin_portbody / query
transport_modebody / query
volume_cbmbody / query
weight_kgbody / query
cURL
Python
JavaScript
# enrich-po
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/enrich-po \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "import_country": "GB",
    "export_country": "CN",
    "currency": "USD",
    "lines": [
      {
        "line_id": "1",
        "description": "Steel bolts M8",
        "total_value": 750
      }
    ]
  }'

tariff-lookup

customs_value is now optional: - Omit for rates-only response (duty %, VAT %, total border rate %) - Include for full calculation with currency amounts

POST/functions/v1/tariff-lookup

Auth: API key or JWT

ParameterSource
commodity_codebody / query
container_typebody / query
currencybody / query
customs_valuebody / query
dest_portbody / query
export_countrybody / query
freightbody / query
goods_categorybody / query
import_countrybody / query
incotermbody / query
inland_destbody / query
inland_originbody / query
insurancebody / query
origin_portbody / query
transport_modebody / query
volume_cbmbody / query
weight_kgbody / query
cURL
Python
JavaScript
# tariff-lookup
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/tariff-lookup \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "commodity_code": "85171400",
    "import_country": "IN",
    "export_country": "CN",
    "customs_value": 10000,
    "currency": "USD"
  }'

Intelligence

alerts

GET POST/functions/v1/alerts

Auth: API key or JWT

Actions: actioned, dismiss, dismiss_all, generate

ParameterSource
alert_idbody / query
alert_idsbody / query
limitbody / query
severitybody / query
typebody / query
cURL
Python
JavaScript
# alerts
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/alerts \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "actioned"
  }'

enrich-opportunities

Processes OPPORTUNITIES rows where AIInsight IS NULL. Calls Claude to generate a 2-3 sentence contextual insight per card. Cost: ~£0.002 per card.

POST/functions/v1/enrich-opportunities

Auth: API key or JWT

ParameterSource
batch_sizebody / query
cURL
Python
JavaScript
# enrich-opportunities
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/enrich-opportunities \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "batch_size": "..."
  }'

opportunities

GET POST/functions/v1/opportunities

Auth: API key or JWT

Actions: action, dismiss, dismiss_all, generate, log_behaviour

ParameterSource
action_typebody / query
export_countrybody / query
import_countrybody / query
limitbody / query
metadatabody / query
min_savingbody / query
opportunity_idbody / query
opportunity_idsbody / query
reference_idbody / query
subheading_codebody / query
typebody / query
cURL
Python
JavaScript
# opportunities
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/opportunities \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "action"
  }'

Integrations

acumatica-connect

Acumatica ERP OAuth2 integration.

POST/functions/v1/acumatica-connect

Auth: API key or JWT

Actions: auth, callback, connect_credentials, connect_ropc, disconnect, refresh, status

ParameterSource
client_idbody / query
client_secretbody / query
codebody / query
company_namebody / query
instance_urlbody / query
passwordbody / query
statebody / query
usernamebody / query
cURL
Python
JavaScript
# acumatica-connect
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/acumatica-connect \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "auth"
  }'

acumatica-sync

Pulls Purchase Orders + Sales Orders from Acumatica, aggregates trade insights (top suppliers, customers, products, countries), converts to USD.

POST/functions/v1/acumatica-sync

Auth: API key or JWT

Actions: get_po, list_pos, write_back

ParameterSource
currencybody / query
documentsbody / query
fullbody / query
limitbody / query
linesbody / query
order_nbrbody / query
order_typebody / query
savingsbody / query
statusbody / query
cURL
Python
JavaScript
# acumatica-sync
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/acumatica-sync \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "get_po"
  }'

email-connect

Gmail + Outlook OAuth2 connection.

GET POST/functions/v1/email-connect

Auth: API key or JWT

Actions: accept_extract, auth_gmail, auth_outlook, callback_gmail, callback_outlook, disconnect, list_extracts, reject_extract, status

ParameterSource
codebody / query
extract_idbody / query
platformbody / query
cURL
Python
JavaScript
# email-connect
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/email-connect \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "accept_extract"
  }'

email-sync

Reads trade-related emails from Gmail or Outlook, extracts structured context using Claude, stores in EMAIL_CONTEXT_EXTRACT. PRIVACY: Raw email body is NEVER stored — only structured extracts.

POST/functions/v1/email-sync

Auth: API key or JWT

ParameterSource
databody / query
daysbody / query
platformbody / query
substringbody / query
cURL
Python
JavaScript
# email-sync
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/email-sync \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "data": "...",
    "days": "...",
    "platform": "..."
  }'

xero-connect

Xero OAuth2 integration — handles both the auth redirect and callback.

GET POST/functions/v1/xero-connect

Auth: API key or JWT

Actions: auth, disconnect, refresh, status

ParameterSource
api_keybody / query
jwtbody / query
cURL
Python
JavaScript
# xero-connect
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/xero-connect \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "auth"
  }'

xero-sync

Pulls purchase invoices (ACCPAY) from Xero, extracts line items, classifies products via /classify, and maps supplier countries.

POST/functions/v1/xero-sync

Auth: API key or JWT

Actions: get_bill, list_bills, write_back

ParameterSource
currencybody / query
documentsbody / query
fullbody / query
invoice_idbody / query
limitbody / query
linesbody / query
order_nbrbody / query
sincebody / query
statusbody / query
cURL
Python
JavaScript
# xero-sync
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/xero-sync \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "get_bill"
  }'

Admin

admin

Admin-only endpoint for tenant management, usage stats, and KPIs. Requires is_admin=true in user metadata.

POST/functions/v1/admin

Auth: JWT (admin)

Actions: active_promotions, analytics, billing_dashboard, classify_erp_items, click_promotion, country_intelligence, cron_status, dashboard, data_browse, data_completeness, data_freshness, delete_user, dismiss_promotion, engagement, invite_user, list_promotions, manage_api_key, notifications, override_plan, referrals, reset_password, reward_config, run_monitor, send_promotion, set_admin, suggestions, tenants, update_notification, update_suggestion, usage, user_detail

ParameterSource
active_onlybody / query
admin_responsebody / query
checkbody / query
columnsbody / query
company_namebody / query
countrybody / query
daysbody / query
delivery_idbody / query
delivery_methodbody / query
discount_percentbody / query
emailbody / query
generate_api_keybody / query
is_adminbody / query
limitbody / query
messagebody / query
notesbody / query
notification_idbody / query
offsetbody / query
operationbody / query
order_colbody / query
order_dirbody / query
planbody / query
reasonbody / query
statusbody / query
suggestion_idbody / query
tablebody / query
target_segmentbody / query
target_user_idsbody / query
tenant_idbody / query
titlebody / query
updatesbody / query
user_idbody / query
cURL
Python
JavaScript
# admin
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/admin \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "active_promotions"
  }'

data-maintenance

Data maintenance workflow: country overview, sourcing instructions, file upload with diff-preview, approve/reject, spot checks, and feedback.

GET POST/functions/v1/data-maintenance

Auth: JWT (admin or data_maintainer)

Actions: approve, dashboard, get_instructions, list_feedback, list_issues, list_uploads, my_reports, parse_preview, reject, resolve_issue, spot_check, submit_feedback, submit_spot_check, update_instructions, upload

ParameterSource
categorybody / query
commoditycodebody / query
country_codebody / query
countrycodebody / query
descriptionbody / query
document_ratebody / query
document_typebody / query
feedback_idbody / query
filebody / query
instructionbody / query
is_matchbody / query
notesbody / query
pagebody / query
page_sizebody / query
resolutionbody / query
resolution_notesbody / query
review_notesbody / query
source_typebody / query
suggested_fixbody / query
suggestion_idbody / query
system_ratebody / query
upload_idbody / query
cURL
Python
JavaScript
# data-maintenance
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/data-maintenance \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "approve"
  }'

tariff-docs

Admin-only document management for tariff files.

POST/functions/v1/tariff-docs

Auth: JWT (admin)

Actions: delete, download, list, list_all, parse, suggest_metadata

ParameterSource
country_codebody / query
document_idbody / query
document_typebody / query
effective_datebody / query
filebody / query
file_namebody / query
hs_chapterbody / query
notesbody / query
source_urlbody / query
text_previewbody / query
titlebody / query
cURL
Python
JavaScript
# tariff-docs
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/tariff-docs \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "delete"
  }'

upload-tariff

Admin endpoint: upload a customs tariff document (PDF/Excel/CSV) for a country. The document is parsed using Claude to extract commodity codes, MFN rates, and VAT rates, then written to the DB.

POST/functions/v1/upload-tariff

Auth: JWT (admin)

ParameterSource
country_codebody / query
document_typebody / query
filebody / query
notesbody / query
cURL
Python
JavaScript
# upload-tariff
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/upload-tariff \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "country_code": "...",
    "document_type": "...",
    "file": "..."
  }'

Auth & Billing

auth

Tenant authentication and provisioning.

POST/functions/v1/auth

Auth: None (public, actions: signup/login) or JWT (actions: me/api_key)

Actions: api_key, login, logout, me, refresh, reset_password, search_hs, signup, update_password

ParameterSource
access_tokenbody / query
company_namebody / query
countrybody / query
emailbody / query
new_passwordbody / query
passwordbody / query
querybody / query
redirect_tobody / query
referral_codebody / query
refresh_tokenbody / query
regeneratebody / query
cURL
Python
JavaScript
# auth
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/auth \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "api_key"
  }'

billing

Handles Stripe subscription billing: POST { "action": "checkout", "plan": "PRO" } — create Stripe Checkout session POST { "action": "portal" } — create Stripe Customer Portal session POST { "action": "status" } — get current subscription status + usage POST { "action": "webhook" } — Stripe webhook handler (no auth) POST { "action": "increment_lookup" } — atomic usage counter increment POST { "action": "increment_classify" } — atomic usage counter increment

POST/functions/v1/billing

Auth: API key or JWT (webhook action is unauthenticated)

Actions: checkout, increment_classify, increment_lookup, portal, status

ParameterSource
annualbody / query
planbody / query
cURL
Python
JavaScript
# billing
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/billing \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "checkout"
  }'

Other

agent-control

Agent control panel — manage AI agents, schedules, runs, and feedback.

POST/functions/v1/agent-control

Auth: JWT (admin)

Actions: approve_actions, auto_schedule, cancel_run, daily_summary, dashboard, get_agent, get_run, list_guidance, list_runs, run_now, schedule, submit_feedback, submit_guidance, toggle_agent

ParameterSource
agent_idbody / query
approved_actionsbody / query
cron_expressionbody / query
feedback_textbody / query
guidancebody / query
is_enabledbody / query
limitbody / query
offsetbody / query
ratingbody / query
rejected_actionsbody / query
run_idbody / query
schedule_idbody / query
schedule_typebody / query
scheduled_forbody / query
scheduled_timebody / query
statusbody / query
cURL
Python
JavaScript
# agent-control
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/agent-control \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "approve_actions"
  }'

engage

User-facing engagement: referrals, suggestions, rewards.

POST/functions/v1/engage

Auth: API key or JWT

Actions: get_referral_link, my_referrals, my_rewards, my_suggestions, refer, referral_dashboard, should_prompt_referral, suggest, track_click

ParameterSource
categorybody / query
referee_emailbody / query
referee_namebody / query
referral_codebody / query
suggestionbody / query
cURL
Python
JavaScript
# engage
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/engage \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "get_referral_link"
  }'

freight-rfi

Automated freight rate collection via email RFIs. Sends rate enquiries to forwarders, extracts structured rates from replies using Claude, and writes approved rates into FREIGHT_RATE.

POST/functions/v1/freight-rfi

Auth: API key or JWT

Actions: add_forwarder, approve_rates, check_responses, create_rfi, list_forwarders, rate_comparison, review_extraction, rfi_dashboard, send_rfi, suggest_rfis

ParameterSource
company_namebody / query
contact_emailbody / query
contact_namebody / query
container_typebody / query
country_codebody / query
databody / query
dest_portbody / query
forwarder_idsbody / query
lanesbody / query
origin_portbody / query
platformbody / query
response_idsbody / query
rfi_idbody / query
speciality_modesbody / query
speciality_regionsbody / query
cURL
Python
JavaScript
# freight-rfi
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/freight-rfi \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "add_forwarder"
  }'

onboard

GET POST/functions/v1/onboard

Auth: API key or JWT

ParameterSource
active_destinationsbody / query
active_originsbody / query
annual_volume_rangebody / query
business_typebody / query
primary_hs_chaptersbody / query
target_marketsbody / query
cURL
Python
JavaScript
# onboard
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/onboard \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "active_destinations": "...",
    "active_origins": "...",
    "annual_volume_range": "..."
  }'

stats

Public endpoint — no auth required. Returns platform stats for landing page, SEO pages, and AI agents. Cached in-memory for 5 minutes.

GET POST/functions/v1/stats

Auth: None (public)

cURL
Python
JavaScript
# stats
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/stats \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ }'

tenant-profile

GET POST/functions/v1/tenant-profile

Auth: API key or JWT

Actions: update, upload_context

ParameterSource
active_destinationsbody / query
active_originsbody / query
annual_volume_rangebody / query
business_typebody / query
document_namebody / query
document_textbody / query
primary_hs_chaptersbody / query
target_marketsbody / query
cURL
Python
JavaScript
# tenant-profile
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/tenant-profile \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "update"
  }'

training

Training, onboarding, and progression for trade analysts. Manages training modules, quiz attempts, analyst invitations, assignments, improvement suggestions, XP tracking, and career progression.

GET POST/functions/v1/training

Auth: JWT (admin or data_maintainer)

Actions: activity_log, check_promotion, complete_module, get_module, invite_maintainer, leaderboard, list_maintainers, modules, my_improvements, progression, promote, quiz_results, reset_training, start_quiz, status, submit_improvement, submit_quiz, update_assignment

ParameterSource
analyst_idbody / query
answersbody / query
assigned_countriesbody / query
assigned_freight_lanesbody / query
attempt_idbody / query
descriptionbody / query
emailbody / query
evidencebody / query
full_namebody / query
impact_estimatebody / query
maintainer_idbody / query
module_codebody / query
rolebody / query
suggestion_typebody / query
time_spent_secondsbody / query
titlebody / query
trackbody / query
cURL
Python
JavaScript
# training
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/training \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "activity_log"
  }'

transit

UK NCTS Phase 5 Transit Declarations via HMRC CTC Traders API v2.1

POST/functions/v1/transit

Auth: API key or JWT

Actions: create, list, messages, status, submit

ParameterSource
departure_idbody / query
enrichmentbody / query
hmrc_tokenbody / query
ie015_xmlbody / query
sandboxbody / query
substringbody / query
transitbody / query
typebody / query
cURL
Python
JavaScript
# transit
curl -X POST https://epytgmksddhvwziwxhuq.supabase.co/functions/v1/transit \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "create"
  }'

Error Responses

404 Not Found
{
  "status": "error",
  "error": "Commodity code 99999999 not found for IN"
}
403 Sanctions Block
{
  "status": "BLOCKED",
  "blocked_reason": "SANCTIONS",
  "message": "This trade route is subject to active sanctions. Do not proceed."
}
401 Unauthorized
{
  "error": "Authentication required."
}
429 Rate Limited
{
  "error": "FREE plan limit reached (10 lookups/month). Upgrade for more.",
  "upgrade_url": "https://customs-compliance.ai/#pricing"
}

Supported Countries

51 countries with national tariff data, preferential rates, and import conditions:

Full national tariff data: IN (India), GB (UK), US (USA), CN (China), ZA (South Africa), NA (Namibia), BR (Brazil), MX (Mexico), AU (Australia), AE (UAE), SA (Saudi Arabia), TH (Thailand), PH (Philippines), AR (Argentina), CL (Chile), UY (Uruguay), OM (Oman), MU (Mauritius), AO (Angola), DO (Dominican Republic)

EU Common External Tariff (27 countries): AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE

Rate Limits

PlanLookups/monthRate
Free505 req/min
Pro50030 req/min
Business2,00060 req/min
EnterpriseUnlimited120 req/min

Ready to integrate?

Get your API key in 30 seconds. Free tier includes 50 lookups/month.

Get API Key →

Generated from source on 2026-04-10 00:36 UTC by scripts/generate_api_docs.py