{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/kibo-commerce/main/json-schema/kibo-commerce-shipping-inclusion-rule-schema.json",
  "title": "ShippingInclusionRule",
  "description": "An object to bind service types to shipping target rules and/or product target rules",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kibo-commerce-shipping-openapi.yml#/components/schemas/ShippingInclusionRule",
  "properties": {
    "auditInfo": {
      "$ref": "#/$defs/AuditInfo"
    },
    "id": {
      "description": "The system generated id of this shipping inclusion rule",
      "type": [
        "string",
        "null"
      ]
    },
    "productTargetRuleCodes": {
      "description": "the product target rule codes associated with this rule\r\n<remarks>leave empty or null to denote all products</remarks>",
      "items": {
        "type": "string"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "sequence": {
      "description": "The sequence in which this rule is preferred over others",
      "format": "int32",
      "type": "integer"
    },
    "serviceTypes": {
      "description": "the servicetypes associated with this rule\r\n<remarks>leave empty or null to denote all carriers and subsequent service types</remarks>",
      "items": {
        "$ref": "#/$defs/ServiceType"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "shippingTargetRuleCodes": {
      "description": "The shipping target rule codes associated with this rule\r\n<remarks>leave empty or null to denote all destinations</remarks>",
      "items": {
        "type": "string"
      },
      "type": [
        "array",
        "null"
      ]
    }
  },
  "type": "object",
  "$defs": {
    "AuditInfo": {
      "properties": {
        "createBy": {
          "type": [
            "string",
            "null"
          ]
        },
        "createDate": {
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "updateBy": {
          "type": [
            "string",
            "null"
          ]
        },
        "updateDate": {
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "ServiceType": {
      "description": "Service Type aka Shipping Method",
      "properties": {
        "code": {
          "description": "Unique Service Type Code for a particular Carrier",
          "type": [
            "string",
            "null"
          ]
        },
        "content": {
          "$ref": "#/$defs/ServiceTypeLocalizedContent"
        },
        "deliveryDuration": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "ServiceTypeLocalizedContent": {
      "properties": {
        "localeCode": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    }
  }
}