Table of Contents

API Documentation

Programmatically calculate import tariffs with our powerful API.

Introduction

The Tariff Calculator API provides a simple and effective way to integrate international trade tariff calculations for goods imported into the United States into your applications. This service is exclusively available to our Business Plan subscribers.

With this API, you can automate tariff lookups, estimate landing costs, and build powerful logistics tools.

Authentication

API access is authenticated using an API Key. Each Business Plan user is provided with a unique API key.

You must include your API Key in the X-API-Key header of your request:

X-API-Key: YOUR_UNIQUE_API_KEY
Important: Keep your API Key secure and do not expose it in client-side code. All API calls should be made from a secure server environment.

API Endpoint

All calculations are performed via a single endpoint:

POST /api/business/calculate

Request Body

The request body must be a JSON object with the following parameters:

ParameterTypeRequiredDescription
hsCodeStringYesA 10-digit Harmonized System (HS) code.
valueNumberYesThe total value of the goods in USD.
countryStringNoThe 2-letter ISO code for the country of origin (e.g., "CN", "VN"). Defaults to "CN".
entryDateStringNoThe estimated entry date in "yyyy-MM-dd" format. Defaults to the current date.
transportStringNoThe mode of transport. Can be "OCEAN", "AIR", "RAIL", or "TRUCK". Defaults to "OCEAN".
unitOfMeasuresObjectConditionalRequired if the tariff for the HS code is based on units. E.g., { "KG": 100 }.
additionalFieldsObjectNoMetal composition, user-selected tariff provisions, and other condition inputs. See additional fields below.

Additional Fields — Tariff Conditions

Many HS codes require additional input fields for accurate duty calculation. This includes Section 232 tariffs (steel, aluminum, copper), US Content provisions (for goods with American-made components), and other special programs. Always provide these fields via the additionalFields parameter.

Important: When required fields are missing, the API now returns isIncomplete: true and an excludedCandidates array listing which tariff codes were skipped and why. Always check isIncomplete in every response — it covers ALL tariff provisions generically, not just Section 232.

Use /api/tariff/info to inspect the inputs that may affect a given HS code:

User-selected tariff provisions

Some tariff provisions depend on facts that only you can confirm. The calculation response includes userSelectionCandidates, each with a code, label, and description. The same list is available from GET /api/tariff/info with hsCode, entryDate, and country query parameters. Review the provision before selecting it; its presence does not mean your goods qualify.

To apply a qualifying provision, send its code in additionalFields.CHOSEN_HTS_CODES with the boolean value true. Use false to explicitly decline it. An omitted code is treated as unselected. An unselected optional provision does not set isIncomplete.

{
  "hsCode": "6301400020",
  "value": 1000,
  "country": "CN",
  "entryDate": "2026-09-22",
  "additionalFields": {
    "CHOSEN_HTS_CODES": { "99030591": true }
  }
}

GET /api/tariff/info

Returns tariff metadata for an HS code, including metal profiles and user selection candidates.

GET /api/tariff/info?hsCode=7326901000

The response includes a metalProfiles field when Section 232 fields are needed:

{
  "metalProfiles": {
    "STEEL": {
      "label": "Steel / Iron",
      "fields": ["STEEL_PERCENTAGE", "STEEL_COUNTRY_OF_POUR"]
    },
    "ALUMINUM": {
      "label": "Aluminum",
      "fields": ["ALUMINUM_COUNTRY_OF_SMELT"]
    }
  }
}

When metalProfiles is present, include the corresponding fields in your additionalFields:

additionalFields Reference

FieldTypeProfileDescription
STEEL_PERCENTAGENumberSTEELPercentage of steel/iron in the product (0–100).
STEEL_COUNTRY_OF_POURStringSTEEL2-letter ISO code of the country where the steel was poured/melted. Defaults to country if steel > 0.
ALUMINUM_PERCENTAGENumberALUMINUMPercentage of aluminum in the product (0–100).
ALUMINUM_COUNTRY_OF_SMELTStringALUMINUM2-letter ISO code of the country where the aluminum was smelted. Defaults to country if aluminum > 0.
COPPER_PERCENTAGENumberCOPPERPercentage of copper in the product (0–100).
COPPER_WEIGHT_PERCENTAGENumberMETAL_WEIGHTSCopper weight percentage (0–100). Used for certain composite metal articles.
US_CONTENT_PERCENTAGENumberUS_CONTENTPercentage of US-origin content in the product (0–100).
CHOSEN_HTS_CODESObjectUSER_SELECTIONMap of candidate HTS codes to booleans. Set a code to true only after confirming the provision applies.

Steel Example (7326.90.1000 from Ukraine, 50% steel)

curl -X POST 'https://tariff.synnaxstudio.com/api/business/calculate' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_UNIQUE_API_KEY' \
-d '{
  "hsCode": "7326901000",
  "value": 10000,
  "country": "UA",
  "transport": "OCEAN",
  "additionalFields": {
    "STEEL_PERCENTAGE": 50,
    "STEEL_COUNTRY_OF_POUR": "UA"
  }
}'

cURL Example

