rulecart_add
Create a shopping cart discount or promotion rule with configurable discount amount, type, voucher code, usage limits, and validity period.
Instructions
Create a shopping cart rule (discount / promotion).
Parameters
data : JSON object describing the cart rule. Key fields: - name (string) rule name - discount (float) discount amount or percentage - type (string) "fixed" | "percent" - code (string) voucher code (leave empty for auto-apply) - dateFrom (YYYY-MM-DD) start date (optional) - dateTo (YYYY-MM-DD) end date (optional) - usesPerCode (int) maximum total uses (0 = unlimited) - usesPerCustomer (int) maximum uses per customer (0 = unlimited) - enabled (0 or 1)
Example
'{"name": "Spring Sale 10%", "discount": 10, "type": "percent", "code": "SPRING10", "enabled": 1, "usesPerCode": 100}'
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||