priceRuleDeactivate mutation
Deactivate a price rule.
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.
mutation priceRuleDeactivate($id: ID!) { priceRuleDeactivate(id: $id) {} } { “id”: “Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE=” }
<font style="color:#1F61A0;">priceRule</font> <font style="color:#555555;">{</font><font style="color:#1F61A0;">id</font><font style="color:#555555;">}</font><font style="color:#1F61A0;">priceRuleUserErrors</font> <font style="color:#555555;">{</font><font style="color:#1F61A0;">code</font><font style="color:#1F61A0;">field</font><font style="color:#1F61A0;">message</font><font style="color:#555555;">}</font>
Arguments
| Argument | Description |
|---|---|
id( [ID!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01)) REQUIRED |
ID of the price rule to update. |
Return fields
- priceRule (
[PriceRule](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/pricerule))
The deactivated price rule. - priceRuleUserErrors (
[[PriceRuleUserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/priceruleusererror))
List of errors that occurred executing the mutation.
Deprecated return fields
- userErrors (
[[UserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/usererror)) DEPRECATED
List of errors that occurred executing the mutation.
Deprecation warning
UsepriceRuleUserErrorsinstead
