Aller au contenu principal

TRADE-COST Public API

OpenAPI 3.1 reference for the v1 public API. Landed cost, HS classification, FX conversion, and signed outbound webhooks.

Quick start

Every public endpoint is authenticated with a Bearer API key. Keys are issued from the workspace dashboard and scoped to specific capabilities: calc:read, hs:read, fx:read, me:read.

curl -X POST https://trade-cost.com/api/v1/public/calc \
  -H "Authorization: Bearer tc_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "originCountryIso2": "CN",
    "destinationCountryIso2": "FR",
    "transportMode": "sea",
    "incoterm": "FOB",
    "currencyCode": "EUR",
    "productName": "LED headlamps",
    "unitPrice": 12.5,
    "quantity": 5000,
    "weightKg": 3500,
    "volumeCbm": 18
  }'

Webhook verification

Outbound webhooks are signed with HMAC-SHA256 using your subscription secret. The signature is delivered in the TC-Signature header as t=<unix-ms>,v1=<hex>. Compute HMAC of ${t}.${body} and compare in constant time. Reject events older than 5 minutes.