curl -X POST 'https://tariff.synnaxstudio.com/api/business/calculate' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_UNIQUE_API_KEY' \
-d '{
  "hsCode": "6201201120",
  "value": 15000,
  "country": "VN",
  "entryDate": "2025-08-15",
  "transport": "OCEAN",
  "unitOfMeasures": {
    "KG": 100
  },
  "additionalFields": {
    "STEEL_PERCENTAGE": 0,
    "ALUMINUM_PERCENTAGE": 0,
    "COPPER_PERCENTAGE": 0,
    "US_CONTENT_PERCENTAGE": 0
  }
}'

Response Format

Success Response (200 OK)

A successful request will return a JSON object with the calculated duties.

{
  "totalDuty": "3986",
  "dutyRate": "0.26573333333333333333",
  "hmf": "18.75",
  "mpf": "51.96",
  "duties": [
    {
      "hscode": "99030125",
      "value": "1500",
      "fullDescription": "Articles the product of any country, except for products described in headings 9903.01.26–9903.01.33, 9903.02.02–9903.02.91, 9903.96.01, and 9903.96.02, and except as provided for in headings 9903.01.34 and 9903.02.01, as provided for in subdivision (v) of U.S. note 2 to this subchapter",
      "label": "IEEPA Reciprocal All Country 10%",
      "rateDescription": "The duty provided in the applicable subheading + 10%"
    },
    {
      "hscode": "6201201120",
      "value": "2486",
      "fullDescription": "Men's or boys' overcoats, carcoats, capes, cloaks, anoraks (including ski jackets), windbreakers and   similar articles (including padded, sleeveless jackets), other than those of heading 6203: > Of wool or fine animal hair: > Overcoats, carcoats, capes, cloaks and similar coats: > Boys' (434)",
      "label": "",
      "rateDescription": "41¢/kg + 16.3%"
    }
  ],
  "isIncomplete": false,
  "excludedCandidates": [],
  "userSelectionCandidates": [
    {
      "code": "99030130",
      "label": "IEEPA Reciprocal Donation Exclusion",
      "description": "Articles that are donations, by persons subject to the jurisdiction of the United States, such as food, clothing, and medicine, intended to be used to relieve human suffering, as provided for in subdivision (v)(ii) of U.S. note 2 to this subchapter"
    }
  ]
}

Field Descriptions:

FieldTypeDescription
totalDutyString | NullThe total calculated tariff amount in USD. When isIncomplete is true, one or more duty lines were excluded, so this figure may be understated — always check isIncomplete and excludedCandidates.
dutyRateString | NullThe effective duty rate as a decimal (totalDuty / value). Equally understated when isIncomplete is true.
hmfString | NullHarbor Maintenance Fee. Only applicable for ‘OCEAN‘ transport, otherwise null.
mpfString | NullMerchandise Processing Fee. Returns null if the shipment is exempt (e.g., due to a special trade agreement).
dutiesArrayAn array of objects detailing each component of the tariff. See table below.
isIncompleteBooleanNew: true when one or more tariff codes were silently skipped because required input fields (such as metal composition) were not provided. The result may be significantly understated. Always check this field.
excludedCandidatesArrayNew: List of tariff codes that were excluded from the calculation due to missing input fields. Each entry contains code, description, missingField, profile, and profileLabel. Empty when all required fields are provided.
userSelectionCandidatesArrayOptional provisions for this HS code and date/country. Each entry has code, label, and description. Send a confirmed code in additionalFields.CHOSEN_HTS_CODES to recalculate.

Duties Object Structure:

FieldTypeDescription
hscodeStringThe HS code for this specific duty component.
valueString | NullThe calculated value for this duty component.
fullDescriptionStringThe official description of the HS code.
labelStringThe name of the tariff or program being applied (e.g., "Normal Trade Relations").
rateDescriptionStringA human-readable description of the rate (e.g., "1.0%").

Error Responses

If an error occurs, the API will return a non-200 status code and a JSON body with an error field.

Status CodeMeaningReason
400Bad RequestA required parameter is missing or has an invalid format (e.g., an invalid HS code).
The HS code requires a unit of measure, but it was not provided in the unitOfMeasures object.
The request specifies a restricted country of origin (e.g., Russia, Belarus, Cuba, North Korea).
401UnauthorizedThe API Key is missing or invalid.
403ForbiddenThe user is not a Business Plan subscriber.
404Not FoundThe provided HS code could not be found.
429Too Many RequestsThe user has exceeded their monthly API quota.
500Internal Server ErrorAn unexpected error occurred on the server.

Example: Unit of Measure Required (400)

{
  "error": "Unit of measure is required for this HS Code.",
  "unit_requirement": {
    "required": true,
    "unit": "KG",
    "available": ["DOZ", "KG"]
  }
}

Example: Quota Exceeded (429)

{
  "error": "Monthly API quota exceeded. Limit: 2500 calls per period.",
  "period_start": "2024-08-10T00:00:00.000Z",
  "period_end": "2024-09-09T23:59:59.999Z"
}

API Quota

Business Plan subscribers are entitled to 2,500 API calls per monthly billing cycle. Your usage resets at the beginning of each cycle, which is based on your original subscription date. You can monitor your current usage on the API Usage page.