# tariff.duty

Calculate supported US HTSUS and EU TARIC duty components for one import line against pinned official data. Unresolved rates, evidence requirements and dates outside the snapshots return needs_review.

- REST: `POST https://api.kanagu.dev/v1/tariff/duty`
- MCP: `call_operation` with `operation: "tariff.duty"` at https://api.kanagu.dev/mcp
- Price: $0.05 USD per line, on successful calls only.
- Auth: `Authorization: Bearer <key>` for REST and `call_operation`. Retries: reuse `Idempotency-Key` (MCP: `idempotencyKey`).

## Compliance coverage

- Domain: Trade
- Jurisdictions: US, EU
- Standard: USITC Harmonized Tariff Schedule 2026 HTS Revision 23 (2026-11-10) — https://hts.usitc.gov/download?release=2026HTSRev23&releaseDate=11%2F09%2F2026
- Standard: European Commission TARIC monthly extraction November 2026, reference date 1 November (2026-11-01) — https://circabc.europa.eu/sd/a/d0b85541-ed40-4f11-81c3-d245b15adc1d/Duties%20Import%2001-99.xlsx
- Standard: Executive Order 14389 ending certain IEEPA tariff actions EO 14389, §2 (2026-02-20) — https://www.federalregister.gov/d/2026-03832
- Standard: European Commission explanation for TARIC extractions 9 June 2026 (2026-06-09) — https://circabc.europa.eu/sd/d/3d892b27-176f-4b8c-bbf5-4e0ee63f7e5a/Explanation%20for%20the%20Taric%20database%20extractions.pdf
- Standard: Union Customs Code, preferential origin Regulation (EU) No 952/2013, Article 64 (2013-10-09) — https://eur-lex.europa.eu/eli/reg/2013/952/oj/eng
- Standard: Temporary low-value consignment customs duty Council Regulation (EU) 2026/382, Article 2 (2026-02-11) — https://eur-lex.europa.eu/eli/reg/2026/382/oj/eng
- Verification: Duty expressions and legal references are checked against the USITC HTS and European Commission TARIC exports and their published interpretation rules.
- Last reviewed: 2026-11-26

## Request body

- `jurisdiction` ("US" | "EU", required)
- `code` (string, required): 8- or 10-digit HTSUS (US), or CN/TARIC (EU) goods code. Preserve leading zeros.
- `origin` (string, required): Uppercase country or territory of origin. Use TARIC geography codes for EU. US accepts UK as an alias for GB.
- `importDate` (string (date), required): Date of entry for consumption (US) or declaration acceptance (EU).
- `customsValue` (string, required): Line customs value in USD (US) or EUR (EU), as a decimal string.
- `quantity` (object)
- `quantity.value` (string, required)
- `quantity.unit` (string, required): Use the unit in the published duty rate, such as kg, hl, or each.
- `euPreference` (object): TARIC geographical area of the preference claimed, for EU entries only.
- `euPreference.area` (string, required)
- `euPreference.proofConfirmed` (boolean, required): The importer verified entitlement and holds the required proof of preferential origin.
- `euAdditionalCode` (string): Verified TARIC additional code for an EU trade-defence measure, e.g. an exporter code.
- `euConsignment` ("ordinary" | "low_value_qualifying"): Use ordinary after ruling out special low-value treatment or low_value_qualifying for an eligible postal/IOSS consignment under Regulation (EU) 2026/382.

## Response

