cart_rule_create
Create a cart rule by specifying kind, target, conditions, and result. Conditions define criteria with comparator and value; result sets the discount field and value.
Instructions
Create a cart rule (POST /admin/api/ecommerce/v1/cart_rules). Envelope {cart_rule: {...}}. Required: kind, target_kind, target_id, conditions[], result{}. Inner conditions[] entries are {value, comparator, field, value_type}. result is {value, field, value_type}. Inner key validation is left to Voog — invalid combos return a 422 with the offending field.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | Yes | ||
| kind | Yes | ||
| target_kind | Yes | ||
| target_id | Yes | ||
| conditions | Yes | ||
| result | Yes | ||
| enabled | No | ||
| position | No | ||
| valid_from | No | ||
| valid_to | No |