Create Price Rule
shopify.create_price_rule
ActionBusiness appsconnection required
Calls the Shopify API with the connection's credentials.
Create the price rule that defines what a Shopify discount does.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- API key
- Providers
- Shopify
- Secret shape
- the Shopify Admin API access token
- Config it needs
- shop
- Resolved by
- config.connection_id, else node.connection_id
Configuration
12 fields, 8 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
title Name of the rule, used to find the discount in the Shopify admin. | string | Yes | — | — | SUMMER25 |
target_type What the discount comes off: the items or the shipping. | string | Yes | — | one of "line_item", "shipping_line" | — |
target_selection Whether the rule applies to everything in the cart or only to entitled products, collections or countries. | string | Yes | — | one of "all", "entitled" | — |
allocation_method 'across' takes the value off the order once; 'each' takes it off every entitled item. | string | Yes | — | one of "each", "across" | — |
value_type Whether the value is a currency amount or a percentage. | string | Yes | — | one of "fixed_amount", "percentage" | — |
value The discount as a negative decimal string: '-10.0' is 10 off or 10% off, depending on value_type. | string | Yes | — | — | -10.0 |
customer_selection 'all' offers the discount to everyone; 'prerequisite' limits it to the customers or segments named on the rule. | string | Yes | — | one of "all", "prerequisite" | — |
starts_at ISO 8601 timestamp the discount becomes usable. | string | Yes | — | iso8601 format | 2026-01-01T00:00:00Z |
ends_at ISO 8601 timestamp the discount stops working. Leave empty for no end. | string | No | — | iso8601 format | — |
usage_limit How many times the discount may be used in total across the store. | number | No | — | 1–2147483647 | 100 |
once_per_customer Limit the discount to one use per customer. | boolean | No | — | — | — |
price_rule Raw price rule fields for anything not modelled above (entitled product, collection or country ids, prerequisite quantity or subtotal ranges). Merged last, so it wins on a conflict. | object | No | — | — | — |
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"starts_at": "2026-01-01T00:00:00Z",
"title": "SUMMER25",
"usage_limit": 100,
"value": "-10.0"
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
price_rule The price rule, as Shopify returned it. | object | — |
id Numeric id of the price rule, as a string. | string | — |
{
"id": "",
"price_rule": {}
}Notes
- The store and the API version come from the connection: 'shop' (your-store.myshopify.com) and an optional 'api_version' that defaults to 2026-07. Auth is the Admin API access token, sent as X-Shopify-Access-Token.
- Lists page on an opaque cursor from Shopify's Link header, not on page numbers. Pass the 'page_info' a call returns back into the next call while 'has_more' is true; a request carrying page_info may only carry 'limit' and 'fields', so every other filter is ignored once you are paging.
- Shopify rate-limits with a leaky bucket (X-Shopify-Shop-Api-Call-Limit). A 429 fails the step with the bucket state and the Retry-After seconds in the message: put a control.delay in front of the node or lower 'limit'.
- Each write node also accepts the raw resource object for fields it does not model; that object is merged last and wins on a conflict.
- A price rule is the conditions only. Shoppers cannot use it until shopify.create_discount_code attaches a code to it.
See Create Price Rule run in a workflow.
In a technical demo we add the Shopify connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.