{"openapi":"3.1.0","info":{"title":"GetTariff U.S. Import Tariff & HTS Research API","version":"1.0.0","description":"Fail-closed U.S. tariff calculation, HTS schedule search, multi-SKU exposure preview, and Model Context Protocol (MCP) endpoint backed by official USITC HTS data and cited Chapter 99 overlays.","contact":{"name":"GetTariff Support","email":"support@gettariff.com","url":"https://www.gettariff.com"}},"servers":[{"url":"https://www.gettariff.com","description":"Production"}],"paths":{"/api/duty/calculate":{"post":{"operationId":"calculateUsImportDuty","summary":"Calculate fail-closed U.S. import duty and FY2027 MPF","description":"Backed by 2026 HTS Revision 23 (published 2026-11-10). Returns explicit status codes when rates are compound, blank, Column 2, or unverified.","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["json","csv"],"default":"json"},"description":"Return formal JSON (default) or Excel-ready CSV (?format=csv or Accept: text/csv)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["htsNumber","origin","entryDate"],"properties":{"htsNumber":{"type":"string","example":"8471.30.01.00"},"origin":{"type":"string","example":"DE"},"entryDate":{"type":"string","format":"date","example":"2026-11-27"},"customsValue":{"type":"number","example":50000}}}}}},"responses":{"200":{"description":"Calculation result in JSON or Excel-ready CSV with applied overlays and source provenance."},"400":{"description":"Invalid input payload."},"402":{"description":"Payment Required (agent-purchasable HTTP 402 with PAYMENT-REQUIRED header and Stripe Checkout offer)."},"404":{"description":"HTS code not found in bundled USITC schedule."}}}},"/api/hts/search":{"get":{"operationId":"searchHtsCodes","summary":"Search U.S. HTS schedule by code prefix or keyword (JSON or CSV)","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"},"description":"HTS prefix or keyword"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50,"default":20}},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["json","csv"],"default":"json"}}],"responses":{"200":{"description":"Matching HTS entries in JSON or downloadable CSV."},"400":{"description":"Missing or invalid query parameter."}}}},"/api/exposure/preview":{"post":{"operationId":"previewSkuTariffExposure","summary":"Free top-5 preview of multi-SKU U.S. tariff exposure (JSON or CSV; full=true returns HTTP 402 offer)","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["json","csv"],"default":"json"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string","example":"8471.30.01.00, DE, 50000\n8504.40.95.80, JP, 120000"},"full":{"type":"boolean","description":"Set true to trigger HTTP 402 Payment Required offer for the full 500-SKU report."}}}}}},"responses":{"200":{"description":"Summary counts and top-5 highest-rate matched lines (JSON or CSV)."},"400":{"description":"No valid HTS lines found."},"402":{"description":"Payment Required (agent-purchasable HTTP 402 offer with Stripe Checkout endpoints)."},"413":{"description":"Input exceeds 20,000 characters or 500 lines."}}}},"/api/watchlist/checkout":{"post":{"operationId":"startTariffWatchProCheckout","summary":"Programmatically create a Stripe Checkout session for Tariff Watch Pro ($29/mo)","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"}}}}}},"responses":{"200":{"description":"Returns Stripe Checkout URL."},"503":{"description":"Checkout unavailable when Stripe price is not configured."}}}},"/api/exposure/checkout":{"post":{"operationId":"startSkuExposureReportCheckout","summary":"Programmatically create a Stripe Checkout session for the Personalized SKU Exposure Report ($49 one-time)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"text":{"type":"string","description":"Optional newline-delimited SKU list (up to 20,000 chars)."},"lineCount":{"type":"integer"}}}}}},"responses":{"200":{"description":"Returns Stripe Checkout URL."},"400":{"description":"Invalid email or body."},"413":{"description":"Product list exceeds 20,000-character limit."},"503":{"description":"Checkout or storage unavailable."}}}},"/api/mcp":{"post":{"operationId":"mcpJsonRpc","summary":"Model Context Protocol (MCP) Streamable HTTP JSON-RPC 2.0 endpoint","description":"Supports MCP methods: initialize, notifications/initialized, ping, tools/list, and tools/call.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"method":{"type":"string","example":"tools/list"},"params":{"type":"object"}}}}}},"responses":{"200":{"description":"JSON-RPC 2.0 response payload."},"400":{"description":"Malformed JSON-RPC request."}}}}}}