{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/salesforce-commerce-cloud/json-schema/salesforce-commerce-cloud-promotion-schema.json",
  "title": "Promotion",
  "description": "Document representing a promotion. Unless otherwise stated, attributes of this document are not supported when using\nthe Open Commerce API to update multiple promotions at once.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/salesforce-commerce-cloud-promotions-api-openapi.yml#/components/schemas/Promotion",
  "additionalProperties": {
    "title": "Additional Property Support",
    "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
  },
  "properties": {
    "archived": {
      "description": "Determines if this promotion is archived. This attribute is allowed to be updated when using the Open\n Commerce API to update multiple promotions at once.",
      "type": "boolean"
    },
    "assignmentInformation": {
      "description": "Information about the assignments and assignment schedules of this promotion.",
      "allOf": [
        {
          "$ref": "#/$defs/PromotionAssignmentInformation"
        }
      ]
    },
    "creationDate": {
      "description": "Returns the value of attribute 'creationDate'.",
      "type": "string",
      "format": "date-time"
    },
    "currencyCode": {
      "maxLength": 3,
      "description": "The ISO 4217 mnemonic code of the currency this promotion is restricted to. If not populated, then there is no\n currency restriction on the promotion.",
      "type": "string"
    },
    "disableGloballyExcluded": {
      "description": "Determines if this promotion ignores the global product exclusions for promotions.",
      "type": "boolean"
    },
    "enabled": {
      "description": "Determines if this promotion is enabled. This attribute is allowed to be updated when using the Open\n Commerce API to update multiple promotions at once.",
      "type": "boolean"
    },
    "exclusivity": {
      "description": "Determines if the promotion can be combined with other promotions of the same promotion class or if it cannot be\n combined with any other promotions. This attribute is allowed to be updated when using the Open Commerce API to\n update multiple promotions at once.",
      "enum": [
        "no",
        "class",
        "global"
      ],
      "type": "string"
    },
    "id": {
      "description": "The ID for the promotion.",
      "type": "string"
    },
    "lastModified": {
      "description": "Returns the value of attribute 'lastModified'.",
      "type": "string",
      "format": "date-time"
    },
    "name": {
      "description": "The user supplied name of this promotion, which can be localized.",
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "promotionClass": {
      "description": "The class of the promotion. If the promotion class is modified, then the promotion rule and all of its values,\n such as whether or not to disable global product exclusions, are reset.",
      "enum": [
        "product",
        "shipping",
        "order"
      ],
      "type": "string"
    },
    "tags": {
      "description": "Returns the list of tags assigned to this promotion. If used to set the tags on a promotion, the promotion will\n only have the tags passed in the input. Any existing tags are removed.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      }
    }
  },
  "type": "object",
  "$defs": {
    "Campaign": {
      "description": "Document representing a campaign.",
      "additionalProperties": {
        "title": "Additional Property Support",
        "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
      },
      "properties": {
        "campaignId": {
          "$ref": "#/$defs/CampaignId"
        },
        "coupons": {
          "description": "The array of assigned coupon IDs, not sorted.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "creationDate": {
          "description": "Returns the value of attribute 'creationDate'.",
          "type": "string",
          "format": "date-time"
        },
        "customerGroups": {
          "description": "The array of assigned customer groups, not sorted.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "description": {
          "maxLength": 4000,
          "description": "The description of the campaign.",
          "type": "string"
        },
        "enabled": {
          "description": "The enabled flag for campaign.",
          "type": "boolean"
        },
        "endDate": {
          "description": "The date the scenario ends.",
          "type": "string",
          "format": "date-time"
        },
        "lastModified": {
          "description": "Returns the value of attribute 'lastModified'.",
          "type": "string",
          "format": "date-time"
        },
        "sourceCodeGroups": {
          "description": "The array of assigned source code groups, not sorted.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "startDate": {
          "description": "The date the scenario begins.",
          "type": "string",
          "format": "date-time"
        }
      },
      "type": "object",
      "required": [
        "campaignId"
      ]
    },
    "CampaignId": {
      "minLength": 1,
      "maxLength": 256,
      "description": "The ID of the campaign.",
      "type": "string"
    },
    "Promotion": {
      "description": "Document representing a promotion. Unless otherwise stated, attributes of this document are not supported when using\nthe Open Commerce API to update multiple promotions at once.",
      "additionalProperties": {
        "title": "Additional Property Support",
        "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
      },
      "properties": {
        "archived": {
          "description": "Determines if this promotion is archived. This attribute is allowed to be updated when using the Open\n Commerce API to update multiple promotions at once.",
          "type": "boolean"
        },
        "assignmentInformation": {
          "description": "Information about the assignments and assignment schedules of this promotion.",
          "allOf": [
            {
              "$ref": "#/$defs/PromotionAssignmentInformation"
            }
          ]
        },
        "creationDate": {
          "description": "Returns the value of attribute 'creationDate'.",
          "type": "string",
          "format": "date-time"
        },
        "currencyCode": {
          "maxLength": 3,
          "description": "The ISO 4217 mnemonic code of the currency this promotion is restricted to. If not populated, then there is no\n currency restriction on the promotion.",
          "type": "string"
        },
        "disableGloballyExcluded": {
          "description": "Determines if this promotion ignores the global product exclusions for promotions.",
          "type": "boolean"
        },
        "enabled": {
          "description": "Determines if this promotion is enabled. This attribute is allowed to be updated when using the Open\n Commerce API to update multiple promotions at once.",
          "type": "boolean"
        },
        "exclusivity": {
          "description": "Determines if the promotion can be combined with other promotions of the same promotion class or if it cannot be\n combined with any other promotions. This attribute is allowed to be updated when using the Open Commerce API to\n update multiple promotions at once.",
          "enum": [
            "no",
            "class",
            "global"
          ],
          "type": "string"
        },
        "id": {
          "description": "The ID for the promotion.",
          "type": "string"
        },
        "lastModified": {
          "description": "Returns the value of attribute 'lastModified'.",
          "type": "string",
          "format": "date-time"
        },
        "name": {
          "description": "The user supplied name of this promotion, which can be localized.",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "promotionClass": {
          "description": "The class of the promotion. If the promotion class is modified, then the promotion rule and all of its values,\n such as whether or not to disable global product exclusions, are reset.",
          "enum": [
            "product",
            "shipping",
            "order"
          ],
          "type": "string"
        },
        "tags": {
          "description": "Returns the list of tags assigned to this promotion. If used to set the tags on a promotion, the promotion will\n only have the tags passed in the input. Any existing tags are removed.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Tag"
          }
        }
      },
      "type": "object"
    },
    "PromotionAbtestGroupAssignment": {
      "additionalProperties": false,
      "properties": {
        "abtestDescription": {
          "type": "string"
        },
        "abtestId": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        },
        "schedule": {
          "$ref": "#/$defs/Schedule"
        },
        "segmentDescription": {
          "type": "string"
        },
        "segmentId": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "abtestDescription",
        "abtestId",
        "enabled",
        "schedule",
        "segmentDescription",
        "segmentId"
      ]
    },
    "PromotionAssignmentInformation": {
      "additionalProperties": false,
      "properties": {
        "abtestId": {
          "description": "If there is only one assignment, and that assignment is an A/B test segment, the ID of the A/B test the segment\nbelongs to. Otherwise, empty.",
          "type": "string"
        },
        "abtestSegmentId": {
          "description": "If there is only one assignment, and that assignment is an A/B test segment, the ID of the A/B test segment.\n Otherwise, empty.",
          "type": "string"
        },
        "active": {
          "description": "True if the individual assignment or the multiple assignments are currently active.",
          "type": "boolean"
        },
        "activeAbtestAssignments": {
          "description": "A list of currently active A/B tests this is assigned to.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/PromotionAbtestGroupAssignment"
          }
        },
        "activeCampaignAssignments": {
          "description": "A list of currently active campaigns this is assigned to.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/PromotionCampaignAssignment"
          }
        },
        "campaignId": {
          "description": "If there is only one assignment, and that assignment is a campaign, the ID of the campaign. Otherwise, empty.",
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        },
        "endDate": {
          "description": "The end date of the container of the assignment (a Campaign or ABTest). If scheduleType is\n scheduleType : \"multiple\" or scheduleType : \"none\", then then result is null. Also, a null\n date returns null.",
          "type": "string",
          "format": "date-time"
        },
        "schedule": {
          "description": "The schedule of the assignment (a Campaign or ABTest). If scheduleType is\n scheduleType : \"multiple\" or scheduleType : \"none\", then then result is null.",
          "allOf": [
            {
              "$ref": "#/$defs/Schedule"
            }
          ]
        },
        "scheduleType": {
          "description": "If there is only one active assignment, or no active assignments and one upcoming assignment, this is that type\n of assignment (scheduleType : \"campaign\" or scheduleType : \"abtest\"). If there are no\n assignments, it is scheduleType : \"none\", otherwise, scheduleType : \"multiple\".",
          "enum": [
            "none",
            "campaign",
            "abtest",
            "multiple"
          ],
          "type": "string"
        },
        "startDate": {
          "description": "The start date of the container of the assignment (a Campaign or ABTest). If scheduleType is\n scheduleType : \"multiple\" or scheduleType : \"none\", then then result is null. Also, a null\n date returns null.",
          "type": "string",
          "format": "date-time"
        },
        "upcomingAbtestAssignments": {
          "description": "A list of upcoming A/B tests this is assigned to.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/PromotionAbtestGroupAssignment"
          }
        },
        "upcomingCampaignAssignments": {
          "description": "A list of upcoming campaigns this is assigned to.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/PromotionCampaignAssignment"
          }
        }
      },
      "type": "object",
      "required": [
        "active",
        "activeCampaignAssignments",
        "campaignId",
        "enabled",
        "schedule",
        "scheduleType"
      ]
    },
    "PromotionCampaignAssignment": {
      "description": "Document representing a promotion campaign assignment.",
      "additionalProperties": false,
      "properties": {
        "campaign": {
          "description": "The campaign.",
          "allOf": [
            {
              "$ref": "#/$defs/Campaign"
            }
          ]
        },
        "campaignId": {
          "minLength": 1,
          "maxLength": 256,
          "description": "The ID of the campaign.",
          "type": "string"
        },
        "coupons": {
          "description": "The sorted array of assigned coupon IDs.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "customerGroups": {
          "description": "The sorted array of assigned customer groups.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "description": {
          "maxLength": 4000,
          "description": "The description of the promotion campaign assignment.",
          "type": "string"
        },
        "enabled": {
          "description": "True if the assignment resource is enabled.",
          "type": "boolean"
        },
        "promotion": {
          "description": "The promotion.",
          "allOf": [
            {
              "$ref": "#/$defs/Promotion"
            }
          ]
        },
        "promotionId": {
          "minLength": 1,
          "maxLength": 256,
          "description": "The ID of the promotion.",
          "type": "string"
        },
        "rank": {
          "format": "int32",
          "description": "The rank of promotion campaign assignment.",
          "type": "integer"
        },
        "schedule": {
          "description": "The schedule of the assignment resource.",
          "allOf": [
            {
              "$ref": "#/$defs/Schedule"
            }
          ]
        },
        "sourceCodeGroups": {
          "description": "The sorted array of assigned source code groups.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "type": "object",
      "required": [
        "campaignId",
        "description",
        "enabled",
        "promotionId",
        "schedule"
      ]
    },
    "Recurrence": {
      "type": "object",
      "description": "Document representing a schedule recurrence.",
      "additionalProperties": false,
      "properties": {
        "dayOfWeek": {
          "description": "The days of week for recurrence.",
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "monday",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday",
              "sunday"
            ]
          }
        },
        "timeOfDay": {
          "description": "The time of the day for recurrence.",
          "allOf": [
            {
              "$ref": "#/$defs/TimeOfDay"
            }
          ]
        }
      }
    },
    "Schedule": {
      "type": "object",
      "description": "Document representing a time schedule. Defines an optional validity window (startDate/endDate) and an optional recurrence. Omitting a bound leaves that side of the window open (unbounded).",
      "additionalProperties": false,
      "properties": {
        "startDate": {
          "description": "The date to start validity. ISO8601 date time format: yyyy-MM-dd'T'HH:mm:ssZ.",
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "description": "The date to end of validity. ISO8601 date time format: yyyy-MM-dd'T'HH:mm:ssZ.",
          "type": "string",
          "format": "date-time"
        },
        "recurrence": {
          "description": "The recurrence of the schedule by day of week and time of day. Not all schedules support a recurrence.",
          "allOf": [
            {
              "$ref": "#/$defs/Recurrence"
            }
          ]
        }
      }
    },
    "Tag": {
      "description": "Document representing a tag",
      "additionalProperties": false,
      "properties": {
        "tagId": {
          "description": "The ID of the tag.",
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "tagId"
      ]
    },
    "TimeOfDay": {
      "type": "object",
      "description": "Document representing a time schedule within a single day.",
      "additionalProperties": false,
      "properties": {
        "timeFrom": {
          "description": "The time to start from. Time format: HH:mm or HH:mm:ss. Seconds are ignored and set to 0.",
          "type": "string",
          "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$"
        },
        "timeTo": {
          "description": "The time to end on. Time format: HH:mm or HH:mm:ss. Seconds are ignored and set to 0.",
          "type": "string",
          "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$"
        }
      }
    }
  }
}