Menu
discountAutomaticBxgyUpdate
Updates an existing buy X get Y discount (BXGY) that's automatically applied on a cart and at checkout.
Use it in a workflow
- Add a step and choose the Shopify connector.
- Pick the discountAutomaticBxgyUpdate action (under Discount).
- Fill in the fields below, then reference the result from later steps as
{{discountautomaticbxgyupdate.response.data}}.
Query
This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.
mutation DiscountAutomaticBxgyUpdate($id: ID!, $automaticBxgyDiscount: DiscountAutomaticBxgyInput!) {
discountAutomaticBxgyUpdate(
id: $id
automaticBxgyDiscount: $automaticBxgyDiscount
) {
automaticDiscountNode {
automaticDiscount
id
}
userErrors {
code
extraInfo
field
message
}
}
}
Variables
Pass these as a JSON object in the step's Variables field.
{
"id": "string",
"automaticBxgyDiscount": {
"combinesWith": {
"productDiscounts": false,
"orderDiscounts": false,
"shippingDiscounts": false,
"productDiscountsWithTagsOnSameCartLine": {
"add": "string",
"remove": "string"
}
},
"title": "string",
"startsAt": "string",
"endsAt": "string",
"context": {
"all": "ALL",
"customers": {
"add": "string",
"remove": "string"
},
"customerSegments": {
"add": "string",
"remove": "string"
},
"markets": {
"add": "string",
"remove": "string"
}
},
"tags": [
"string"
],
"usesPerOrderLimit": "string",
"customerBuys": {
"value": {
"quantity": "string",
"amount": "string"
},
"items": {
"products": "string",
"collections": "string",
"all": "string"
},
"isOneTimePurchase": false,
"isSubscription": false
},
"customerGets": {
"value": {
"discountOnQuantity": "string",
"percentage": "string",
"discountAmount": "string"
},
"items": {
"products": "string",
"collections": "string",
"all": "string"
},
"appliesOnOneTimePurchase": false,
"appliesOnSubscription": false
}
}
}
Response
Read the result with {{discountautomaticbxgyupdate.response.data.data.discountAutomaticBxgyUpdate}}. If the API returns errors, the step fails and they are at {{discountautomaticbxgyupdate.response.data.errors}}.
Need more? See the Shopify guide for connection setup and behaviour shared by every action.
Was this page helpful?