hac_promotion_scaffold
Scaffold, configure, and publish promotion rules in SAP Commerce Drools Engine to automate cart discounts, free gifts, and threshold-based offers.
Instructions
Scaffolds, configures, and publishes a PromotionSourceRule in the SAP Commerce Drools Rule Engine.
Args: rule_code: Unique code for the promotion rule (e.g. 'promo_summer_sale_100') name: Business title/name of the promotion promo_type: Promotion pattern: - 'ORDER_THRESHOLD_DISCOUNT': Order threshold discount (spend X get fixed discount or percentage off) - 'ORDER_THRESHOLD_FREE_GIFT': Spend X get free gift SKU - 'BUNDLE_FREE_GIFT': Multi-product bundle (A+B+C) gets free gift - 'PRODUCT_DISCOUNT': Specific product percentage or fixed discount - 'POTENTIAL_MESSAGE': Upsell hint when cart has not reached threshold threshold_amount: Minimum cart total threshold (e.g. 500.0) currency: Currency code (e.g. 'USD', 'CNY', 'HKD', 'EUR') discount_amount: Fixed discount amount (e.g. 50.0) discount_percentage: Percentage discount (e.g. 10.0 for 10% off) qualifying_products: List of qualifying product codes (SKUs) gift_product: SKU of the free gift product gift_quantity: Quantity of the free gift product (default 1) target_rule_code: Target rule code to check execution for POTENTIAL_MESSAGE message_fired: User notification message when promotion executes promo_group: Target PromotionGroup identifier (default 'powertoolsPromoGrp') priority: Rule execution priority (default 150) compile_immediately: If True, triggers Drools rules-module compilation immediately (default True) lang: Output language ('zh' for Chinese, 'en' for English)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | zh | |
| name | Yes | ||
| currency | No | USD | |
| priority | No | ||
| rule_code | Yes | ||
| promo_type | No | ORDER_THRESHOLD_DISCOUNT | |
| description | No | ||
| promo_group | No | powertoolsPromoGrp | |
| gift_product | No | ||
| gift_quantity | No | ||
| message_fired | No | ||
| discount_amount | No | ||
| target_rule_code | No | ||
| threshold_amount | No | ||
| compile_immediately | No | ||
| discount_percentage | No | ||
| qualifying_products | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |