Anchor to section titled 'undefined'

automaticDiscountNode
query

Returns an automatic discount resource by ID.


Anchor to id
id
required

The ID of the DiscountAutomaticNode to return.


Was this section helpful?

Anchor to DiscountAutomaticNode
DiscountAutomaticNode
Access requirements

A node containing an automatic discount and its related events.


Was this section helpful?
#automaticDiscountNode returns an automatic discount node for a given ID
Hide code
DescriptionCopy
query {
  automaticDiscountNode(id: "gid://shopify/DiscountAutomaticNode/299501151") {
    ... on DiscountAutomaticNode {
      id
    }
    automaticDiscount {
      ... on DiscountAutomaticBasic {
        title
        summary
        customerGets {
          items {
            ... on AllDiscountItems {
              allItems
            }
          }
        }
      }
    }
  }
}
Hide code
Response
JSON
{
  "automaticDiscountNode": {
    "id": "gid://shopify/DiscountAutomaticNode/299501151",
    "automaticDiscount": {
      "title": "My automatic discount",
      "summary": "$100.00 off entire order • Minimum quantity of 1",
      "customerGets": {
        "items": {
          "allItems": true
        }
      }
    }
  }
}