create_price_rule
Create a basic code discount in Shopify using GraphQL. Define discount type, value, eligibility, and duration.
Instructions
Create a modern basic code discount through GraphQL. Preserves the legacy price-rule tool name for compatibility.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Price rule title (internal name). | |
| target_type | Yes | What the discount applies to. | |
| target_selection | Yes | Which items the discount targets. | |
| allocation_method | Yes | How the discount is allocated: 'across' splits evenly, 'each' applies to each item. | |
| value_type | Yes | Type of discount value. | |
| value | Yes | Discount value (negative number, e.g. '-10.0' for 10% or $10 off). | |
| customer_selection | No | Which customers qualify. Default: all. | all |
| starts_at | Yes | When the discount becomes active (ISO 8601). | |
| ends_at | No | When the discount expires (ISO 8601). | |
| usage_limit | No | Maximum total number of times the discount can be used. | |
| once_per_customer | No | Limit to one use per customer. Default: false. |