Skip to content

VolumeBasedPromotion ​

Type: schema

TypeScript Definition ​

typescript
VolumeBasedPromotion: {{
            /**
             * @description discriminator enum property added by openapi-typescript
             * @enum {string}
             */
            promotion_type: "volume-based";
            slabs: {
                quantity: number;
                /**
                 * @description This key defines how the system will evaluate the quantity to determine if the promotion should be applied, based on the specified slab.
                 * @enum {unknown}
                 */
                quantity_condition: "less" | "less-or-equal" | "greater" | "greater-or-equal";
                discount_percent: number;
            }[];
        };
        /** VolumeBasedRule */
}

OpenAPI Schema ​

json
{
  "type": "object",
  "properties": {
    "promotion_type": {
      "type": "string",
      "enum": [
        "discount",
        "volume-based",
        "fixed-price",
        "free-goods"
      ],
      "const": "volume-based"
    },
    "slabs": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "quantity",
          "quantity_condition",
          "discount_percent"
        ],
        "properties": {
          "quantity": {
            "type": "integer"
          },
          "quantity_condition": {
            "description": "This key defines how the system will evaluate the quantity to determine if the promotion should be applied, based on the specified slab.",
            "enum": [
              "less",
              "less-or-equal",
              "greater",
              "greater-or-equal"
            ]
          },
          "discount_percent": {
            "type": "number"
          }
        }
      }
    }
  },
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/schemas/VolumeBasedPromotion",
    "description": "API reference for the VolumeBasedPromotion schema"
  },
  "required": [
    "promotion_type",
    "slabs"
  ],
  "title": "VolumeBasedPromotion"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: