Skip to content

AppliedPromotion

Type: schema

Description

Details about an active promotion applied to a cart/order

TypeScript Definition

typescript
AppliedPromotion: {{
            promotion_id: string;
            /** @enum {unknown} */
            promotion_type: "discount" | "free-goods" | "free-shipping" | "buy-x-get-y" | "volume-based";
            savings: number;
            product_id: string | null;
            variant_id: string | null;
            product_name: string | null;
            variant_name: string | null;
            applied_sequence: number;
            scope: string;
        };
        /**
         * AssociatedOption
         * @description An object where each key is an option name, and the value describes the option details.
         * @example {
         *       "background_color": {
         *         "name": "Background Color",
         *         "value": {
         *           "name": "Blue",
         *           "hexcode": "#0000FF"
         *         },
         *         "type": "color"
         *       },
         *       "size": {
         *         "name": "Size",
         *         "value": "Large",
         *         "type": "single-select"
         *       }
         *     }
         */
}

OpenAPI Schema

json
{
  "title": "AppliedPromotion",
  "description": "Details about an active promotion applied to a cart/order",
  "type": "object",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/schemas/AppliedPromotion",
    "description": "API reference for the AppliedPromotion schema"
  },
  "required": [
    "promotion_id",
    "promotion_type",
    "savings",
    "product_id",
    "variant_id",
    "product_name",
    "variant_name",
    "applied_sequence",
    "scope"
  ],
  "properties": {
    "promotion_id": {
      "type": "string"
    },
    "promotion_type": {
      "enum": [
        "discount",
        "free-goods",
        "free-shipping",
        "buy-x-get-y",
        "volume-based"
      ]
    },
    "savings": {
      "type": "number"
    },
    "product_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "variant_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "product_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "variant_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "applied_sequence": {
      "type": "number"
    },
    "scope": {
      "type": "string"
    }
  }
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: