{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zentriaflow-com/json-schema/zentriaflow-com-tariff-layers-schema.json",
  "title": "TariffLayers",
  "x-generated": "2026-11-16",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zentriaflow-com-openapi.json#/components/schemas/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": "#/$defs/UsmcaCases"
        },
        {
          "type": "null"
        }
      ]
    },
    "notes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "rate_source": {
      "$ref": "#/$defs/RateSource"
    },
    "checked_at": {
      "type": "string",
      "format": "date-time"
    },
    "scheduled_changes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/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"
  ],
  "$defs": {
    "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"
      ]
    },
    "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"
      ]
    },
    "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": "#/$defs/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."
    }
  }
}