{
  "openapi": "3.1.0",
  "info": {
    "title": "Zentria Flow API",
    "version": "1.0.0",
    "summary": "US tariff layers and landed cost for importers.",
    "description": "Zentria Flow prices an import before the purchase order: MFN duty, China Section 301, the forced-labor Section 301 tariff, Section 232, Section 338 on Canada, VAT/GST, freight, insurance and fees, for 70+ countries.\n\n**Two groups of endpoints.** The free tools under `/api/public-tools` need no key and are limited per IP address. The keyed API under `/api/v1` needs an API key (create one at https://zentriaflow.com/settings/api-keys) and a plan with API access; each plan has a call quota (see `x-rate-limits`).\n\n**Units.** Rates are percent (16.5 means 16.5%). Money is US dollars unless a `currency` is returned.\n\n**What the numbers are.** Planning estimates, not customs rulings. US rates are read from the HTSUS revision named in each response (`source`). Anti-dumping and countervailing duties are company-specific and are never part of a total. A licensed customs broker should confirm classification before entry.\n\n**Errors.** Non-2xx answers carry `{\"detail\": ...}`. The free tariff check answers an unknown code or origin with HTTP 200 and `{\"ok\": false, \"error\": ...}`.\n\nThis document covers the tariff and landed-cost endpoints. Store-data endpoints for connected shops and the Zapier REST hooks are described at https://zentriaflow.com/developers.",
    "termsOfService": "https://zentriaflow.com/terms",
    "contact": {
      "name": "Zentria Flow support",
      "url": "https://zentriaflow.com/contact",
      "email": "support@zentriaflow.com"
    },
    "license": {
      "name": "Proprietary. Use of the API is subject to the Zentria Flow Terms of Service.",
      "url": "https://zentriaflow.com/terms"
    },
    "x-logo": {
      "url": "https://zentriaflow.com/logo.png",
      "altText": "Zentria Flow"
    }
  },
  "servers": [
    {
      "url": "https://zentriaflow.com",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "Developer documentation",
    "url": "https://zentriaflow.com/developers"
  },
  "tags": [
    {
      "name": "Free tools",
      "description": "No API key. 120 requests per IP address per 10 minutes (bulk: 20 runs per 10 minutes). Table lookups, no AI."
    },
    {
      "name": "Keyed API",
      "description": "API key in `X-API-Key` or `Authorization: Bearer`. Quota per plan, see `x-rate-limits`."
    }
  ],
  "x-rate-limits": {
    "free_tools": {
      "requests": 120,
      "window_seconds": 600,
      "per": "IP address",
      "bulk_runs": 20,
      "bulk_window_seconds": 600
    },
    "keyed_api": {
      "note": "Quota is counted per account: per calendar month (UTC) on the API plans, per day (UTC) on Professional and Enterprise. `requests_per_minute` is the plan's rate allowance; null means it is set by contract.",
      "plans": {
        "professional": {
          "label": "Professional",
          "period": "daily",
          "quota": 500,
          "requests_per_minute": 60
        },
        "enterprise": {
          "label": "Enterprise",
          "period": "daily",
          "quota": 5000,
          "requests_per_minute": 300
        },
        "api_sandbox": {
          "label": "Sandbox API",
          "period": "monthly",
          "quota": 100,
          "requests_per_minute": 5
        },
        "api_growth": {
          "label": "Growth API",
          "period": "monthly",
          "quota": 20000,
          "requests_per_minute": 30
        },
        "api_scale": {
          "label": "Scale API",
          "period": "monthly",
          "quota": 50000,
          "requests_per_minute": 200
        },
        "api_enterprise": {
          "label": "Enterprise API",
          "period": "monthly",
          "quota": null,
          "requests_per_minute": null
        }
      }
    }
  },
  "paths": {
    "/api/public-tools/tariff-check": {
      "get": {
        "operationId": "usTariffCheck",
        "tags": [
          "Free tools"
        ],
        "summary": "US tariff layers for one HTS code and origin",
        "description": "MFN duty, China Section 301, the forced-labor Section 301 tariff, Section 232 and Section 338 on Canada for one HTSUS code from one origin, with the exemption that applies, the USMCA or CAFTA-DR cases, and the dated changes ahead (`scheduled_changes`). Table lookups only. No API key. A code or origin the engine does not recognise is answered with HTTP 200 and `{\"ok\": false, \"error\": ...}`.",
        "security": [],
        "parameters": [
          {
            "name": "hts",
            "in": "query",
            "required": true,
            "description": "HTSUS code, 4 to 10 digits, dots optional. An 8- or 10-digit line is priced from that line; a shorter code is an estimate.",
            "schema": {
              "type": "string",
              "maxLength": 20
            },
            "example": "6109.10.00"
          },
          {
            "name": "origin",
            "in": "query",
            "required": true,
            "description": "Country of origin: ISO-2 code or English country name.",
            "schema": {
              "type": "string",
              "maxLength": 60
            },
            "example": "CN"
          },
          {
            "name": "as_of",
            "in": "query",
            "required": false,
            "description": "Entry date, YYYY-MM-DD, from today to 12 months ahead. Default: today.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "quantity",
            "in": "query",
            "required": false,
            "description": "Number of pairs, kg, liters or units in the shipment. Send it together with `value` to price a specific or compound duty exactly.",
            "schema": {
              "type": "string",
              "maxLength": 24
            },
            "example": "750"
          },
          {
            "name": "quantity_unit",
            "in": "query",
            "required": false,
            "description": "Unit of `quantity`. Default: the line's own unit.",
            "schema": {
              "type": "string",
              "maxLength": 24
            }
          },
          {
            "name": "value",
            "in": "query",
            "required": false,
            "description": "Customs value of that quantity in US dollars. Required with `quantity`.",
            "schema": {
              "type": "string",
              "maxLength": 24
            },
            "example": "9000"
          }
        ],
        "responses": {
          "200": {
            "description": "The layers, or `ok: false` with the reason.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/TariffCheckResult"
                    },
                    {
                      "$ref": "#/components/schemas/ToolError"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/ToolRateLimited"
          }
        }
      }
    },
    "/api/public-tools/hts-search": {
      "get": {
        "operationId": "htsSearch",
        "tags": [
          "Free tools"
        ],
        "summary": "Find HTSUS lines by product words or a partial code",
        "description": "Searches the official HTSUS descriptions. Returns 8-digit lines; an empty list when nothing matches. No AI, no API key.",
        "security": [],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Product words or the start of a code.",
            "schema": {
              "type": "string",
              "maxLength": 80
            },
            "example": "cotton t-shirt"
          }
        ],
        "responses": {
          "200": {
            "description": "Matching lines, best first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HtsSearchResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/ToolRateLimited"
          }
        }
      }
    },
    "/api/public-tools/tariff-calendar": {
      "get": {
        "operationId": "usTariffCalendar",
        "tags": [
          "Free tools"
        ],
        "summary": "Dated US tariff changes the engine holds",
        "description": "Every dated US tariff change in the engine from 30 days ago to `months` months ahead, with example products priced before and after each date. No API key.",
        "security": [],
        "parameters": [
          {
            "name": "months",
            "in": "query",
            "required": false,
            "description": "Months ahead, 1 to 12.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,2}$",
              "default": "12"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Start the list at this date (YYYY-MM-DD) instead of 30 days ago.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The calendar.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TariffCalendar"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/ToolRateLimited"
          }
        }
      }
    },
    "/api/public-tools/tariff-check/bulk": {
      "post": {
        "operationId": "usTariffCheckBulk",
        "tags": [
          "Free tools"
        ],
        "summary": "US tariff layers for a list of up to 200 products",
        "description": "One single check per row. Without an account 3 rows a day are priced; a free account prices 10 a day; both allowances are shared with the website calculator. Rows beyond the allowance come back with status `locked`. A signed-in paid plan prices every row of a run. At most 20 runs from one IP address in 10 minutes; body at most 128 KB.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkRequest"
              },
              "example": {
                "rows": [
                  {
                    "hts": "6109.10.00",
                    "origin": "China",
                    "sku": "TEE-01",
                    "value": 1000
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One result per row, in request order.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 128 KB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "description": "More than 20 runs from one IP address in 10 minutes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Today's allowance could not be read; try again in a minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me": {
      "get": {
        "operationId": "getMe",
        "tags": [
          "Keyed API"
        ],
        "summary": "The account and plan behind the API key",
        "description": "Use it to test a key. Answers for any valid key, whatever the plan, and is not counted against the quota.",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "BearerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Account, plan and limits.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/v1/landed-cost/calculate": {
      "post": {
        "operationId": "calculateLandedCost",
        "tags": [
          "Keyed API"
        ],
        "summary": "Landed cost of one shipment",
        "description": "Prices a shipment with the function the website calculator and the Watchlist use, so the same inputs give the same total. Returns every duty layer, VAT and other taxes, fees, the HS code used and where the rates came from. Send `hs_code`, or `product_description` to have the product classified by AI first.",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "BearerKey": []
          }
        ],
        "x-required-plans": [
          "api_sandbox",
          "api_growth",
          "api_scale",
          "api_enterprise",
          "professional",
          "enterprise"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LandedCostRequest"
              },
              "example": {
                "hs_code": "6109.10.00",
                "origin_country": "CN",
                "destination_country": "US",
                "unit_value_usd": 10,
                "quantity": 1000,
                "weight_kg": 200
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The priced shipment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LandedCost"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/QuotaExceeded"
          }
        }
      }
    },
    "/api/v1/hs-code/lookup": {
      "post": {
        "operationId": "lookupHsCode",
        "tags": [
          "Keyed API"
        ],
        "summary": "AI HS code classification for a product description",
        "description": "One AI suggestion with a confidence label. Confirm it before filing an entry.",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "BearerKey": []
          }
        ],
        "x-required-plans": [
          "api_sandbox",
          "api_growth",
          "api_scale",
          "api_enterprise",
          "professional",
          "enterprise"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HsLookupRequest"
              },
              "example": {
                "product_description": "men's cotton knitted t-shirt",
                "destination_country": "US"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The suggestion.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HsLookup"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/QuotaExceeded"
          }
        }
      }
    },
    "/api/v1/hs-code/suggest": {
      "get": {
        "operationId": "suggestHsCodes",
        "tags": [
          "Keyed API"
        ],
        "summary": "HTSUS lines matching a product description",
        "description": "The HTSUS 8-digit lines whose official descriptions match (`method` htsus_search). When nothing matches, one AI classification is returned instead and marked as such (`method` ai). An empty list means no suggestion.",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "BearerKey": []
          }
        ],
        "x-required-plans": [
          "api_sandbox",
          "api_growth",
          "api_scale",
          "api_enterprise",
          "professional",
          "enterprise"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Product description.",
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 200
            },
            "example": "cotton t-shirt"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of suggestions.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 12,
              "default": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Suggestions, best first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HsSuggestResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/QuotaExceeded"
          }
        }
      }
    },
    "/api/v1/tariff/check": {
      "get": {
        "operationId": "tariffCheck",
        "tags": [
          "Keyed API"
        ],
        "summary": "Every tariff layer of one HS/HTS code from one origin",
        "description": "The rates the calculator charges, with the explanations of the free tariff checker for US imports and the dated changes ahead. Requires the Growth API plan or higher, or a Professional or Enterprise plan.",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "BearerKey": []
          }
        ],
        "x-required-plans": [
          "api_growth",
          "api_scale",
          "api_enterprise",
          "professional",
          "enterprise"
        ],
        "parameters": [
          {
            "name": "hts",
            "in": "query",
            "required": true,
            "description": "HS/HTS code.",
            "schema": {
              "type": "string",
              "minLength": 4,
              "maxLength": 20
            },
            "example": "6109.10.00"
          },
          {
            "name": "origin",
            "in": "query",
            "required": true,
            "description": "ISO-2 origin.",
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 2
            },
            "example": "CN"
          },
          {
            "name": "destination",
            "in": "query",
            "required": false,
            "description": "ISO-2 destination.",
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 2,
              "default": "US"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The layers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TariffLayers"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/QuotaExceeded"
          }
        }
      }
    },
    "/api/v1/tariff/rate": {
      "get": {
        "operationId": "tariffRate",
        "tags": [
          "Keyed API"
        ],
        "summary": "MFN rate of a destination for an HS code",
        "description": "The destination's MFN rate in percent, plus any anti-dumping measure on file. For the US tariff layers use /api/v1/tariff/check. Requires the Growth API plan or higher, or a Professional or Enterprise plan.",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "BearerKey": []
          }
        ],
        "x-required-plans": [
          "api_growth",
          "api_scale",
          "api_enterprise",
          "professional",
          "enterprise"
        ],
        "parameters": [
          {
            "name": "hs_code",
            "in": "query",
            "required": true,
            "description": "HS code.",
            "schema": {
              "type": "string"
            },
            "example": "8471.30"
          },
          {
            "name": "origin",
            "in": "query",
            "required": true,
            "description": "ISO-2 origin.",
            "schema": {
              "type": "string"
            },
            "example": "CN"
          },
          {
            "name": "destination",
            "in": "query",
            "required": true,
            "description": "ISO-2 destination.",
            "schema": {
              "type": "string"
            },
            "example": "DE"
          }
        ],
        "responses": {
          "200": {
            "description": "The rate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TariffRate"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/QuotaExceeded"
          }
        }
      }
    },
    "/api/v1/watchlist": {
      "get": {
        "operationId": "listWatchedProducts",
        "tags": [
          "Keyed API"
        ],
        "summary": "The account's watched products",
        "description": "Newest first. Requires a Professional or Enterprise plan, or the Scale API plan or higher.",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "BearerKey": []
          }
        ],
        "x-required-plans": [
          "professional",
          "enterprise",
          "api_scale",
          "api_enterprise"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of products.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Watched products.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WatchItem"
                      }
                    },
                    "count": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "items",
                    "count"
                  ]
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/QuotaExceeded"
          }
        }
      }
    },
    "/api/v1/watchlist/changes": {
      "get": {
        "operationId": "listWatchChanges",
        "tags": [
          "Keyed API"
        ],
        "summary": "Recorded tariff changes on watched products",
        "description": "Newest first; poll it and deduplicate on `id`. Requires a Professional or Enterprise plan, or the Scale API plan or higher.",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "BearerKey": []
          }
        ],
        "x-required-plans": [
          "professional",
          "enterprise",
          "api_scale",
          "api_enterprise"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of changes.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Changes.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WatchChange"
                      }
                    }
                  },
                  "required": [
                    "events"
                  ]
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/QuotaExceeded"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Your key, which starts with `zf_live_`."
      },
      "BearerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "The same key as a bearer token: `Authorization: Bearer zf_live_...`."
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "No API key, or the key is invalid or revoked.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The key's plan does not include this endpoint, or the subscription is not active.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unprocessable": {
        "description": "A parameter is missing or invalid; `detail` says which.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ToolRateLimited": {
        "description": "More than 120 requests from one IP address in 10 minutes.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "QuotaExceeded": {
        "description": "The plan's daily or monthly quota is used up.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "string"
            },
            "description": "Unix time at which the quota resets."
          },
          "X-RateLimit-Limit": {
            "schema": {
              "type": "string"
            },
            "description": "The plan's quota for the period."
          },
          "X-RateLimit-Remaining": {
            "schema": {
              "type": "string"
            }
          },
          "X-RateLimit-Reset": {
            "schema": {
              "type": "string"
            },
            "description": "Unix time at which the quota resets."
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "detail": {
            "description": "A plain sentence. Request-validation errors raised by the framework (a missing required parameter, a wrong type) carry a list of {loc, msg, type} objects instead; the retired /webhooks endpoints carry an object.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              {
                "type": "object",
                "additionalProperties": true
              }
            ]
          }
        },
        "required": [
          "detail"
        ],
        "description": "Error body of every non-2xx answer."
      },
      "LayerChange": {
        "type": "object",
        "properties": {
          "layer": {
            "type": "string",
            "description": "mfn, section_301, forced_labor, section_232 or section_338."
          },
          "label": {
            "type": "string"
          },
          "before": {
            "type": "number",
            "description": "Percent of the customs value (16.5 means 16.5%)."
          },
          "after": {
            "type": "number",
            "description": "Percent of the customs value (16.5 means 16.5%)."
          }
        },
        "required": [
          "layer",
          "label",
          "before",
          "after"
        ]
      },
      "ScheduledChange": {
        "type": "object",
        "properties": {
          "effective_date": {
            "type": "string",
            "format": "date"
          },
          "total_rate_before": {
            "type": "number",
            "description": "Percent of the customs value (16.5 means 16.5%)."
          },
          "total_rate_after": {
            "type": "number",
            "description": "Percent of the customs value (16.5 means 16.5%)."
          },
          "layers_changed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LayerChange"
            }
          },
          "reason": {
            "type": "string"
          },
          "legal_reference": {
            "type": "string"
          }
        },
        "required": [
          "effective_date",
          "total_rate_before",
          "total_rate_after",
          "layers_changed",
          "reason",
          "legal_reference"
        ],
        "description": "A dated change the engine holds for this product and origin in the next 12 months. Scheduled changes can be extended, changed or withdrawn before their date."
      },
      "UsmcaCases": {
        "type": "object",
        "properties": {
          "qualifying_total": {
            "type": "number",
            "description": "Percent of the customs value (16.5 means 16.5%)."
          },
          "qualifying": {
            "type": "string"
          },
          "non_qualifying_total": {
            "type": "number",
            "description": "Percent of the customs value (16.5 means 16.5%)."
          },
          "non_qualifying": {
            "type": "string"
          },
          "basis": {
            "type": "string",
            "description": "Which case `total_rate` prices: non_qualifying or qualifying."
          }
        },
        "required": [
          "qualifying_total",
          "qualifying",
          "non_qualifying_total",
          "non_qualifying",
          "basis"
        ],
        "description": "Canada and Mexico: the total with and without a USMCA claim."
      },
      "CaftaDrCases": {
        "type": "object",
        "properties": {
          "basis": {
            "type": "string",
            "description": "Which case `total_rate` prices: not_claimed or claimed."
          },
          "not_claimed_total": {
            "type": "number",
            "description": "Percent of the customs value (16.5 means 16.5%)."
          },
          "not_claimed": {
            "type": "string"
          },
          "claimed_total": {
            "type": "number",
            "description": "Percent of the customs value (16.5 means 16.5%)."
          },
          "claimed": {
            "type": "string"
          }
        },
        "required": [
          "basis",
          "not_claimed_total",
          "not_claimed",
          "claimed_total",
          "claimed"
        ],
        "description": "CAFTA-DR textiles and apparel: the total with and without a CAFTA-DR claim."
      },
      "ToolError": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "string",
            "description": "What is wrong with the code or the origin, in a plain sentence."
          }
        },
        "required": [
          "ok",
          "error"
        ],
        "description": "Returned with HTTP 200 when the HTS code or the origin is not recognised."
      },
      "SpecificDuty": {
        "type": "object",
        "additionalProperties": true,
        "description": "Only for lines whose general rate is specific or compound (for example \"6.3¢/liter\" or \"90¢/pr. + 20%\"). With `quantity` and `value` in the request the MFN duty is priced exactly (`exact` true, `specific.line` shows the arithmetic); without them it stays an estimate and `quantity_field` names the quantity to send.",
        "properties": {
          "text": {
            "type": "string",
            "description": "The general rate as the HTSUS prints it."
          },
          "kind": {
            "type": "string",
            "description": "specific, compound or another kind the engine names."
          },
          "exact": {
            "type": "boolean"
          },
          "basis": {
            "type": "string"
          },
          "quantity_field": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ]
          },
          "why_not": {
            "type": "string"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "duty": {
            "type": [
              "number",
              "null"
            ],
            "description": "MFN duty in US dollars for the quantity and value given."
          },
          "rate": {
            "type": [
              "number",
              "null"
            ],
            "description": "MFN duty as a percent of the customs value given."
          },
          "customs_value": {
            "type": [
              "number",
              "null"
            ]
          },
          "specific": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ]
          },
          "summary": {
            "type": "string"
          }
        }
      },
      "TariffCheckResult": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "hts": {
            "type": "string",
            "description": "The code checked, formatted (6109.10.00)."
          },
          "digits": {
            "type": "string",
            "description": "The code's digits only."
          },
          "origin": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 code of the origin the engine resolved."
          },
          "description": {
            "type": "string",
            "description": "HTSUS description of the line."
          },
          "mfn": {
            "type": "object",
            "properties": {
              "rate": {
                "type": "number",
                "description": "Percent of the customs value (16.5 means 16.5%). For a specific or compound rate this is an ad valorem equivalent."
              },
              "text": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The general rate as the HTSUS prints it."
              },
              "exact": {
                "type": "boolean",
                "description": "True when the rate is the line's own; false when it is an estimate (a code shorter than 8 digits, or a specific rate with no quantity)."
              }
            },
            "required": [
              "rate",
              "text",
              "exact"
            ]
          },
          "us_mfn": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/SpecificDuty"
              },
              {
                "type": "null"
              }
            ]
          },
          "section_301": {
            "type": "object",
            "properties": {
              "rate": {
                "type": "number",
                "description": "Percent of the customs value (16.5 means 16.5%)."
              },
              "heading": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Chapter 99 heading, for example 9903.88.15."
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The list, for example List 4A."
              },
              "partial": {
                "type": "boolean",
                "description": "True when only some 10-digit lines under this code are covered."
              },
              "note": {
                "type": "string"
              }
            },
            "required": [
              "rate",
              "heading",
              "label",
              "partial",
              "note"
            ]
          },
          "forced_labor": {
            "type": "object",
            "properties": {
              "rate": {
                "type": "number",
                "description": "Percent of the customs value (16.5 means 16.5%)."
              },
              "status": {
                "type": "string",
                "description": "applies, exempt, zero or another status the engine names; `reason` explains an exemption."
              },
              "tier": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              },
              "covered_origin": {
                "type": "boolean",
                "description": "True when the origin is one of the economies the tariff covers."
              }
            },
            "required": [
              "rate",
              "status",
              "tier",
              "reason",
              "covered_origin"
            ],
            "description": "The forced-labor Section 301 tariff (in force since 24 Jul 2026)."
          },
          "section_232": {
            "type": "object",
            "properties": {
              "rate": {
                "type": "number",
                "description": "Percent of the customs value (16.5 means 16.5%)."
              },
              "program": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "note": {
                "type": "string"
              },
              "conditional": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                },
                "description": "Section 232 duties that depend on the 10-digit line or on use; not in `total_rate`."
              }
            },
            "required": [
              "rate",
              "program",
              "note",
              "conditional"
            ]
          },
          "section_338": {
            "type": "object",
            "properties": {
              "rate": {
                "type": "number",
                "description": "Percent of the customs value (16.5 means 16.5%)."
              },
              "program": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "heading": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "partial": {
                "type": "boolean"
              },
              "note": {
                "type": "string"
              }
            },
            "required": [
              "rate",
              "program",
              "heading",
              "partial",
              "note"
            ],
            "description": "Section 338 on goods of Canada."
          },
          "import_ban": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "message"
                ],
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ],
            "description": "Set when the product cannot be imported from this origin."
          },
          "upcoming": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "effective": {
                    "type": "string",
                    "format": "date"
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "effective",
                  "message"
                ],
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ],
            "description": "A dated tariff ahead for this product, with its explanation."
          },
          "total_rate": {
            "type": "number",
            "description": "Sum of the duty layers on the `as_of` date. Percent of the customs value (16.5 means 16.5%). Anti-dumping and countervailing duties are never included."
          },
          "today_total_rate": {
            "type": "number",
            "description": "Present only when `as_of` is a later date: today's total, for comparison."
          },
          "usmca": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/UsmcaCases"
              },
              {
                "type": "null"
              }
            ]
          },
          "cafta_dr": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CaftaDrCases"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source": {
            "type": "string",
            "description": "The HTSUS revision the rates were read from and when it was checked."
          },
          "as_of": {
            "type": "string",
            "format": "date",
            "description": "The entry date the layers are for."
          },
          "as_of_is_today": {
            "type": "boolean"
          },
          "as_of_range": {
            "type": "object",
            "properties": {
              "min": {
                "type": "string",
                "format": "date"
              },
              "max": {
                "type": "string",
                "format": "date"
              }
            },
            "required": [
              "min",
              "max"
            ]
          },
          "scheduled_changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduledChange"
            }
          }
        },
        "required": [
          "ok",
          "hts",
          "digits",
          "origin",
          "description",
          "mfn",
          "us_mfn",
          "section_301",
          "forced_labor",
          "section_232",
          "section_338",
          "import_ban",
          "upcoming",
          "total_rate",
          "usmca",
          "cafta_dr",
          "notes",
          "source",
          "as_of",
          "as_of_is_today",
          "as_of_range",
          "scheduled_changes"
        ],
        "description": "Every US tariff layer of one HTS code from one origin. Rates are percent. A planning estimate, not a customs ruling."
      },
      "HtsSearchResponse": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "hts": {
                  "type": "string",
                  "description": "8-digit HTSUS line, formatted."
                },
                "description": {
                  "type": "string"
                }
              },
              "required": [
                "hts",
                "description"
              ]
            }
          }
        },
        "required": [
          "results"
        ]
      },
      "CalendarExample": {
        "type": "object",
        "properties": {
          "hts": {
            "type": "string"
          },
          "origin": {
            "type": "string"
          },
          "origin_name": {
            "type": "string"
          },
          "product": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "total_before": {
            "type": "number",
            "description": "Percent of the customs value (16.5 means 16.5%)."
          },
          "total_after": {
            "type": "number",
            "description": "Percent of the customs value (16.5 means 16.5%)."
          },
          "layers_changed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LayerChange"
            }
          },
          "reason": {
            "type": "string"
          },
          "legal_reference": {
            "type": "string"
          },
          "in_total": {
            "type": "boolean",
            "description": "False when the change is shown as a notice and not added to a total."
          },
          "usmca_qualifying": {
            "type": "object",
            "properties": {
              "before": {
                "type": "number"
              },
              "after": {
                "type": "number"
              }
            },
            "required": [
              "before",
              "after"
            ]
          },
          "caveat": {
            "type": "string"
          }
        },
        "required": [
          "hts",
          "origin",
          "origin_name",
          "product",
          "description",
          "total_before",
          "total_after",
          "layers_changed",
          "reason",
          "legal_reference",
          "in_total"
        ]
      },
      "CalendarEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "program": {
            "type": "string"
          },
          "program_key": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "what_changes": {
            "type": "string"
          },
          "scope": {
            "type": "object",
            "properties": {
              "products": {
                "type": "string"
              },
              "origins": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "origins_text": {
                "type": "string"
              }
            },
            "required": [
              "products",
              "origins",
              "origins_text"
            ],
            "additionalProperties": true
          },
          "legal_reference": {
            "type": "string"
          },
          "examples": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CalendarExample"
            }
          },
          "status": {
            "type": "string",
            "description": "in_force or scheduled."
          },
          "caveat": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "date",
          "program",
          "program_key",
          "kind",
          "what_changes",
          "scope",
          "legal_reference",
          "examples",
          "status"
        ]
      },
      "TariffCalendar": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "today": {
            "type": "string",
            "format": "date"
          },
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "checked_at": {
            "type": "string",
            "format": "date-time"
          },
          "data_version": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "disclaimer": {
            "type": "string"
          },
          "programs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CalendarEvent"
            }
          }
        },
        "required": [
          "ok",
          "today",
          "from",
          "to",
          "checked_at",
          "data_version",
          "source",
          "disclaimer",
          "programs",
          "events"
        ]
      },
      "BulkRowIn": {
        "type": "object",
        "properties": {
          "hts": {
            "type": "string",
            "maxLength": 20,
            "description": "HTS code, 4 to 10 digits, dots optional."
          },
          "origin": {
            "type": "string",
            "maxLength": 60,
            "description": "Country name or ISO-2 code."
          },
          "sku": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 80,
            "description": "Your own reference; returned unchanged."
          },
          "value": {
            "type": [
              "number",
              "null"
            ],
            "exclusiveMinimum": 0,
            "maximum": 100000000,
            "description": "Customs value of the row in US dollars."
          },
          "quantity": {
            "type": [
              "number",
              "null"
            ],
            "exclusiveMinimum": 0,
            "maximum": 1000000000
          }
        },
        "required": [
          "hts",
          "origin"
        ],
        "additionalProperties": false
      },
      "BulkRequest": {
        "type": "object",
        "properties": {
          "rows": {
            "type": "array",
            "minItems": 1,
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/BulkRowIn"
            }
          }
        },
        "required": [
          "rows"
        ],
        "additionalProperties": false
      },
      "BulkLayer": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "rate": {
            "type": "number",
            "description": "Percent of the customs value (16.5 means 16.5%)."
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "estimate": {
            "type": "boolean"
          },
          "partial": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "label",
          "rate"
        ],
        "additionalProperties": true
      },
      "BulkRowOut": {
        "type": "object",
        "properties": {
          "row": {
            "type": "integer",
            "description": "1-based position in the request."
          },
          "sku": {
            "type": [
              "string",
              "null"
            ]
          },
          "hts_input": {
            "type": "string"
          },
          "origin_input": {
            "type": "string"
          },
          "value": {
            "type": [
              "number",
              "null"
            ]
          },
          "quantity": {
            "type": [
              "number",
              "null"
            ]
          },
          "origin": {
            "type": [
              "string",
              "null"
            ]
          },
          "origin_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "error",
              "locked"
            ],
            "description": "ok: priced. error: see `error` and `field`. locked: beyond today's free allowance."
          },
          "hts": {
            "type": "string"
          },
          "total_rate": {
            "type": "number",
            "description": "Percent of the customs value (16.5 means 16.5%)."
          },
          "layers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BulkLayer"
            }
          },
          "result": {
            "$ref": "#/components/schemas/BulkCheck"
          },
          "duty_amount": {
            "type": [
              "number",
              "null"
            ],
            "description": "US dollars; set when the row has a value."
          },
          "duty_per_unit": {
            "type": [
              "number",
              "null"
            ]
          },
          "error": {
            "type": "string"
          },
          "field": {
            "type": "string"
          }
        },
        "required": [
          "row",
          "hts_input",
          "origin_input",
          "status"
        ],
        "additionalProperties": true
      },
      "BulkCheck": {
        "type": "object",
        "additionalProperties": true,
        "description": "The single check of the row: the fields of TariffCheckResult for today's date (without as_of, as_of_is_today, as_of_range and scheduled_changes).",
        "required": [
          "ok",
          "hts",
          "digits",
          "origin",
          "mfn",
          "section_301",
          "forced_labor",
          "section_232",
          "section_338",
          "total_rate",
          "source"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "hts": {
            "type": "string"
          },
          "digits": {
            "type": "string"
          },
          "origin": {
            "type": "string"
          },
          "total_rate": {
            "type": "number"
          },
          "source": {
            "type": "string"
          }
        }
      },
      "BulkResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BulkRowOut"
            }
          },
          "summary": {
            "type": "object",
            "properties": {
              "rows": {
                "type": "integer"
              },
              "priced": {
                "type": "integer"
              },
              "errors": {
                "type": "integer"
              },
              "locked": {
                "type": "integer"
              },
              "rows_with_value": {
                "type": "integer"
              },
              "total_value": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "total_duty": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "effective_rate": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Percent of the customs value (16.5 means 16.5%)."
              }
            },
            "required": [
              "rows",
              "priced",
              "errors",
              "locked",
              "rows_with_value",
              "total_value",
              "total_duty",
              "effective_rate"
            ]
          },
          "data_version": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "plan": {
            "type": "string",
            "enum": [
              "guest",
              "free",
              "paid"
            ]
          },
          "limits": {
            "type": "object",
            "properties": {
              "max_rows": {
                "type": "integer"
              },
              "daily_limit": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "null on a paid plan."
              },
              "used_today": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "remaining_today": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "guest_daily": {
                "type": "integer"
              },
              "account_daily": {
                "type": "integer"
              },
              "paid_rows_per_run": {
                "type": "integer"
              }
            },
            "required": [
              "max_rows",
              "daily_limit",
              "used_today",
              "remaining_today",
              "guest_daily",
              "account_daily",
              "paid_rows_per_run"
            ]
          },
          "checked_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "ok",
          "rows",
          "summary",
          "data_version",
          "source",
          "plan",
          "limits",
          "checked_at"
        ]
      },
      "Me": {
        "type": "object",
        "properties": {
          "user_id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "company": {
            "type": [
              "string",
              "null"
            ]
          },
          "plan": {
            "type": "string",
            "description": "free, professional, enterprise, api_sandbox, api_growth, api_scale or api_enterprise."
          },
          "plan_label": {
            "type": "string"
          },
          "plan_scope": {
            "type": "string",
            "enum": [
              "saas",
              "api"
            ]
          },
          "plan_scope_description": {
            "type": "string"
          },
          "api_key_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "accessible_endpoints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "used": {
                "type": "integer"
              },
              "limit": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "remaining": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "period": {
                "type": "string",
                "description": "daily or monthly."
              },
              "resets_at": {
                "type": "string"
              },
              "rpm_limit": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "used_today": {
                "type": "integer"
              },
              "daily_limit": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "remaining_today": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "required": [
              "used",
              "limit",
              "remaining",
              "period",
              "resets_at",
              "rpm_limit",
              "used_today",
              "daily_limit",
              "remaining_today"
            ],
            "description": "This endpoint does not count against the quota, so it reports the plan's limits, not a running count."
          }
        },
        "required": [
          "user_id",
          "email",
          "name",
          "company",
          "plan",
          "plan_label",
          "plan_scope",
          "plan_scope_description",
          "api_key_name",
          "scopes",
          "accessible_endpoints",
          "usage"
        ]
      },
      "LandedCostRequest": {
        "type": "object",
        "properties": {
          "product_description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Used only when `hs_code` is not sent: the product is classified by AI first and the response says so (`hs_code_source`)."
          },
          "hs_code": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "HS or HTS code, at least 4 digits, for example 6109.10.00."
          },
          "origin_country": {
            "type": "string",
            "description": "ISO-2 code, for example CN.",
            "minLength": 2,
            "maxLength": 2
          },
          "destination_country": {
            "type": "string",
            "description": "ISO-2 code, for example US.",
            "minLength": 2,
            "maxLength": 2
          },
          "unit_value_usd": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 100000000
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000000,
            "default": 1
          },
          "freight_cost_usd": {
            "type": "number",
            "minimum": 0,
            "maximum": 100000000,
            "default": 0,
            "description": "0 = the engine's estimate."
          },
          "insurance_usd": {
            "type": "number",
            "minimum": 0,
            "maximum": 100000000,
            "default": 0,
            "description": "0 = 0.5% of CIF."
          },
          "weight_kg": {
            "type": [
              "number",
              "null"
            ],
            "exclusiveMinimum": 0,
            "maximum": 10000000,
            "description": "Omit for 0.5 kg per unit."
          },
          "transport_mode": {
            "type": "string",
            "default": "sea",
            "description": "sea, air, express, rail, truck, road or multimodal."
          },
          "incoterm": {
            "type": "string",
            "default": "FOB"
          },
          "currency": {
            "type": "string",
            "default": "USD",
            "description": "ISO 4217 currency of the result. Inputs are always US dollars."
          }
        },
        "required": [
          "origin_country",
          "destination_country",
          "unit_value_usd"
        ]
      },
      "CostLayer": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "rate_pct": {
            "type": [
              "number",
              "null"
            ],
            "description": "Percent of the customs value (16.5 means 16.5%)."
          },
          "amount": {
            "type": "number",
            "description": "In `currency`."
          }
        },
        "required": [
          "label",
          "rate_pct",
          "amount"
        ]
      },
      "RateSource": {
        "type": "object",
        "properties": {
          "duty_rate_source": {
            "type": "string",
            "description": "For example \"USITC HTS REST (live)\" or \"static-table\"."
          },
          "verified_rate_source": {
            "type": [
              "string",
              "null"
            ]
          },
          "tariff_data_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "engine_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "sources": {
            "type": [
              "string",
              "null"
            ]
          },
          "calculated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "duty_rate_source",
          "verified_rate_source",
          "tariff_data_version",
          "engine_version",
          "sources",
          "calculated_at"
        ]
      },
      "LandedCost": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "product_description": {
            "type": [
              "string",
              "null"
            ]
          },
          "hs_code": {
            "type": "string"
          },
          "hs_code_source": {
            "type": "string",
            "enum": [
              "input",
              "ai_classification"
            ]
          },
          "hs_classification": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ],
            "description": "The AI suggestion used, when the code was not sent. Confirm it before filing."
          },
          "hs_description": {
            "type": [
              "string",
              "null"
            ]
          },
          "hs_resolution": {
            "type": [
              "string",
              "null"
            ]
          },
          "origin_country": {
            "type": "string"
          },
          "destination_country": {
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          },
          "unit_value_usd": {
            "type": "number"
          },
          "weight_kg": {
            "type": [
              "number",
              "null"
            ]
          },
          "weight_estimated": {
            "type": "boolean"
          },
          "transport_mode": {
            "type": [
              "string",
              "null"
            ]
          },
          "incoterm": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "fx_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "total_landed_cost": {
            "type": "number"
          },
          "total_per_unit": {
            "type": "number"
          },
          "product_value": {
            "type": "number"
          },
          "freight": {
            "type": "number"
          },
          "insurance": {
            "type": "number"
          },
          "total_duty": {
            "type": "number"
          },
          "effective_duty_rate_pct": {
            "type": "number",
            "description": "Total duty as a percent of the duty base."
          },
          "total_taxes": {
            "type": "number"
          },
          "total_fees": {
            "type": "number"
          },
          "layers": {
            "type": "object",
            "properties": {
              "mfn": {
                "$ref": "#/components/schemas/CostLayer"
              },
              "section_301": {
                "$ref": "#/components/schemas/CostLayer"
              },
              "forced_labor_301": {
                "$ref": "#/components/schemas/CostLayer"
              },
              "section_232": {
                "$ref": "#/components/schemas/CostLayer"
              },
              "section_338": {
                "$ref": "#/components/schemas/CostLayer"
              },
              "anti_dumping": {
                "$ref": "#/components/schemas/CostLayer"
              },
              "vat": {
                "$ref": "#/components/schemas/CostLayer"
              },
              "other_taxes": {
                "$ref": "#/components/schemas/CostLayer"
              }
            },
            "required": [
              "mfn",
              "section_301",
              "forced_labor_301",
              "section_232",
              "section_338",
              "anti_dumping",
              "vat",
              "other_taxes"
            ]
          },
          "fees": {
            "type": "object",
            "properties": {
              "merchandise_processing_fee": {
                "type": "number"
              },
              "harbor_maintenance_fee": {
                "type": "number"
              },
              "isf_filing_fee": {
                "type": "number"
              },
              "other_port_fees": {
                "type": "number"
              },
              "customs_broker_fee": {
                "type": "number"
              }
            },
            "required": [
              "merchandise_processing_fee",
              "harbor_maintenance_fee",
              "isf_filing_fee",
              "other_port_fees",
              "customs_broker_fee"
            ]
          },
          "import_restriction": {
            "type": [
              "string",
              "null"
            ]
          },
          "upcoming_tariff": {
            "type": [
              "string",
              "null"
            ]
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "confidence": {
            "description": "The engine's confidence label for the rates used.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ]
          },
          "rate_source": {
            "$ref": "#/components/schemas/RateSource"
          },
          "advisory_notice": {
            "type": [
              "string",
              "null"
            ]
          },
          "calculated_at": {
            "type": "string",
            "format": "date-time"
          },
          "duty_rate": {
            "type": "number",
            "description": "Legacy field: MFN rate, percent."
          },
          "duty_per_unit": {
            "type": "number"
          },
          "vat_rate": {
            "type": "number"
          },
          "vat_per_unit": {
            "type": "number"
          },
          "freight_per_unit": {
            "type": "number"
          },
          "insurance_per_unit": {
            "type": "number"
          },
          "antidumping": {
            "type": "boolean"
          },
          "antidumping_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "breakdown": {
            "type": "object",
            "additionalProperties": true,
            "description": "The engine's full line-by-line breakdown, as the website calculator shows it."
          }
        },
        "required": [
          "id",
          "product_description",
          "hs_code",
          "hs_code_source",
          "hs_classification",
          "hs_description",
          "hs_resolution",
          "origin_country",
          "destination_country",
          "quantity",
          "unit_value_usd",
          "weight_kg",
          "weight_estimated",
          "transport_mode",
          "incoterm",
          "currency",
          "fx_rate",
          "total_landed_cost",
          "total_per_unit",
          "product_value",
          "freight",
          "insurance",
          "total_duty",
          "effective_duty_rate_pct",
          "total_taxes",
          "total_fees",
          "layers",
          "fees",
          "import_restriction",
          "upcoming_tariff",
          "warnings",
          "confidence",
          "rate_source",
          "advisory_notice",
          "calculated_at",
          "duty_rate",
          "duty_per_unit",
          "vat_rate",
          "vat_per_unit",
          "freight_per_unit",
          "insurance_per_unit",
          "antidumping",
          "antidumping_rate",
          "breakdown"
        ],
        "description": "One priced shipment. Amounts are in `currency`; rates are percent. product_value + freight + insurance + total_duty + total_taxes + total_fees = total_landed_cost. A planning estimate, not a customs ruling."
      },
      "HsLookupRequest": {
        "type": "object",
        "properties": {
          "product_description": {
            "type": "string"
          },
          "origin_country": {
            "type": [
              "string",
              "null"
            ]
          },
          "destination_country": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "product_description"
        ]
      },
      "HsLookup": {
        "type": "object",
        "properties": {
          "hs_code": {
            "type": "string",
            "description": "\"9999.99\" means the product could not be classified."
          },
          "hs_code_6_digit": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "chapter": {
            "type": "string"
          },
          "chapter_name": {
            "type": "string"
          },
          "confidence": {
            "type": "string",
            "description": "High, Medium or Low."
          },
          "validated": {
            "type": "boolean",
            "description": "False when the code failed the structure check; treat it as no answer."
          },
          "validation_warning": {
            "type": "string"
          }
        },
        "required": [
          "hs_code",
          "description",
          "confidence"
        ],
        "additionalProperties": true,
        "description": "An AI classification. A suggestion to confirm with a licensed customs broker, not a ruling."
      },
      "HsSuggestion": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "hts": {
            "type": "string"
          },
          "hs6": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "rank": {
            "type": "integer"
          },
          "source": {
            "type": "string"
          },
          "confidence": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "hts",
          "hs6",
          "description",
          "rank",
          "source",
          "confidence"
        ]
      },
      "HsSuggestResponse": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "enum": [
              "htsus_search",
              "ai",
              "none"
            ]
          },
          "suggestions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HsSuggestion"
            }
          }
        },
        "required": [
          "query",
          "method",
          "suggestions"
        ]
      },
      "TariffLayers": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "hts": {
            "type": "string"
          },
          "digits": {
            "type": "string"
          },
          "origin": {
            "type": "string"
          },
          "destination": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "mfn": {
            "type": "object",
            "properties": {
              "rate": {
                "type": "number",
                "description": "Percent of the customs value (16.5 means 16.5%)."
              },
              "text": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "exact": {
                "type": [
                  "boolean",
                  "null"
                ]
              }
            },
            "required": [
              "rate",
              "text",
              "exact"
            ]
          },
          "section_301": {
            "type": "object",
            "properties": {
              "rate": {
                "type": "number"
              },
              "heading": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "note": {
                "type": "string"
              }
            },
            "required": [
              "rate",
              "heading",
              "label",
              "note"
            ]
          },
          "forced_labor": {
            "type": "object",
            "properties": {
              "rate": {
                "type": "number"
              },
              "status": {
                "type": "string"
              },
              "tier": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "rate",
              "status",
              "tier",
              "reason"
            ]
          },
          "section_232": {
            "type": "object",
            "properties": {
              "rate": {
                "type": "number"
              },
              "program": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "note": {
                "type": "string"
              }
            },
            "required": [
              "rate",
              "program",
              "note"
            ]
          },
          "section_338": {
            "type": "object",
            "properties": {
              "rate": {
                "type": "number"
              },
              "program": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "heading": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "note": {
                "type": "string"
              }
            },
            "required": [
              "rate",
              "program",
              "heading",
              "note"
            ]
          },
          "anti_dumping": {
            "type": "object",
            "properties": {
              "rate": {
                "type": "number"
              },
              "measures": {
                "type": "integer"
              },
              "note": {
                "type": "string"
              }
            },
            "required": [
              "rate",
              "measures",
              "note"
            ],
            "description": "A measure on file. Company-specific; never in `total_rate`."
          },
          "vat_rate": {
            "type": "number",
            "description": "VAT/GST of the destination, percent."
          },
          "import_ban": {
            "type": [
              "string",
              "null"
            ]
          },
          "upcoming": {
            "type": [
              "string",
              "null"
            ]
          },
          "total_rate": {
            "type": "number",
            "description": "Duty layers as a percent of the customs value, anti-dumping excluded."
          },
          "usmca": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/UsmcaCases"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rate_source": {
            "$ref": "#/components/schemas/RateSource"
          },
          "checked_at": {
            "type": "string",
            "format": "date-time"
          },
          "scheduled_changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduledChange"
            },
            "description": "US imports only; an empty list for other destinations."
          }
        },
        "required": [
          "id",
          "hts",
          "digits",
          "origin",
          "destination",
          "description",
          "mfn",
          "section_301",
          "forced_labor",
          "section_232",
          "section_338",
          "anti_dumping",
          "vat_rate",
          "import_ban",
          "upcoming",
          "total_rate",
          "usmca",
          "notes",
          "rate_source",
          "checked_at",
          "scheduled_changes"
        ]
      },
      "TariffRate": {
        "type": "object",
        "properties": {
          "hs_code": {
            "type": "string"
          },
          "origin": {
            "type": "string"
          },
          "destination": {
            "type": "string"
          },
          "mfn_rate": {
            "type": [
              "number",
              "null"
            ],
            "description": "MFN rate of the destination, percent. null when the lookup failed."
          },
          "rate_unit": {
            "type": "string"
          },
          "preferential_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "has_fta": {
            "type": "boolean"
          },
          "antidumping_measures": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "hs_code",
          "origin",
          "destination",
          "mfn_rate",
          "preferential_rate",
          "has_fta",
          "antidumping_measures",
          "timestamp"
        ]
      },
      "WatchItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "watch_id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "hs_code": {
            "type": "string"
          },
          "origin_country": {
            "type": [
              "string",
              "null"
            ]
          },
          "destination_country": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_value": {
            "type": [
              "number",
              "null"
            ]
          },
          "weight_kg": {
            "type": [
              "number",
              "null"
            ]
          },
          "transport_mode": {
            "type": [
              "string",
              "null"
            ]
          },
          "incoterm": {
            "type": [
              "string",
              "null"
            ]
          },
          "freight_override": {
            "type": [
              "number",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "total_landed_cost": {
            "type": [
              "number",
              "null"
            ]
          },
          "customs_cost": {
            "type": [
              "number",
              "null"
            ]
          },
          "total_duty": {
            "type": [
              "number",
              "null"
            ]
          },
          "layers": {
            "type": "object",
            "properties": {
              "mfn_rate": {
                "type": "number"
              },
              "section_301_rate": {
                "type": "number"
              },
              "forced_labor_rate": {
                "type": "number"
              },
              "section_232_rate": {
                "type": "number"
              },
              "section_338_rate": {
                "type": "number"
              },
              "vat_rate": {
                "type": "number"
              }
            },
            "required": [
              "mfn_rate",
              "section_301_rate",
              "forced_labor_rate",
              "section_232_rate",
              "section_338_rate",
              "vat_rate"
            ]
          },
          "import_restriction": {
            "type": [
              "string",
              "null"
            ]
          },
          "upcoming_tariff": {
            "type": [
              "string",
              "null"
            ]
          },
          "duty_rate_source": {
            "type": [
              "string",
              "null"
            ]
          },
          "change_count": {
            "type": "integer"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_checked_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "watch_id",
          "label",
          "hs_code",
          "origin_country",
          "destination_country",
          "product_value",
          "weight_kg",
          "transport_mode",
          "incoterm",
          "freight_override",
          "currency",
          "total_landed_cost",
          "customs_cost",
          "total_duty",
          "layers",
          "import_restriction",
          "upcoming_tariff",
          "duty_rate_source",
          "change_count",
          "created_at",
          "last_checked_at",
          "url"
        ]
      },
      "WatchChange": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique and stable per change; use it to deduplicate."
          },
          "event": {
            "type": "string"
          },
          "watch_id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "hs_code": {
            "type": "string"
          },
          "origin_country": {
            "type": [
              "string",
              "null"
            ]
          },
          "destination_country": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_value": {
            "type": [
              "number",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "detected_at": {
            "type": "string"
          },
          "customs_cost_before": {
            "type": [
              "number",
              "null"
            ]
          },
          "customs_cost_after": {
            "type": [
              "number",
              "null"
            ]
          },
          "customs_cost_change": {
            "type": "number"
          },
          "direction": {
            "type": "string",
            "enum": [
              "up",
              "down",
              "unchanged"
            ]
          },
          "total_landed_cost_before": {
            "type": [
              "number",
              "null"
            ]
          },
          "total_landed_cost_after": {
            "type": [
              "number",
              "null"
            ]
          },
          "changed_layers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "layer": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "label": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "before_pct": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "after_pct": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              },
              "required": [
                "layer",
                "label",
                "before_pct",
                "after_pct"
              ]
            }
          },
          "changed_layers_text": {
            "type": "string"
          },
          "import_restriction": {
            "type": [
              "string",
              "null"
            ]
          },
          "upcoming_tariff": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "event",
          "watch_id",
          "label",
          "hs_code",
          "origin_country",
          "destination_country",
          "product_value",
          "currency",
          "detected_at",
          "customs_cost_before",
          "customs_cost_after",
          "customs_cost_change",
          "direction",
          "total_landed_cost_before",
          "total_landed_cost_after",
          "changed_layers",
          "changed_layers_text",
          "import_restriction",
          "upcoming_tariff",
          "url"
        ]
      }
    }
  }
}