- `status` ("calculated" | "needs_review", required)
- `jurisdiction` ("US" | "EU", required)
- `code` (string, required)
- `origin` (string, required)
- `importDate` (string (date), required)
- `currency` ("USD" | "EUR", required)
- `totalDuty` (string | null, required): Combined duty when supported and resolved, in the output currency.
- `snapshot` (object, required)
- `snapshot.name` (string, required)
- `snapshot.version` (string, required)
- `snapshot.date` (string (date), required)
- `snapshot.through` (string (date), required)
- `snapshot.url` (string (uri), required)
- `measures` (array of object, required)
- `measures[].kind` ("base" | "preference" | "additional" | "anti_dumping" | "countervailing" | "quota" | "suspension" | "low_value", required)
- `measures[].status` ("applied" | "alternative" | "conditional" | "not_applicable", required)
- `measures[].goodsCode` (string, required)
- `measures[].area` (string)
- `measures[].additionalCode` (string)
- `measures[].orderNumber` (string)
- `measures[].rate` (string, required)
- `measures[].amount` (string | null, required): Duty for this rate expressed in the output currency (a scenario amount for conditional/alternative measures).
- `measures[].source` (object, required)
- `measures[].source.rule` (string, required)
- `measures[].source.url` (string (uri), required)
- `findings` (array of object, required)
- `findings[].code` (string, required)
- `findings[].field` (string, required)
- `findings[].expected` (string, required)
- `findings[].actual` (string, required)
- `findings[].source` (object, required)
- `findings[].source.rule` (string, required)
- `findings[].source.url` (string (uri), required)

## Example

```sh
curl https://api.kanagu.dev/v1/tariff/duty \
  -H "Authorization: Bearer $KANAGU_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jurisdiction":"EU","code":"9504400000","origin":"JP","importDate":"2026-11-01","customsValue":"1200.00","euConsignment":"ordinary","euPreference":{"area":"JP","proofConfirmed":true}}'
```

```ts
const res = await fetch("https://api.kanagu.dev/v1/tariff/duty", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KANAGU_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "jurisdiction": "EU",
    "code": "9504400000",
    "origin": "JP",
    "importDate": "2026-11-01",
    "customsValue": "1200.00",
    "euConsignment": "ordinary",
    "euPreference": {
      "area": "JP",
      "proofConfirmed": true
    }
  }),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const result = await res.json();
```

## Errors

JSON `{"error":{"code","message"}}`.

- 400 `invalid_input`: The body does not match the request schema. The message names each field.
- 400 `invalid_json`: The body is missing or is not valid JSON.
- 400 `invalid_idempotency_key`: Idempotency-Key must be 1–128 visible ASCII characters.
- 401 `invalid_api_key`: The Bearer key is missing, malformed, invalid or inactive.
- 402 `free_allowance_exhausted`: This month's free usage is used up and the account has no subscription. Subscribe from the dashboard, or wait for the next UTC month; Retry-After gives the seconds left.
- 404 `not_found`: No operation at this path.
- 409 `idempotency_conflict`: The Idempotency-Key was already used with a different body.
- 413 `payload_too_large`: JSON bodies may be at most 64 KiB.
- 500 `internal_error`: The call failed on our side. It is not billed; retry with the same Idempotency-Key.

## JSON Schema

