{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dibind-com/json-schema/dibind-com-duty-answer-schema.json",
  "title": "DutyAnswer",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dibind-com-openapi.yml#/components/schemas/DutyAnswer",
  "type": "object",
  "properties": {
    "hs_input": {
      "type": "string"
    },
    "hs_precision": {
      "type": "string"
    },
    "from": {
      "type": "string"
    },
    "as_of": {
      "type": "string",
      "format": "date"
    },
    "ambiguous": {
      "type": "boolean"
    },
    "duty_rate": {
      "$ref": "#/$defs/DutyRate"
    },
    "worst_case_all_measures": {
      "type": [
        "number",
        "null"
      ],
      "description": "Ceiling if every conditional and SIMA layer lands at once. Absent means duty_rate.high is the whole story."
    },
    "cite": {
      "type": "string",
      "description": "Ready-to-quote attribution, e.g. 'DAITK (daitk-tic.dibind.com), read 2026-09-03'."
    },
    "sales_tax": {
      "$ref": "#/$defs/SalesTax"
    },
    "measures_in_effect": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "conditional_measures": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ConditionalMeasure"
      }
    },
    "sima_measures": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/SimaMeasure"
      }
    },
    "possible_relief": {
      "type": [
        "object",
        "null"
      ],
      "description": "Chapter 99 relief provisions whose own text references this code. Candidates, never entitlements."
    },
    "special_provision": {
      "type": [
        "object",
        "null"
      ],
      "description": "Present only for chapters 98/99: what the provision is and what gates it."
    },
    "notes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "notes[0] is always the citeSummary sentence - quote it first."
    }
  },
  "$defs": {
    "ConditionalMeasure": {
      "type": "object",
      "description": "A surtax owed only if a condition is met (e.g. a quota threshold), reported separately because it is not owed on every shipment.",
      "properties": {
        "source": {
          "type": "string"
        },
        "rate": {
          "type": [
            "number",
            "null"
          ]
        },
        "application_condition": {
          "type": [
            "string",
            "null"
          ]
        },
        "content_origin_test": {
          "type": [
            "string",
            "null"
          ]
        },
        "total_if_applies": {
          "type": "number",
          "description": "Running cumulative total if this layer applies."
        },
        "quota": {
          "type": [
            "object",
            "null"
          ]
        },
        "verify": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "DutyRate": {
      "type": "object",
      "description": "Base duty plus every surtax certain to apply. NOT the landed cost - see conditional_measures and sima_measures.",
      "properties": {
        "low": {
          "type": "number"
        },
        "mid": {
          "type": "number"
        },
        "high": {
          "type": "number"
        }
      }
    },
    "SalesTax": {
      "type": "object",
      "description": "Always included: false. GST/HST/QST/PST are out of scope and never quoted.",
      "properties": {
        "included": {
          "type": "boolean",
          "enum": [
            false
          ]
        },
        "note": {
          "type": "string"
        }
      }
    },
    "SimaMeasure": {
      "type": "object",
      "description": "Anti-dumping/countervailing duty. Depends on the EXPORTER named on the customs documents, not the manufacturer - never summed into duty_rate.",
      "properties": {
        "code": {
          "type": "string"
        },
        "measure": {
          "type": "string"
        },
        "all_other_rate_pct": {
          "type": [
            "number",
            "null"
          ]
        },
        "total_if_applies": {
          "type": [
            "number",
            "null"
          ]
        },
        "cooperative_exporters": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "verify": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  }
}