discountAutomaticBxgyUpdate mutation
Updates a BXGY automatic discount using its ID and input.
Required access
Apps must have write_discounts
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 discountAutomaticBxgyUpdate($id: ID!, $automaticBxgyDiscount: DiscountAutomaticBxgyInput!) { discountAutomaticBxgyUpdate(id: $id, automaticBxgyDiscount: $automaticBxgyDiscount) {} } { “id”: “Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE=”, “automaticBxgyDiscount”: {} }
<font style="color:#1F61A0;">automaticDiscountNode</font> <font style="color:#555555;">{</font>
<font style="color:#1F61A0;">id</font>
<font style="color:#555555;">}</font>
<font style="color:#1F61A0;">userErrors</font> <font style="color:#555555;">{</font>
<font style="color:#1F61A0;">code</font>
<font style="color:#1F61A0;">extraInfo</font>
<font style="color:#1F61A0;">field</font>
<font style="color:#1F61A0;">message</font>
<font style="color:#555555;">}</font>
Arguments
DiscountAutomaticBxgyInput fields
- customerBuys (
[DiscountCustomerBuysInput](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/discountcustomerbuysinput)
)
The qualifying items and the quantity of each one that the customer has to buy to be eligible for the discount. - customerGets (
[DiscountCustomerGetsInput](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/discountcustomergetsinput)
)
The qualifying items in an order, the quantity of each one, and the total value of the discount. - endsAt (
[DateTime](https://shopify.dev/docs/admin-api/graphql/reference/scalar#datetime-2021-01)
)
The date and time when the discount ends. For open-ended discounts, usenull
. - startsAt (
[DateTime](https://shopify.dev/docs/admin-api/graphql/reference/scalar#datetime-2021-01)
)
The date and time when the discount starts. - title (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
)
The title of the discount. - usesPerOrderLimit (
[UnsignedInt64](https://shopify.dev/docs/admin-api/graphql/reference/scalar#unsignedint64-2021-01)
)
The maximum number of times that the discount can be applied to an order.
Return fields
- automaticDiscountNode (
[DiscountAutomaticNode](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/discountautomaticnode)
)
The updated automatic discount. - userErrors (
[[DiscountUserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/discountusererror)
)
List of errors that occurred executing the mutation.