Request:
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "jurisdiction": {
      "type": "string",
      "enum": [
        "US",
        "EU"
      ]
    },
    "code": {
      "type": "string",
      "pattern": "^(?:\\d{8}|\\d{10}|\\d{4}\\.\\d{2}\\.\\d{2}(?:\\.?\\d{2})?)$",
      "description": "8- or 10-digit HTSUS (US), or CN/TARIC (EU) goods code. Preserve leading zeros."
    },
    "origin": {
      "type": "string",
      "pattern": "^[A-Z]{2}$",
      "description": "Uppercase country or territory of origin. Use TARIC geography codes for EU. US accepts UK as an alias for GB."
    },
    "importDate": {
      "type": "string",
      "format": "date",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
      "description": "Date of entry for consumption (US) or declaration acceptance (EU)."
    },
    "customsValue": {
      "type": "string",
      "pattern": "^(?:0|[1-9]\\d{0,11})(?:\\.\\d{1,2})?$",
      "description": "Line customs value in USD (US) or EUR (EU), as a decimal string."
    },
    "quantity": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "pattern": "^(?:0|[1-9]\\d{0,11})(?:\\.\\d{1,6})?$"
        },
        "unit": {
          "type": "string",
          "pattern": "^[a-zA-Z][a-zA-Z0-9]{0,11}$",
          "description": "Use the unit in the published duty rate, such as kg, hl, or each."
        }
      },
      "required": [
        "value",
        "unit"
      ],
      "additionalProperties": false
    },
    "euPreference": {
      "description": "TARIC geographical area of the preference claimed, for EU entries only.",
      "type": "object",
      "properties": {
        "area": {
          "type": "string",
          "pattern": "^(?:[A-Z]{2}|\\d{4})$"
        },
        "proofConfirmed": {
          "type": "boolean",
          "description": "The importer verified entitlement and holds the required proof of preferential origin."
        }
      },
      "required": [
        "area",
        "proofConfirmed"
      ],
      "additionalProperties": false
    },
    "euAdditionalCode": {
      "description": "Verified TARIC additional code for an EU trade-defence measure, e.g. an exporter code.",
      "type": "string",
      "pattern": "^[A-Z0-9]{4}$"
    },
    "euConsignment": {
      "description": "Use ordinary after ruling out special low-value treatment or low_value_qualifying for an eligible postal/IOSS consignment under Regulation (EU) 2026/382.",
      "type": "string",
      "enum": [
        "ordinary",
        "low_value_qualifying"
      ]
    }
  },
  "required": [
    "jurisdiction",
    "code",
    "origin",
    "importDate",
    "customsValue"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "jurisdiction": "EU",
      "code": "9504400000",
      "origin": "JP",
      "importDate": "2026-11-01",
      "customsValue": "1200.00",
      "euConsignment": "ordinary",
      "euPreference": {
        "area": "JP",
        "proofConfirmed": true
      }
    },
    {
      "jurisdiction": "US",
      "code": "6109.10.00.12",
      "origin": "CN",
      "importDate": "2026-11-10",
      "customsValue": "1200.00",
      "quantity": {
        "value": "100",
        "unit": "each"
      }
    }
  ]
}
```

Response:
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "calculated",
        "needs_review"
      ]
    },
    "jurisdiction": {
      "type": "string",
      "enum": [
        "US",
        "EU"
      ]
    },
    "code": {
      "type": "string"
    },
    "origin": {
      "type": "string"
    },
    "importDate": {
      "type": "string",
      "format": "date",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
    },
    "currency": {
      "type": "string",
      "enum": [
        "USD",
        "EUR"
      ]
    },
    "totalDuty": {
      "description": "Combined duty when supported and resolved, in the output currency.",
      "type": [
        "string",
        "null"
      ]
    },
    "snapshot": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "date": {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        },
        "through": {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": [
        "name",
        "version",
        "date",
        "through",
        "url"
      ],
      "additionalProperties": false
    },
    "measures": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "base",
              "preference",
              "additional",
              "anti_dumping",
              "countervailing",
              "quota",
              "suspension",
              "low_value"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "applied",
              "alternative",
              "conditional",
              "not_applicable"
            ]
          },
          "goodsCode": {
            "type": "string"
          },
          "area": {
            "type": "string"
          },
          "additionalCode": {
            "type": "string"
          },
          "orderNumber": {
            "type": "string"
          },
          "rate": {
            "type": "string"
          },
          "amount": {
            "description": "Duty for this rate expressed in the output currency (a scenario amount for conditional/alternative measures).",
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "object",
            "properties": {
              "rule": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            },
            "required": [
              "rule",
              "url"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "kind",
          "status",
          "goodsCode",
          "rate",
          "amount",
          "source"
        ],
        "additionalProperties": false
      }
    },
    "findings": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "expected": {
            "type": "string"
          },
          "actual": {
            "type": "string"
          },
          "source": {
            "type": "object",
            "properties": {
              "rule": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            },
            "required": [
              "rule",
              "url"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "code",
          "field",
          "expected",
          "actual",
          "source"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "status",
    "jurisdiction",
    "code",
    "origin",
    "importDate",
    "currency",
    "totalDuty",
    "snapshot",
    "measures",
    "findings"
  ],
  "additionalProperties": false
}
```
