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 `less-or-equal` and `less` make the tier "up to" `quantity`; `greater-or-equal` and `greater` make it "from" `quantity`. A line gets the highest "from" tier its quantity reaches; below the first, the "up to" tier that covers it; otherwise the product's price. A promotion has at most one "up to" tier, ending below its first "from" tier, and no two tiers starting from the same quantity.
                 * @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",
      "const": "volume-based"
    },
    "slabs": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "quantity",
          "quantity_condition",
          "discount_percent"
        ],
        "properties": {
          "quantity": {
            "type": "integer"
          },
          "quantity_condition": {
            "description": "`less-or-equal` and `less` make the tier \"up to\" `quantity`; `greater-or-equal` and `greater` make it \"from\" `quantity`. A line gets the highest \"from\" tier its quantity reaches; below the first, the \"up to\" tier that covers it; otherwise the product's price. A promotion has at most one \"up to\" tier, ending below its first \"from\" tier, and no two tiers starting from the same quantity.",
            "enum": [
              "less",
              "less-or-equal",
              "greater",
              "greater-or-equal"
            ]
          },
          "discount_percent": {
            "type": "number"
          }
        }
      }
    }
  },
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/admin-pos/schemas/VolumeBasedPromotion"
  },
  "required": [
    "promotion_type",
    "slabs"
  ],
  "title": "VolumeBasedPromotion"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: