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 '> 0' if discount_type = percentage, otherwise set 0. */
            discount_percent?: number;
            /** @description '> 0' if discount_type = fixed-amount, otherwise set 0. */
            discount_fixed_amount?: number;
        };
        /** 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"
  ],
  "properties": {
    "promotion_type": {
      "type": "string",
      "enum": [
        "discount",
        "volume-based",
        "fixed-price",
        "free-goods"
      ],
      "const": "discount"
    },
    "discount_type": {
      "type": "string",
      "enum": [
        "percentage",
        "fixed-amount"
      ]
    },
    "discount_percent": {
      "description": "'> 0' if discount_type = percentage, otherwise set 0.",
      "type": "number"
    },
    "discount_fixed_amount": {
      "description": "'> 0' if discount_type = fixed-amount, otherwise set 0.",
      "type": "integer"
    }
  }
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: