Skip to content

Promotion ​

Type: schema

TypeScript Definition ​

typescript
Promotion: {(components["schemas"]["DiscountCouponPromotion"] | components["schemas"]["FreeGoodCouponPromotion"] | components["schemas"]["BuyXGetYCouponPromotion"] | components["schemas"]["VolumeBasedCouponPromotion"] | (components["schemas"]["FreeShippingCouponPromotion"] & {
            /** @constant */
            promotion_type: "free-shipping"
}

Component References ​

ReferenceResolves To
components["schemas"]["DiscountCouponPromotion"]DiscountCouponPromotion
components["schemas"]["FreeGoodCouponPromotion"]FreeGoodCouponPromotion
components["schemas"]["BuyXGetYCouponPromotion"]BuyXGetYCouponPromotion
components["schemas"]["VolumeBasedCouponPromotion"]VolumeBasedCouponPromotion
components["schemas"]["FreeShippingCouponPromotion"]FreeShippingCouponPromotion

OpenAPI Schema ​

json
{
  "title": "Promotion",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/schemas/Promotion",
    "description": "API reference for the Promotion schema"
  },
  "allOf": [
    {
      "oneOf": [
        {
          "$ref": "#/components/schemas/DiscountCouponPromotion"
        },
        {
          "$ref": "#/components/schemas/FreeGoodCouponPromotion"
        },
        {
          "$ref": "#/components/schemas/BuyXGetYCouponPromotion"
        },
        {
          "$ref": "#/components/schemas/VolumeBasedCouponPromotion"
        },
        {
          "allOf": [
            {
              "$ref": "#/components/schemas/FreeShippingCouponPromotion"
            },
            {
              "type": "object",
              "required": [
                "promotion_type"
              ],
              "properties": {
                "promotion_type": {
                  "const": "free-shipping"
                }
              }
            }
          ]
        }
      ]
    },
    {
      "type": "object",
      "required": [
        "promotion_type",
        "status",
        "active",
        "priority",
        "customer_eligibility",
        "can_earn_loyalty_points",
        "can_redeem_loyalty_points",
        "customer_id",
        "customer_id_count",
        "customer_group_id",
        "customer_group_id_count",
        "product_id",
        "product_id_count",
        "category_id",
        "category_id_count"
      ],
      "properties": {
        "promotion_type": {
          "enum": [
            "discount",
            "free-goods",
            "free-shipping",
            "buy-x-get-y",
            "volume-based"
          ]
        },
        "status": {
          "description": "`inactive` once it is deactivated or has expired.",
          "type": "string",
          "enum": [
            "draft",
            "active",
            "inactive"
          ]
        },
        "active": {
          "description": "Whether it applies: `true` while `status` is `active`.",
          "type": "boolean"
        },
        "priority": {
          "description": "Its rank among the store's promotions, `\"1\"` applied first (a number sent as a string); `null` when it has none.",
          "type": [
            "string",
            "null"
          ],
          "examples": [
            "1"
          ]
        },
        "customer_eligibility": {
          "description": "Who it applies to.",
          "enum": [
            "all",
            "customer",
            "customer-group"
          ]
        },
        "can_earn_loyalty_points": {
          "description": "Whether an order it applies to earns loyalty points.",
          "type": "boolean"
        },
        "can_redeem_loyalty_points": {
          "description": "Whether an order it applies to can redeem loyalty points.",
          "type": "boolean"
        },
        "customer_id": {
          "description": "Customers it is for, when `customer_eligibility` is `customer`.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "customer_id_count": {
          "description": "How many customers the promotion is for; `customer_id` lists the first 100, in the order they were added.",
          "type": "integer"
        },
        "customer_group_id": {
          "description": "Customer groups it is for, when `customer_eligibility` is `customer-group`.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "customer_group_id_count": {
          "description": "How many customer groups the promotion is for; `customer_group_id` lists the first 100, in the order they were added.",
          "type": "integer"
        },
        "product_id": {
          "description": "Products listed on it.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "product_id_count": {
          "description": "How many products are listed on the promotion; `product_id` lists the first 100, in the order they were added.",
          "type": "integer"
        },
        "category_id": {
          "description": "Categories listed on it.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "category_id_count": {
          "description": "How many categories are listed on the promotion; `category_id` lists the first 100, in the order they were added.",
          "type": "integer"
        }
      }
    }
  ]
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: