priceRuleCreate mutation
Create a price rule using the input.
Required access
write_price_rules
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
priceRule
(
PriceRuleInput!
)
required
|
Input fields to create a price rule. |
priceRuleDiscountCode
(
PriceRuleDiscountCodeInput
)
|
Input fields to create a discount code for the price rule. |
PriceRuleInput fields
-
allocationLimit (
Int
)The maximum number of times that the price rule can be allocated onto an order.
-
allocationMethod (
PriceRuleAllocationMethod
)The method by which the price rule's value is allocated to its entitled items.
-
customerSelection (
PriceRuleCustomerSelectionInput
)The customers that can use this price rule.
-
entitlementToPrerequisiteQuantityRatio (
PriceRuleEntitlementToPrerequisiteQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items. This argument is deprecated: Use
prerequisiteToEntitlementQuantityRatio
instead. -
itemEntitlements (
PriceRuleItemEntitlementsInput
)The items to which the price rule applies.
-
itemPrerequisites (
PriceRuleItemPrerequisitesInput
)The items required for the price rule to be applicable.
-
oncePerCustomer (
Boolean
)Whether the price rule can be applied only once per customer.
-
prerequisiteQuantityRange (
PriceRuleQuantityRangeInput
)The number of the entitled items must fall within this range for the price rule to be applicable.
-
prerequisiteShippingPriceRange (
PriceRuleMoneyRangeInput
)The shipping cost must fall within this range for the price rule to be applicable.
-
prerequisiteSubtotalRange (
PriceRuleMoneyRangeInput
)The sum of the entitled items subtotal prices must fall within this range for the price rule to be applicable.
-
prerequisiteToEntitlementQuantityRatio (
PriceRulePrerequisiteToEntitlementQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items.
-
shippingEntitlements (
PriceRuleShippingEntitlementsInput
)The shipping lines to which the price rule applies.
-
target (
PriceRuleTarget
)The type of lines (line_item or shipping_line) to which the price rule applies.
-
title (
String
)Title of the price rule.
-
usageLimit (
Int
)The maximum number of times that the price rule can be used in total.
-
validityPeriod (
PriceRuleValidityPeriodInput
)PriceRuleValidityPeriod for the price rule.
-
value (
PriceRuleValueInput
)The value of the price rule.
Return fields
-
priceRule (
PriceRule
)The newly created price rule.
-
priceRuleDiscountCode (
PriceRuleDiscountCode
)The newly created discount code.
-
priceRuleUserErrors (
[PriceRuleUserError!]!
)List of errors that occurred executing the mutation.
Deprecated return fields
-
userErrors (
[UserError!]!
) deprecatedList of errors that occurred executing the mutation.
Deprecation warning
Use
priceRuleUserErrors
instead
Create a price rule using the input.
Required access
write_price_rules
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
priceRule
(
PriceRuleInput!
)
required
|
Input fields to create a price rule. |
priceRuleDiscountCode
(
PriceRuleDiscountCodeInput
)
|
Input fields to create a discount code for the price rule. |
PriceRuleInput fields
-
allocationLimit (
Int
)The maximum number of times that the price rule can be allocated onto an order.
-
allocationMethod (
PriceRuleAllocationMethod
)The method by which the price rule's value is allocated to its entitled items.
-
customerSelection (
PriceRuleCustomerSelectionInput
)The customers that can use this price rule.
-
entitlementToPrerequisiteQuantityRatio (
PriceRuleEntitlementToPrerequisiteQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items. This argument is deprecated: Use
prerequisiteToEntitlementQuantityRatio
instead. -
itemEntitlements (
PriceRuleItemEntitlementsInput
)The items to which the price rule applies.
-
itemPrerequisites (
PriceRuleItemPrerequisitesInput
)The items required for the price rule to be applicable.
-
oncePerCustomer (
Boolean
)Whether the price rule can be applied only once per customer.
-
prerequisiteQuantityRange (
PriceRuleQuantityRangeInput
)The number of the entitled items must fall within this range for the price rule to be applicable.
-
prerequisiteShippingPriceRange (
PriceRuleMoneyRangeInput
)The shipping cost must fall within this range for the price rule to be applicable.
-
prerequisiteSubtotalRange (
PriceRuleMoneyRangeInput
)The sum of the entitled items subtotal prices must fall within this range for the price rule to be applicable.
-
prerequisiteToEntitlementQuantityRatio (
PriceRulePrerequisiteToEntitlementQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items.
-
shippingEntitlements (
PriceRuleShippingEntitlementsInput
)The shipping lines to which the price rule applies.
-
target (
PriceRuleTarget
)The type of lines (line_item or shipping_line) to which the price rule applies.
-
title (
String
)Title of the price rule.
-
usageLimit (
Int
)The maximum number of times that the price rule can be used in total.
-
validityPeriod (
PriceRuleValidityPeriodInput
)PriceRuleValidityPeriod for the price rule.
-
value (
PriceRuleValueInput
)The value of the price rule.
Return fields
-
priceRule (
PriceRule
)The newly created price rule.
-
priceRuleDiscountCode (
PriceRuleDiscountCode
)The newly created discount code.
-
priceRuleUserErrors (
[PriceRuleUserError!]!
)List of errors that occurred executing the mutation.
Deprecated return fields
-
userErrors (
[UserError!]!
) deprecatedList of errors that occurred executing the mutation.
Deprecation warning
Use
priceRuleUserErrors
instead
Create a price rule using the input.
Required access
write_price_rules
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
priceRule
(
PriceRuleInput!
)
required
|
Input fields to create a price rule. |
priceRuleDiscountCode
(
PriceRuleDiscountCodeInput
)
|
Input fields to create a discount code for the price rule. |
PriceRuleInput fields
-
allocationLimit (
Int
)The maximum number of times that the price rule can be allocated onto an order.
-
allocationMethod (
PriceRuleAllocationMethod
)The method by which the price rule's value is allocated to its entitled items.
-
customerSelection (
PriceRuleCustomerSelectionInput
)The customers that can use this price rule.
-
entitlementToPrerequisiteQuantityRatio (
PriceRuleEntitlementToPrerequisiteQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items. This argument is deprecated: Use
prerequisiteToEntitlementQuantityRatio
instead. -
itemEntitlements (
PriceRuleItemEntitlementsInput
)The items to which the price rule applies.
-
itemPrerequisites (
PriceRuleItemPrerequisitesInput
)The items required for the price rule to be applicable.
-
oncePerCustomer (
Boolean
)Whether the price rule can be applied only once per customer.
-
prerequisiteQuantityRange (
PriceRuleQuantityRangeInput
)The number of the entitled items must fall within this range for the price rule to be applicable.
-
prerequisiteShippingPriceRange (
PriceRuleMoneyRangeInput
)The shipping cost must fall within this range for the price rule to be applicable.
-
prerequisiteSubtotalRange (
PriceRuleMoneyRangeInput
)The sum of the entitled items subtotal prices must fall within this range for the price rule to be applicable.
-
prerequisiteToEntitlementQuantityRatio (
PriceRulePrerequisiteToEntitlementQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items.
-
shippingEntitlements (
PriceRuleShippingEntitlementsInput
)The shipping lines to which the price rule applies.
-
target (
PriceRuleTarget
)The type of lines (line_item or shipping_line) to which the price rule applies.
-
title (
String
)Title of the price rule.
-
usageLimit (
Int
)The maximum number of times that the price rule can be used in total.
-
validityPeriod (
PriceRuleValidityPeriodInput
)PriceRuleValidityPeriod for the price rule.
-
value (
PriceRuleValueInput
)The value of the price rule.
Return fields
-
priceRule (
PriceRule
)The newly created price rule.
-
priceRuleDiscountCode (
PriceRuleDiscountCode
)The newly created discount code.
-
priceRuleUserErrors (
[PriceRuleUserError!]!
)List of errors that occurred executing the mutation.
Deprecated return fields
-
userErrors (
[UserError!]!
) deprecatedList of errors that occurred executing the mutation.
Deprecation warning
Use
priceRuleUserErrors
instead
Create a price rule using the input.
Required access
write_price_rules
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
priceRule
(
PriceRuleInput!
)
required
|
Input fields to create a price rule. |
priceRuleDiscountCode
(
PriceRuleDiscountCodeInput
)
|
Input fields to create a discount code for the price rule. |
PriceRuleInput fields
-
allocationLimit (
Int
)The maximum number of times that the price rule can be allocated onto an order.
-
allocationMethod (
PriceRuleAllocationMethod
)The method by which the price rule's value is allocated to its entitled items.
-
customerSelection (
PriceRuleCustomerSelectionInput
)The customers that can use this price rule.
-
entitlementToPrerequisiteQuantityRatio (
PriceRuleEntitlementToPrerequisiteQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items. This argument is deprecated: Use
prerequisiteToEntitlementQuantityRatio
instead. -
itemEntitlements (
PriceRuleItemEntitlementsInput
)The items to which the price rule applies.
-
itemPrerequisites (
PriceRuleItemPrerequisitesInput
)The items required for the price rule to be applicable.
-
oncePerCustomer (
Boolean
)Whether the price rule can be applied only once per customer.
-
prerequisiteQuantityRange (
PriceRuleQuantityRangeInput
)The number of the entitled items must fall within this range for the price rule to be applicable.
-
prerequisiteShippingPriceRange (
PriceRuleMoneyRangeInput
)The shipping cost must fall within this range for the price rule to be applicable.
-
prerequisiteSubtotalRange (
PriceRuleMoneyRangeInput
)The sum of the entitled items subtotal prices must fall within this range for the price rule to be applicable.
-
prerequisiteToEntitlementQuantityRatio (
PriceRulePrerequisiteToEntitlementQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items.
-
shippingEntitlements (
PriceRuleShippingEntitlementsInput
)The shipping lines to which the price rule applies.
-
target (
PriceRuleTarget
)The type of lines (line_item or shipping_line) to which the price rule applies.
-
title (
String
)Title of the price rule.
-
usageLimit (
Int
)The maximum number of times that the price rule can be used in total.
-
validityPeriod (
PriceRuleValidityPeriodInput
)PriceRuleValidityPeriod for the price rule.
-
value (
PriceRuleValueInput
)The value of the price rule.
Return fields
-
priceRule (
PriceRule
)The newly created price rule.
-
priceRuleDiscountCode (
PriceRuleDiscountCode
)The newly created discount code.
-
priceRuleUserErrors (
[PriceRuleUserError!]!
)List of errors that occurred executing the mutation.
Deprecated return fields
-
userErrors (
[UserError!]!
) deprecatedList of errors that occurred executing the mutation.
Deprecation warning
Use
priceRuleUserErrors
instead
Create a price rule using the input.
Required access
write_price_rules
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
priceRule
(
PriceRuleInput!
)
required
|
Input fields to create a price rule. |
priceRuleDiscountCode
(
PriceRuleDiscountCodeInput
)
|
Input fields to create a discount code for the price rule. |
PriceRuleInput fields
-
allocationLimit (
Int
)The maximum number of times that the price rule can be allocated onto an order.
-
allocationMethod (
PriceRuleAllocationMethod
)The method by which the price rule's value is allocated to its entitled items.
-
customerSelection (
PriceRuleCustomerSelectionInput
)The customers that can use this price rule.
-
entitlementToPrerequisiteQuantityRatio (
PriceRuleEntitlementToPrerequisiteQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items. This argument is deprecated: Use
prerequisiteToEntitlementQuantityRatio
instead. -
itemEntitlements (
PriceRuleItemEntitlementsInput
)The items to which the price rule applies.
-
itemPrerequisites (
PriceRuleItemPrerequisitesInput
)The items required for the price rule to be applicable.
-
oncePerCustomer (
Boolean
)Whether the price rule can be applied only once per customer.
-
prerequisiteQuantityRange (
PriceRuleQuantityRangeInput
)The number of the entitled items must fall within this range for the price rule to be applicable.
-
prerequisiteShippingPriceRange (
PriceRuleMoneyRangeInput
)The shipping cost must fall within this range for the price rule to be applicable.
-
prerequisiteSubtotalRange (
PriceRuleMoneyRangeInput
)The sum of the entitled items subtotal prices must fall within this range for the price rule to be applicable.
-
prerequisiteToEntitlementQuantityRatio (
PriceRulePrerequisiteToEntitlementQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items.
-
shippingEntitlements (
PriceRuleShippingEntitlementsInput
)The shipping lines to which the price rule applies.
-
target (
PriceRuleTarget
)The type of lines (line_item or shipping_line) to which the price rule applies.
-
title (
String
)Title of the price rule.
-
usageLimit (
Int
)The maximum number of times that the price rule can be used in total.
-
validityPeriod (
PriceRuleValidityPeriodInput
)PriceRuleValidityPeriod for the price rule.
-
value (
PriceRuleValueInput
)The value of the price rule.
Return fields
-
priceRule (
PriceRule
)The newly created price rule.
-
priceRuleDiscountCode (
PriceRuleDiscountCode
)The newly created discount code.
-
priceRuleUserErrors (
[PriceRuleUserError!]!
)List of errors that occurred executing the mutation.
Deprecated return fields
-
userErrors (
[UserError!]!
) deprecatedList of errors that occurred executing the mutation.
Deprecation warning
Use
priceRuleUserErrors
instead
Create a price rule using the input.
Required access
write_price_rules
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
priceRule
(
PriceRuleInput!
)
required
|
Input fields to create a price rule. |
priceRuleDiscountCode
(
PriceRuleDiscountCodeInput
)
|
Input fields to create a discount code for the price rule. |
PriceRuleInput fields
-
allocationLimit (
Int
)The maximum number of times that the price rule can be allocated onto an order.
-
allocationMethod (
PriceRuleAllocationMethod
)The method by which the price rule's value is allocated to its entitled items.
-
customerSelection (
PriceRuleCustomerSelectionInput
)The customers that can use this price rule.
-
entitlementToPrerequisiteQuantityRatio (
PriceRuleEntitlementToPrerequisiteQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items. This argument is deprecated: Use
prerequisiteToEntitlementQuantityRatio
instead. -
itemEntitlements (
PriceRuleItemEntitlementsInput
)The items to which the price rule applies.
-
itemPrerequisites (
PriceRuleItemPrerequisitesInput
)The items required for the price rule to be applicable.
-
oncePerCustomer (
Boolean
)Whether the price rule can be applied only once per customer.
-
prerequisiteQuantityRange (
PriceRuleQuantityRangeInput
)The number of the entitled items must fall within this range for the price rule to be applicable.
-
prerequisiteShippingPriceRange (
PriceRuleMoneyRangeInput
)The shipping cost must fall within this range for the price rule to be applicable.
-
prerequisiteSubtotalRange (
PriceRuleMoneyRangeInput
)The sum of the entitled items subtotal prices must fall within this range for the price rule to be applicable.
-
prerequisiteToEntitlementQuantityRatio (
PriceRulePrerequisiteToEntitlementQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items.
-
shippingEntitlements (
PriceRuleShippingEntitlementsInput
)The shipping lines to which the price rule applies.
-
target (
PriceRuleTarget
)The type of lines (line_item or shipping_line) to which the price rule applies.
-
title (
String
)Title of the price rule.
-
usageLimit (
Int
)The maximum number of times that the price rule can be used in total.
-
validityPeriod (
PriceRuleValidityPeriodInput
)PriceRuleValidityPeriod for the price rule.
-
value (
PriceRuleValueInput
)The value of the price rule.
Return fields
-
priceRule (
PriceRule
)The newly created price rule.
-
priceRuleDiscountCode (
PriceRuleDiscountCode
)The newly created discount code.
-
priceRuleUserErrors (
[PriceRuleUserError!]!
)List of errors that occurred executing the mutation.
Deprecated return fields
-
userErrors (
[UserError!]!
) deprecatedList of errors that occurred executing the mutation.
Deprecation warning
Use
priceRuleUserErrors
instead
Create a price rule using the input.
Required access
write_price_rules
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
priceRule
(
PriceRuleInput!
)
required
|
Input fields to create a price rule. |
priceRuleDiscountCode
(
PriceRuleDiscountCodeInput
)
|
Input fields to create a discount code for the price rule. |
PriceRuleInput fields
-
allocationLimit (
Int
)The maximum number of times that the price rule can be allocated onto an order.
-
allocationMethod (
PriceRuleAllocationMethod
)The method by which the price rule's value is allocated to its entitled items.
-
customerSelection (
PriceRuleCustomerSelectionInput
)The customers that can use this price rule.
-
entitlementToPrerequisiteQuantityRatio (
PriceRuleEntitlementToPrerequisiteQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items. This argument is deprecated: Use
prerequisiteToEntitlementQuantityRatio
instead. -
itemEntitlements (
PriceRuleItemEntitlementsInput
)The items to which the price rule applies.
-
itemPrerequisites (
PriceRuleItemPrerequisitesInput
)The items required for the price rule to be applicable.
-
oncePerCustomer (
Boolean
)Whether the price rule can be applied only once per customer.
-
prerequisiteQuantityRange (
PriceRuleQuantityRangeInput
)The number of the entitled items must fall within this range for the price rule to be applicable.
-
prerequisiteShippingPriceRange (
PriceRuleMoneyRangeInput
)The shipping cost must fall within this range for the price rule to be applicable.
-
prerequisiteSubtotalRange (
PriceRuleMoneyRangeInput
)The sum of the entitled items subtotal prices must fall within this range for the price rule to be applicable.
-
prerequisiteToEntitlementQuantityRatio (
PriceRulePrerequisiteToEntitlementQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items.
-
shippingEntitlements (
PriceRuleShippingEntitlementsInput
)The shipping lines to which the price rule applies.
-
target (
PriceRuleTarget
)The type of lines (line_item or shipping_line) to which the price rule applies.
-
title (
String
)Title of the price rule.
-
usageLimit (
Int
)The maximum number of times that the price rule can be used in total.
-
validityPeriod (
PriceRuleValidityPeriodInput
)PriceRuleValidityPeriod for the price rule.
-
value (
PriceRuleValueInput
)The value of the price rule.
Return fields
-
priceRule (
PriceRule
)The newly created price rule.
-
priceRuleDiscountCode (
PriceRuleDiscountCode
)The newly created discount code.
-
priceRuleUserErrors (
[PriceRuleUserError!]!
)List of errors that occurred executing the mutation.
Deprecated return fields
-
userErrors (
[UserError!]!
) deprecatedList of errors that occurred executing the mutation.
Deprecation warning
Use
priceRuleUserErrors
instead
Create a price rule using the input.
Required access
write_price_rules
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
priceRule
(
PriceRuleInput!
)
required
|
Input fields to create a price rule. |
priceRuleDiscountCode
(
PriceRuleDiscountCodeInput
)
|
Input fields to create a discount code for the price rule. |
PriceRuleInput fields
-
allocationLimit (
Int
)The maximum number of times that the price rule can be allocated onto an order.
-
allocationMethod (
PriceRuleAllocationMethod
)The method by which the price rule's value is allocated to its entitled items.
-
customerSelection (
PriceRuleCustomerSelectionInput
)The customers that can use this price rule.
-
entitlementToPrerequisiteQuantityRatio (
PriceRuleEntitlementToPrerequisiteQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items. This argument is deprecated: Use
prerequisiteToEntitlementQuantityRatio
instead. -
itemEntitlements (
PriceRuleItemEntitlementsInput
)The items to which the price rule applies.
-
itemPrerequisites (
PriceRuleItemPrerequisitesInput
)The items required for the price rule to be applicable.
-
oncePerCustomer (
Boolean
)Whether the price rule can be applied only once per customer.
-
prerequisiteQuantityRange (
PriceRuleQuantityRangeInput
)The number of the entitled items must fall within this range for the price rule to be applicable.
-
prerequisiteShippingPriceRange (
PriceRuleMoneyRangeInput
)The shipping cost must fall within this range for the price rule to be applicable.
-
prerequisiteSubtotalRange (
PriceRuleMoneyRangeInput
)The sum of the entitled items subtotal prices must fall within this range for the price rule to be applicable.
-
prerequisiteToEntitlementQuantityRatio (
PriceRulePrerequisiteToEntitlementQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items.
-
shippingEntitlements (
PriceRuleShippingEntitlementsInput
)The shipping lines to which the price rule applies.
-
target (
PriceRuleTarget
)The type of lines (line_item or shipping_line) to which the price rule applies.
-
title (
String
)Title of the price rule.
-
usageLimit (
Int
)The maximum number of times that the price rule can be used in total.
-
validityPeriod (
PriceRuleValidityPeriodInput
)PriceRuleValidityPeriod for the price rule.
-
value (
PriceRuleValueInput
)The value of the price rule.
Return fields
-
priceRule (
PriceRule
)The newly created price rule.
-
priceRuleDiscountCode (
PriceRuleDiscountCode
)The newly created discount code.
-
priceRuleUserErrors (
[PriceRuleUserError!]!
)List of errors that occurred executing the mutation.
Deprecated return fields
-
userErrors (
[UserError!]!
) deprecatedList of errors that occurred executing the mutation.
Deprecation warning
Use
priceRuleUserErrors
instead
Create a price rule using the input.
Required access
write_price_rules
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
priceRule
(
PriceRuleInput!
)
required
|
Input fields to create a price rule. |
priceRuleDiscountCode
(
PriceRuleDiscountCodeInput
)
|
Input fields to create a discount code for the price rule. |
PriceRuleInput fields
-
allocationLimit (
Int
)The maximum number of times that the price rule can be allocated onto an order.
-
allocationMethod (
PriceRuleAllocationMethod
)The method by which the price rule's value is allocated to its entitled items.
-
customerSelection (
PriceRuleCustomerSelectionInput
)The customers that can use this price rule.
-
entitlementToPrerequisiteQuantityRatio (
PriceRuleEntitlementToPrerequisiteQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items. This argument is deprecated: Use
prerequisiteToEntitlementQuantityRatio
instead. -
itemEntitlements (
PriceRuleItemEntitlementsInput
)The items to which the price rule applies.
-
itemPrerequisites (
PriceRuleItemPrerequisitesInput
)The items required for the price rule to be applicable.
-
oncePerCustomer (
Boolean
)Whether the price rule can be applied only once per customer.
-
prerequisiteQuantityRange (
PriceRuleQuantityRangeInput
)The number of the entitled items must fall within this range for the price rule to be applicable.
-
prerequisiteShippingPriceRange (
PriceRuleMoneyRangeInput
)The shipping cost must fall within this range for the price rule to be applicable.
-
prerequisiteSubtotalRange (
PriceRuleMoneyRangeInput
)The sum of the entitled items subtotal prices must fall within this range for the price rule to be applicable.
-
prerequisiteToEntitlementQuantityRatio (
PriceRulePrerequisiteToEntitlementQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items.
-
shippingEntitlements (
PriceRuleShippingEntitlementsInput
)The shipping lines to which the price rule applies.
-
target (
PriceRuleTarget
)The type of lines (line_item or shipping_line) to which the price rule applies.
-
title (
String
)Title of the price rule.
-
usageLimit (
Int
)The maximum number of times that the price rule can be used in total.
-
validityPeriod (
PriceRuleValidityPeriodInput
)PriceRuleValidityPeriod for the price rule.
-
value (
PriceRuleValueInput
)The value of the price rule.
Return fields
-
priceRule (
PriceRule
)The newly created price rule.
-
priceRuleDiscountCode (
PriceRuleDiscountCode
)The newly created discount code.
-
priceRuleUserErrors (
[PriceRuleUserError!]!
)List of errors that occurred executing the mutation.
Deprecated return fields
-
userErrors (
[UserError!]!
) deprecatedList of errors that occurred executing the mutation.
Deprecation warning
Use
priceRuleUserErrors
instead
Create a price rule using the input.
Required access
write_price_rules
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
priceRule
(
PriceRuleInput!
)
required
|
Input fields to create a price rule. |
priceRuleDiscountCode
(
PriceRuleDiscountCodeInput
)
|
Input fields to create a discount code for the price rule. |
PriceRuleInput fields
-
allocationLimit (
Int
)The maximum number of times that the price rule can be allocated onto an order.
-
allocationMethod (
PriceRuleAllocationMethod
)The method by which the price rule's value is allocated to its entitled items.
-
customerSelection (
PriceRuleCustomerSelectionInput
)The customers that can use this price rule.
-
entitlementToPrerequisiteQuantityRatio (
PriceRuleEntitlementToPrerequisiteQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items. This argument is deprecated: Use
prerequisiteToEntitlementQuantityRatio
instead. -
itemEntitlements (
PriceRuleItemEntitlementsInput
)The items to which the price rule applies.
-
itemPrerequisites (
PriceRuleItemPrerequisitesInput
)The items required for the price rule to be applicable.
-
oncePerCustomer (
Boolean
)Whether the price rule can be applied only once per customer.
-
prerequisiteQuantityRange (
PriceRuleQuantityRangeInput
)The number of the entitled items must fall within this range for the price rule to be applicable.
-
prerequisiteShippingPriceRange (
PriceRuleMoneyRangeInput
)The shipping cost must fall within this range for the price rule to be applicable.
-
prerequisiteSubtotalRange (
PriceRuleMoneyRangeInput
)The sum of the entitled items subtotal prices must fall within this range for the price rule to be applicable.
-
prerequisiteToEntitlementQuantityRatio (
PriceRulePrerequisiteToEntitlementQuantityRatioInput
)Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items.
-
shippingEntitlements (
PriceRuleShippingEntitlementsInput
)The shipping lines to which the price rule applies.
-
target (
PriceRuleTarget
)The type of lines (line_item or shipping_line) to which the price rule applies.
-
title (
String
)Title of the price rule.
-
usageLimit (
Int
)The maximum number of times that the price rule can be used in total.
-
validityPeriod (
PriceRuleValidityPeriodInput
)PriceRuleValidityPeriod for the price rule.
-
value (
PriceRuleValueInput
)The value of the price rule.
Return fields
-
priceRule (
PriceRule
)The newly created price rule.
-
priceRuleDiscountCode (
PriceRuleDiscountCode
)The newly created discount code.
-
priceRuleUserErrors (
[PriceRuleUserError!]!
)List of errors that occurred executing the mutation.
Deprecated return fields
-
userErrors (
[UserError!]!
) deprecatedList of errors that occurred executing the mutation.
Deprecation warning
Use
priceRuleUserErrors
instead