{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "schema:ShippingRateSettings",
  "title": "ShippingRateSettings",
  "description": "A ShippingRateSettings represents re-usable pieces of shipping information. It is designed for publication on an URL that may be referenced via the [[shippingSettingsLink]] property of an [[OfferShippingDetails]]. Several occurrences can be published, distinguished and matched (i.e. identified/referenced) by their different values for [[shippingLabel]].",
  "type": "object",
  "allOf": [
    {
      "description": "Structured values are used when the value of a property has a more complex structure than simply being a textual value or a reference to another thing.",
      "$ref": "schema:StructuredValue"
    }
  ],
  "properties": {
    "doesNotShip": {
      "description": "Indicates when shipping to a particular [[shippingDestination]] is not available.",
      "type": "boolean"
    },
    "freeShippingThreshold": {
      "description": "A monetary value above (or at) which the shipping rate becomes free. Intended to be used via an [[OfferShippingDetails]] with [[shippingSettingsLink]] matching this [[ShippingRateSettings]].",
      "oneOf": [
        {
          "anyOf": [
            { "$ref": "schema:DeliveryChargeSpecification" },
            { "$ref": "schema:MonetaryAmount" }
          ]
        },
        {
          "type": "array",
          "items": {
            "anyOf": [
              { "$ref": "schema:DeliveryChargeSpecification" },
              { "$ref": "schema:MonetaryAmount" }
            ]
          }
        }
      ]
    },
    "isUnlabelledFallback": {
      "description": "This can be marked 'true' to indicate that some published [[DeliveryTimeSettings]] or [[ShippingRateSettings]] are intended to apply to all [[OfferShippingDetails]] published by the same merchant, when referenced by a [[shippingSettingsLink]] in those settings. It is not meaningful to use a 'true' value for this property alongside a transitTimeLabel (for [[DeliveryTimeSettings]]) or shippingLabel (for [[ShippingRateSettings]]), since this property is for use with unlabelled settings.",
      "type": "boolean"
    },
    "orderPercentage": {
      "description": "Fraction of the value of the order that is charged as shipping cost.",
      "oneOf": [
        { "type": "number" },
        { "type": "array", "items": { "type": "number" } }
      ]
    },
    "shippingDestination": {
      "description": "indicates (possibly multiple) shipping destinations. These can be defined in several ways, e.g. postalCode ranges.",
      "oneOf": [
        { "$ref": "schema:DefinedRegion" },
        { "type": "array", "items": { "$ref": "schema:DefinedRegion" } }
      ]
    },
    "shippingRate": {
      "description": "The shipping rate is the cost of shipping to the specified destination. Typically, the maxValue and currency values (of the [[MonetaryAmount]]) are most appropriate.",
      "anyOf": [
        { "$ref": "schema:MonetaryAmount" },
        { "$ref": "schema:ShippingRateSettings" }
      ]
    },
    "weightPercentage": {
      "description": "Fraction of the weight that is used to compute the shipping price.",
      "oneOf": [
        { "type": "number" },
        { "type": "array", "items": { "type": "number" } }
      ]
    }
  }
}
