Anchor to section titled 'undefined'

discountAutomaticBxgyCreate
mutation

Requires Apps must have write_discounts access scope.

Creates a BXGY automatic discount.


The input data used to create the automatic discount.


Was this section helpful?

The created automatic discount.

The list of errors that occurred from executing the mutation.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation discountAutomaticBxgyCreate($automaticBxgyDiscount: DiscountAutomaticBxgyInput!) {
  discountAutomaticBxgyCreate(automaticBxgyDiscount: $automaticBxgyDiscount) {
    automaticDiscountNode {
      # DiscountAutomaticNode fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "automaticBxgyDiscount": {
    "combinesWith": {
      "orderDiscounts": true,
      "productDiscounts": true,
      "shippingDiscounts": true
    },
    "customerBuys": {
      "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": {
        "amount": "29.99",
        "quantity": "50"
      }
    },
    "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",
    "startsAt": "2019-09-07T15:50:00Z",
    "title": "<your-title>",
    "usesPerOrderLimit": "50"
  }
}
input DiscountAutomaticBxgyInput {
  combinesWith: DiscountCombinesWithInput
  customerBuys: DiscountCustomerBuysInput
  customerGets: DiscountCustomerGetsInput
  endsAt: DateTime
  startsAt: DateTime
  title: String
  usesPerOrderLimit: UnsignedInt64
}

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

input DiscountCustomerBuysInput {
  items: DiscountItemsInput
  value: DiscountCustomerBuysValueInput
}

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