Discount Automatic Bxgy
Requires Apps must have access scope.
The object lets you manage
buy X get Y discounts (BXGY)
that are automatically applied on a cart and at checkout. BXGY discounts incentivize customers by offering
them additional items at a discounted price or for free when they purchase a specified quantity of items.
The object stores information about automatic BXGY discounts that apply to
specific products and variants,
collections,
or all items in a cart.
Learn more about working with Shopify's discount model, including limitations and considerations.
Note: The <a href="https://shopify.dev/docs/api/admin-graphql/latest/objects/DiscountCodeBxgy"><code><span class="PreventFireFoxApplyingGapToWBR">Discount<wbr/>Code<wbr/>Bxgy</span></code></a> object has similar functionality to the <code><span class="PreventFireFoxApplyingGapToWBR">Discount<wbr/>Automatic<wbr/>Bxgy</span></code> object, but customers need to enter a code to receive a discount.</p> <p>API versions prior to <code>2025-10</code> only return automatic discounts with <code>context</code> set to <code>all</code>, discounts with other values are filtered out.
Anchor to FieldsFields
- asyncUsageCount (Int!)
- combinesWith (DiscountCombinesWith!)
- context (DiscountContext!)
- createdAt (DateTime!)
- customerBuys (DiscountCustomerBuys!)
- customerGets (DiscountCustomerGets!)
- discountClasses ([DiscountClass!]!)
- endsAt (DateTime)
- events (EventConnection!)
- startsAt (DateTime!)
- status (DiscountStatus!)
- summary (String!)
- title (String!)
- updatedAt (DateTime!)
- usesPerOrderLimit (Int)
- Anchor to asyncUsageCountasync•Int!
Usage Count non-null The number of times that the discount has been used. For example, if a "Buy 3, Get 1 Free" t-shirt discount is automatically applied in 200 transactions, then the discount has been used 200 times. This value is updated asynchronously. As a result, it might be lower than the actual usage count until the asynchronous process is completed.
- Anchor to combinesWithcombines•Discount
With Combines With! non-null The discount classes that you can use in combination with Shopify discount types.
- Anchor to contextcontext•Discount
Context! non-null The context defining which buyers can use the discount.
- Anchor to createdAtcreated•Date
At Time! non-null The date and time when the discount was created.
- Anchor to customerBuyscustomer•Discount
Buys Customer Buys! non-null The items eligible for the discount and the required quantity of each to receive the discount.
- Anchor to customerGetscustomer•Discount
Gets Customer Gets! non-null The items in the order that qualify for the discount, their quantities, and the total value of the discount.
- Anchor to discountClassesdiscount•[Discount
Classes Class!]! non-null The classes of the discount.
- Anchor to endsAtends•Date
At Time The date and time when the discount expires and is no longer available to customers. For discounts without a fixed expiration date, specify
null.- Anchor to eventsevents•Event
Connection! non-null The paginated list of events associated with the host subject.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Event
Key Sort Keys Default:ID Sort the underlying list using a key. If your query is slow or returns an error, then try specifying a sort key that matches the field used in the search.
- Anchor to queryquery•String
A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.
- Anchor to comments•boolean
Whether or not to include comment-events in your search, passing
falsewill exclude comment-events, any other value will include comment-events.falsetrue- Anchor to created_at•time
Filter by the date and time when the event occurred. Event data is retained for 1 year.
created_at:>2025-10-21created_at:<now- Anchor to subject_type•string
The resource type affected by this event. See EventSubjectType for possible values.
PRODUCT_VARIANTPRODUCTCOLLECTION
Example:
Example:
Example:
Arguments
- Anchor to startsAtstarts•Date
At Time! non-null The date and time when the discount becomes active and is available to customers.
- Anchor to statusstatus•Discount
Status! non-null The status of the discount that describes its availability, expiration, or pending activation.
- Anchor to summarysummary•String!non-null
A detailed explanation of what the discount is, who can use it, when and where it applies, and any associated rules or limitations.
- Anchor to titletitle•String!non-null
The discount's name that displays to merchants in the Shopify admin and to customers.
- Anchor to updatedAtupdated•Date
At Time! non-null The date and time when the discount was updated.
- Anchor to usesPerOrderLimituses•Int
Per Order Limit The maximum number of times that the discount can be applied to an order.
Deprecated fields
- discountClass (MerchandiseDiscountClass!): deprecated
- id (ID!): deprecated
- usageCount (Int!): deprecated
- Anchor to discountClassdiscount•Merchandise
Class Discount Class! non-nullDeprecated - •ID!non-nullDeprecated
- Anchor to usageCountusage•Int!
Count non-nullDeprecated