{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/salesforce-commerce-cloud/json-schema/salesforce-commerce-cloud-product-option-schema.json",
  "title": "ProductOption",
  "description": "Product options enable you to sell configurable products that have optional accessories, upgrades, or additional services. Options are always purchased with a product and can't be purchased separately.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/salesforce-commerce-cloud-products-api-openapi.yml#/components/schemas/ProductOption",
  "required": [
    "id"
  ],
  "type": "object",
  "properties": {
    "customName": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "The localized custom name of the product option."
    },
    "defaultProductOptionValue": {
      "type": "string",
      "description": "The default product option value."
    },
    "description": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "The localized description of the product option."
    },
    "id": {
      "minLength": 1,
      "type": "string",
      "description": "The object attribute definition ID which is also the identifier for the product option."
    },
    "image": {
      "$ref": "#/$defs/MediaFile"
    },
    "name": {
      "type": "string",
      "description": "The name of the object attribute definition."
    },
    "selectedOptionValue": {
      "type": "string",
      "description": "The selected option value of the product option."
    },
    "shared": {
      "type": "boolean",
      "description": "The flag that indicates if the product option is shared or local."
    },
    "sortingMode": {
      "type": "string",
      "description": "The sorting mode for the product option values.",
      "enum": [
        "byexplicitorder",
        "byoptionprice"
      ]
    },
    "values": {
      "items": {
        "$ref": "#/$defs/ProductOptionValue"
      },
      "type": "array",
      "description": "The sorted array of values of the product option."
    }
  },
  "$defs": {
    "CurrencyCode": {
      "description": "A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.",
      "pattern": "^([A-Z][A-Z][A-Z]|N/A)$",
      "type": "string"
    },
    "MediaFile": {
      "required": [
        "path"
      ],
      "type": "object",
      "properties": {
        "absUrl": {
          "type": "string",
          "description": "The absolute URL with request protocol."
        },
        "alt": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The alternative image text."
        },
        "disBaseUrl": {
          "type": "string",
          "description": "The Dynamic Image Service (DIS) base URL for product images only."
        },
        "path": {
          "type": "string",
          "description": "The raw media file path."
        },
        "title": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The image title."
        }
      },
      "description": "Document representing media file."
    },
    "Money": {
      "description": "A combination of a Currency and an amount of that Currency.",
      "type": "object",
      "properties": {
        "currencyMnemonic": {
          "$ref": "#/$defs/CurrencyCode"
        },
        "value": {
          "format": "double",
          "description": "The amount of money for the given currency.",
          "type": "number"
        }
      }
    },
    "ProductOptionValue": {
      "required": [
        "id",
        "value"
      ],
      "type": "object",
      "properties": {
        "defaultProductOptionValue": {
          "type": "boolean",
          "description": "Flag indicating if the product option value is the default value for the product option."
        },
        "id": {
          "minLength": 1,
          "type": "string",
          "description": "The ID of the product option value."
        },
        "optionPrices": {
          "items": {
            "$ref": "#/$defs/Money"
          },
          "type": "array",
          "description": "The list of prices in the product option value."
        },
        "skuExtension": {
          "type": "string",
          "description": "The SKU extension of the product option value."
        },
        "value": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The localized value of the product option."
        }
      },
      "description": "Document representing a product option Value"
    }
  }
}