curl --location --request GET 'https://demo.myshopify.com//admin/api//price_rules/.json'
target_type
is shipping_line
, then this value must be each
.starts_at
.target_type
set to line_item
and target_selection
set to entitled
.entitled_product_ids
or entitled_variant_ids
.target_type
set to shipping_line
and target_selection
set to entitled
.target_type
set to line_item
target_selection
set to entitled
.entitled_variant_ids
, then entitled_product_ids
can't include the ID of the product associated with that variant.target_type
set to line_item
target_selection
set to entitled
.entitled_product_ids
, then entitled_variant_ids
can't include the ID of any variants associated with that product.prerequisite_customer_ids
is populated, then customer_segment_prerequisite_ids
must be empty.customer_segment_prerequisite_ids
is populated, then prerequisite_customer_ids
must be empty.The date and time (ISO 8601 format) when the price rule starts.
title
as the code
property of the associated discount code.prerequisite_product_ids
can be used only with:target_type
set to line_item
,target_selection
set to entitled
,allocation_method
set to each
andprerequisite_to_entitlement_quantity_ratio
defined.prerequisite_variant_ids
, then prerequisite_product_ids
can't include the ID of the product associated with that variant.entitled_variant_ids
can be used only with:target_type
set to line_item
,target_selection
set to entitled
,allocation_method
set to each
andprerequisite_to_entitlement_quantity_ratio
defined.prerequisite_product_ids
, then prerequisite_variant_ids
can't include the ID of any variants associated with that product.List of collection ids that will be a prerequisites for a Buy X Get Y discount. The entitled_collection_ids
can be used only with:
target_type
set to line_item
,target_selection
set to entitled
,allocation_method
set to each
andprerequisite_to_entitlement_quantity_ratio
defined.prerequisite_product_ids
or prerequisite_variant_ids
.target_type
is shipping_line
, then only -100
is accepted.prerequisite_quantity
defines the necessary 'buy' quantity and entitled_quantity
the offered 'get' quantity.prerequisite_to_entitlement_quantity_ratio
can be used only with:value_type
set to percentage
,target_type
set to line_item
,target_selection
set to entitled
,allocation_method
set to each
,prerequisite_product_ids
or prerequisite_variant_ids
or prerequisite_collection_ids
defined andentitled_product_ids
or entitled_variant_ids
or entitled_collection_ids
defined.prerequisite_subtotal_range
, prerequisite_quantity_range
or prerequisite_shipping_price_range
.allocation_limit
is 3. Empty (null
) allocation_limit
means unlimited number of allocations.allocation_limit
is only working with Buy X Get Y discount. The default value on creation will be null
(unlimited).{
"price_rule": {
"id": 507328175,
"value_type": "fixed_amount",
"value": "-10.0",
"customer_selection": "all",
"target_type": "line_item",
"target_selection": "all",
"allocation_method": "across",
"allocation_limit": null,
"once_per_customer": false,
"usage_limit": null,
"starts_at": "2022-12-28T12:05:09-05:00",
"ends_at": "2023-01-09T12:05:09-05:00",
"created_at": "2023-01-03T12:05:09-05:00",
"updated_at": "2023-01-03T12:05:09-05:00",
"entitled_product_ids": [],
"entitled_variant_ids": [],
"entitled_collection_ids": [],
"entitled_country_ids": [],
"prerequisite_product_ids": [],
"prerequisite_variant_ids": [],
"prerequisite_collection_ids": [],
"customer_segment_prerequisite_ids": [],
"prerequisite_customer_ids": [],
"prerequisite_subtotal_range": null,
"prerequisite_quantity_range": null,
"prerequisite_shipping_price_range": null,
"prerequisite_to_entitlement_quantity_ratio": {
"prerequisite_quantity": null,
"entitled_quantity": null
},
"prerequisite_to_entitlement_purchase": {
"prerequisite_amount": null
},
"title": "SUMMERSALE10OFF",
"admin_graphql_api_id": "gid://shopify/PriceRule/507328175"
}
}