API version: unstable
API version: 2021-01 Release candidate
API version: 2020-10 Latest
API version: 2020-07
API version: 2020-04
API version: 2020-01
API version: 2019-10 Unsupported
API version: 2019-07 Unsupported

priceRuleDiscountCodeCreate mutation

Version unstable

Create a discount code for a price rule.

Required access

write_price_rules access scope.

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

code ( String! ) required

The code to create for the price rule.

priceRuleId ( ID! ) required

The ID of the price rule object.

Return fields

priceRule (PriceRule)

The updated price rule.

priceRuleDiscountCode (PriceRuleDiscountCode)

The newly created discount code.

priceRuleUserErrors ([PriceRuleUserError!]!)

List of errors that occurred executing the mutation.

Deprecated return fields

userErrors ([UserError!]!) deprecated

List of errors that occurred executing the mutation.

Deprecation warning

Use priceRuleUserErrors instead

Version 2021-01 (Release candidate)

Create a discount code for a price rule.

Required access

write_price_rules access scope.

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

code ( String! ) required

The code to create for the price rule.

priceRuleId ( ID! ) required

The ID of the price rule object.

Return fields

priceRule (PriceRule)

The updated price rule.

priceRuleDiscountCode (PriceRuleDiscountCode)

The newly created discount code.

priceRuleUserErrors ([PriceRuleUserError!]!)

List of errors that occurred executing the mutation.

Deprecated return fields

userErrors ([UserError!]!) deprecated

List of errors that occurred executing the mutation.

Deprecation warning

Use priceRuleUserErrors instead

Version 2020-10 (Latest)

Create a discount code for a price rule.

Required access

write_price_rules access scope.

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

code ( String! ) required

The code to create for the price rule.

priceRuleId ( ID! ) required

The ID of the price rule object.

Return fields

priceRule (PriceRule)

The updated price rule.

priceRuleDiscountCode (PriceRuleDiscountCode)

The newly created discount code.

priceRuleUserErrors ([PriceRuleUserError!]!)

List of errors that occurred executing the mutation.

Deprecated return fields

userErrors ([UserError!]!) deprecated

List of errors that occurred executing the mutation.

Deprecation warning

Use priceRuleUserErrors instead

Version 2020-07

Create a discount code for a price rule.

Required access

write_price_rules access scope.

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

code ( String! ) required

The code to create for the price rule.

priceRuleId ( ID! ) required

The ID of the price rule object.

Return fields

priceRule (PriceRule)

The updated price rule.

priceRuleDiscountCode (PriceRuleDiscountCode)

The newly created discount code.

priceRuleUserErrors ([PriceRuleUserError!]!)

List of errors that occurred executing the mutation.

Deprecated return fields

userErrors ([UserError!]!) deprecated

List of errors that occurred executing the mutation.

Deprecation warning

Use priceRuleUserErrors instead

Version 2020-04

Create a discount code for a price rule.

Required access

write_price_rules access scope.

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

code ( String! ) required

The code to create for the price rule.

priceRuleId ( ID! ) required

The ID of the price rule object.

Return fields

priceRule (PriceRule)

The updated price rule.

priceRuleDiscountCode (PriceRuleDiscountCode)

The newly created discount code.

priceRuleUserErrors ([PriceRuleUserError!]!)

List of errors that occurred executing the mutation.

Deprecated return fields

userErrors ([UserError!]!) deprecated

List of errors that occurred executing the mutation.

Deprecation warning

Use priceRuleUserErrors instead

Version 2020-01

Create a discount code for a price rule.

Required access

write_price_rules access scope.

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

code ( String! ) required

The code to create for the price rule.

priceRuleId ( ID! ) required

The ID of the price rule object.

Return fields

priceRule (PriceRule)

The updated price rule.

priceRuleDiscountCode (PriceRuleDiscountCode)

The newly created discount code.

priceRuleUserErrors ([PriceRuleUserError!]!)

List of errors that occurred executing the mutation.

Deprecated return fields

userErrors ([UserError!]!) deprecated

List of errors that occurred executing the mutation.

Deprecation warning

Use priceRuleUserErrors instead

Version 2019-10 (Unsupported)

Create a discount code for a price rule.

Required access

write_price_rules access scope.

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

code ( String! ) required

The code to create for the price rule.

priceRuleId ( ID! ) required

The ID of the price rule object.

Return fields

priceRule (PriceRule)

The updated price rule.

priceRuleDiscountCode (PriceRuleDiscountCode)

The newly created discount code.

priceRuleUserErrors ([PriceRuleUserError!]!)

List of errors that occurred executing the mutation.

Deprecated return fields

userErrors ([UserError!]!) deprecated

List of errors that occurred executing the mutation.

Deprecation warning

Use priceRuleUserErrors instead

Version 2019-07 (Unsupported)

Create a discount code for a price rule.

Required access

write_price_rules access scope.

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

code ( String! ) required

The code to create for the price rule.

priceRuleId ( ID! ) required

The ID of the price rule object.

Return fields

priceRule (PriceRule)

The updated price rule.

priceRuleDiscountCode (PriceRuleDiscountCode)

The newly created discount code.

priceRuleUserErrors ([PriceRuleUserError!]!)

List of errors that occurred executing the mutation.

Deprecated return fields

userErrors ([UserError!]!) deprecated

List of errors that occurred executing the mutation.

Deprecation warning

Use priceRuleUserErrors instead

Version 2019-04 (Unsupported)

Create a discount code for a price rule.

Required access

write_price_rules access scope.

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

code ( String! ) required

The code to create for the price rule.

priceRuleId ( ID! ) required

The ID of the price rule object.

Return fields

priceRule (PriceRule)

The updated price rule.

priceRuleDiscountCode (PriceRuleDiscountCode)

The newly created discount code.

priceRuleUserErrors ([PriceRuleUserError!]!)

List of errors that occurred executing the mutation.

Deprecated return fields

userErrors ([UserError!]!) deprecated

List of errors that occurred executing the mutation.

Deprecation warning

Use priceRuleUserErrors instead