{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/worldmonitor-app/json-schema/worldmonitor-app-worldmonitor-trade-v1-get-bilateral-tariff-response-schema.json",
  "title": "worldmonitor_trade_v1_GetBilateralTariffResponse",
  "description": "Applied tariff on one HS6 product between two countries.",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/worldmonitor-app-openapi.json#/components/schemas/worldmonitor_trade_v1_GetBilateralTariffResponse",
  "type": "object",
  "properties": {
    "reportingCountry": {
      "type": "string",
      "description": "Importer code, as requested."
    },
    "partnerCountry": {
      "type": "string",
      "description": "Exporter code, as requested."
    },
    "hsCode": {
      "type": "string",
      "description": "HS6 code, as requested."
    },
    "year": {
      "type": "integer",
      "format": "int32",
      "description": "Year served; 0 when none."
    },
    "nomenclature": {
      "type": "string",
      "description": "HS edition the importer filed in (\"H5\" = HS 2017)."
    },
    "basis": {
      "type": "string",
      "enum": [
        "APPLIED_TARIFF_BASIS_UNSPECIFIED",
        "APPLIED_TARIFF_BASIS_PREFERENTIAL",
        "APPLIED_TARIFF_BASIS_MFN",
        "APPLIED_TARIFF_BASIS_MFN_PREFERENCES_NOT_REPORTED"
      ],
      "description": "Source of applied_rate."
    },
    "appliedRate": {
      "$ref": "#/$defs/WM54"
    },
    "mfnRate": {
      "$ref": "#/$defs/WM54"
    },
    "preferentialRate": {
      "$ref": "#/$defs/WM54"
    },
    "groupPreferences": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/worldmonitor_trade_v1_GroupTariffPreference"
      }
    },
    "source": {
      "type": "string",
      "description": "Data source."
    },
    "sourceUrl": {
      "type": "string",
      "description": "WITS query behind the rows."
    },
    "upstreamUnavailable": {
      "type": "boolean",
      "description": "True on a fault, false on a coverage answer."
    },
    "unavailableReason": {
      "type": "string",
      "enum": [
        "BILATERAL_TARIFF_UNAVAILABLE_REASON_UNSPECIFIED",
        "BILATERAL_TARIFF_UNAVAILABLE_REASON_INVALID_REQUEST",
        "BILATERAL_TARIFF_UNAVAILABLE_REASON_NOT_COVERED",
        "BILATERAL_TARIFF_UNAVAILABLE_REASON_UPSTREAM_UNAVAILABLE"
      ],
      "description": "Why no rate was served. NOT_COVERED is final; UPSTREAM_UNAVAILABLE is a fault."
    },
    "filingReporter": {
      "type": "string",
      "description": "Reporter code queried: \"918\" for EU members."
    },
    "mfnAveRate": {
      "$ref": "#/$defs/WM54"
    }
  },
  "$defs": {
    "WM54": {
      "$ref": "#/$defs/worldmonitor_trade_v1_TariffRateDetail"
    },
    "worldmonitor_trade_v1_GroupTariffPreference": {
      "type": "object",
      "properties": {
        "groupCode": {
          "type": "string",
          "description": "WITS group code (\"A41\")."
        },
        "groupName": {
          "type": "string",
          "description": "WITS group name; empty when WITS has none."
        },
        "rate": {
          "$ref": "#/$defs/WM54"
        }
      },
      "description": "Preference granted to a partner group. Membership is not resolved."
    },
    "worldmonitor_trade_v1_TariffRateDetail": {
      "type": "object",
      "properties": {
        "rate": {
          "type": "number",
          "format": "double",
          "description": "Average ad valorem rate."
        },
        "minRate": {
          "type": "number",
          "format": "double",
          "description": "Lowest line rate."
        },
        "maxRate": {
          "type": "number",
          "format": "double",
          "description": "Highest line rate."
        },
        "tariffLines": {
          "type": "integer",
          "format": "int32",
          "description": "National tariff lines."
        },
        "nonAdValoremLines": {
          "type": "integer",
          "format": "int32",
          "description": "Specific or compound lines, excluded from the average."
        }
      },
      "description": "Simple average across the importer's national tariff lines, in percent."
    }
  }
}