{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://objectsgrid.com/.well-known/objects-catalog/UnitPriceSpecification/v1/schema.json",
  "title": "UnitPriceSpecification",
  "description": "Objects Grid UnitPriceSpecification. One price of an Offer: a sale, strikethrough or member price, or a price per unit. Stored inside the Offer's priceSpecification. Modeled in compliance with https://schema.org/UnitPriceSpecification.",
  "type": "object",
  "properties": {
    "at_type": {
      "description": "The object type",
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "UnitPriceSpecification"
      ]
    },
    "price": {
      "description": "The price",
      "type": [
        "number",
        "null"
      ],
      "minimum": 0
    },
    "priceCurrency": {
      "description": "The currency of the price, ISO 4217",
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/CurrencyCodeEnumeration/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "priceType": {
      "description": "The kind of price, e.g. StrikethroughPrice for the price before a sale; none for the price to pay",
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/PriceTypeEnumeration/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "referenceQuantity": {
      "description": "The amount the price is for, e.g. 100 g",
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/QuantitativeValue/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "unitCode": {
      "description": "The unit of the price, a UN/CEFACT Common Code (3 characters) or a URL",
      "type": [
        "string",
        "null"
      ]
    },
    "unitText": {
      "description": "The unit of the price as text, e.g. 'per kg'",
      "type": [
        "string",
        "null"
      ]
    },
    "billingDuration": {
      "description": "The period the price is for, an ISO 8601 duration, e.g. P1M for a monthly price",
      "type": [
        "string",
        "null"
      ],
      "minLength": 3,
      "pattern": "^P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(T(\\d+H)?(\\d+M)?(\\d+(\\.\\d+)?S)?)?$"
    },
    "billingIncrement": {
      "description": "The smallest amount of the unit billed, e.g. 0.25 for quarter hours",
      "type": [
        "number",
        "null"
      ],
      "minimum": 0
    },
    "billingStart": {
      "description": "The unit from which this price applies, e.g. 3 for the third month on",
      "type": [
        "number",
        "null"
      ],
      "minimum": 0
    },
    "priceComponentType": {
      "description": "The part of a price this is, e.g. Subscription, ActivationFee",
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/PriceComponentTypeEnumeration/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "validFrom": {
      "description": "When the price starts",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "validThrough": {
      "description": "When the price ends",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "valueAddedTaxIncluded": {
      "description": "Whether the price includes value added tax",
      "type": [
        "boolean",
        "null"
      ]
    },
    "membershipPointsEarned": {
      "description": "The loyalty points earned at this price",
      "type": [
        "number",
        "null"
      ],
      "minimum": 0
    },
    "validForMemberTier": {
      "description": "The member tiers this price is for: a member price",
      "x-objectsgrid-rangeIncludes": [
        "MemberProgramTier"
      ],
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Reference/v1/schema.json"
      },
      "maxItems": 20
    }
  },
  "required": [
    "price"
  ],
  "unevaluatedProperties": false
}
