Anchor to section titled 'undefined'

discountAutomaticBasicUpdate
mutation

Requires Apps must have write_discounts access scope.

Updates a basic automatic discount.


The input data used to update the automatic discount.

Anchor to id
id
required

The ID of the automatic discount to update.


Was this section helpful?

The updated automatic discount.

The list of errors that occurred from executing the mutation.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation discountAutomaticBasicUpdate($automaticBasicDiscount: DiscountAutomaticBasicInput!, $id: ID!) {
  discountAutomaticBasicUpdate(automaticBasicDiscount: $automaticBasicDiscount, id: $id) {
    automaticDiscountNode {
      # DiscountAutomaticNode fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "automaticBasicDiscount": {
    "combinesWith": {
      "orderDiscounts": true,
      "productDiscounts": true,
      "shippingDiscounts": true
    },
    "customerGets": {
      "appliesOnOneTimePurchase": true,
      "appliesOnSubscription": true,
      "items": {
        "all": true,
        "collections": {
          "add": [
            "gid://shopify/<objectName>/10079785100"
          ],
          "remove": [
            "gid://shopify/<objectName>/10079785100"
          ]
        },
        "products": {
          "productVariantsToAdd": [
            "gid://shopify/<objectName>/10079785100"
          ],
          "productVariantsToRemove": [
            "gid://shopify/<objectName>/10079785100"
          ],
          "productsToAdd": [
            "gid://shopify/<objectName>/10079785100"
          ],
          "productsToRemove": [
            "gid://shopify/<objectName>/10079785100"
          ]
        }
      },
      "value": {
        "discountAmount": {
          "amount": "29.99",
          "appliesOnEachItem": true
        },
        "discountOnQuantity": {
          "effect": {
            "amount": "29.99",
            "percentage": 1.1
          },
          "quantity": "50"
        },
        "percentage": 1.1
      }
    },
    "endsAt": "2019-09-07T15:50:00Z",
    "minimumRequirement": {
      "quantity": {
        "greaterThanOrEqualToQuantity": "50"
      },
      "subtotal": {
        "greaterThanOrEqualToSubtotal": "29.99"
      }
    },
    "recurringCycleLimit": 1,
    "startsAt": "2019-09-07T15:50:00Z",
    "title": "<your-title>"
  },
  "id": "gid://shopify/<objectName>/10079785100"
}
input DiscountAutomaticBasicInput {
  combinesWith: DiscountCombinesWithInput
  customerGets: DiscountCustomerGetsInput
  endsAt: DateTime
  minimumRequirement: DiscountMinimumRequirementInput
  recurringCycleLimit: Int
  startsAt: DateTime
  title: String
}

input DiscountCombinesWithInput {
  orderDiscounts: Boolean
  productDiscounts: Boolean
  shippingDiscounts: Boolean
}

input DiscountCustomerGetsInput {
  appliesOnOneTimePurchase: Boolean
  appliesOnSubscription: Boolean
  items: DiscountItemsInput
  value: DiscountCustomerGetsValueInput
}

input DiscountMinimumRequirementInput {
  quantity: DiscountMinimumQuantityInput
  subtotal: DiscountMinimumSubtotalInput
}