Skip to content

DiscountBasedPromotion ​

Type: schema

TypeScript Definition ​

typescript
DiscountBasedPromotion: {{
            /**
             * @description discriminator enum property added by openapi-typescript
             * @enum {string}
             */
            promotion_type: "discount";
            /** @enum {string} */
            discount_type: "percentage" | "fixed-amount";
            /** @description Present only for percentage discounts. */
            discount_percent?: number;
            /** @description Present only for fixed-amount discounts. */
            discount_fixed_amount?: number;
            minimum_quantity: number;
            maximum_quantity: number | null;
            /** @description Percentage discount cap; `null` means no cap. Omitted for fixed-amount discounts. */
            maximum_discount_amount?: number | null;
        };
        /** DiscountCouponPromotion */
}

OpenAPI Schema ​

json
{
  "title": "DiscountBasedPromotion",
  "type": "object",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/schemas/DiscountBasedPromotion",
    "description": "API reference for the DiscountBasedPromotion schema"
  },
  "required": [
    "promotion_type",
    "discount_type",
    "minimum_quantity",
    "maximum_quantity"
  ],
  "properties": {
    "promotion_type": {
      "type": "string",
      "const": "discount"
    },
    "discount_type": {
      "type": "string",
      "enum": [
        "percentage",
        "fixed-amount"
      ]
    },
    "discount_percent": {
      "description": "Present only for percentage discounts.",
      "type": "number"
    },
    "discount_fixed_amount": {
      "description": "Present only for fixed-amount discounts.",
      "type": "integer"
    },
    "minimum_quantity": {
      "type": "integer",
      "minimum": 1
    },
    "maximum_quantity": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1
    },
    "maximum_discount_amount": {
      "description": "Percentage discount cap; `null` means no cap. Omitted for fixed-amount discounts.",
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1
    }
  }
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: