Discount Code Bxgy
Requires Apps must have access scope.
The object lets you manage
buy X get Y discounts (BXGY)
that are applied on a cart and at checkout when a customer enters a code. 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 BXGY code 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/DiscountAutomaticBxgy"><code><span class="PreventFireFoxApplyingGapToWBR">Discount<wbr/>Automatic<wbr/>Bxgy</span></code></a> object has similar functionality to the <code><span class="PreventFireFoxApplyingGapToWBR">Discount<wbr/>Code<wbr/>Bxgy</span></code> object, but discounts are automatically applied, without the need for customers to enter a code.
Anchor to FieldsFields
- appliesOncePerCustomer (Boolean!)
- asyncUsageCount (Int!)
- codes (DiscountRedeemCodeConnection!)
- codesCount (Count)
- combinesWith (DiscountCombinesWith!)
- context (DiscountContext!)
- createdAt (DateTime!)
- customerBuys (DiscountCustomerBuys!)
- customerGets (DiscountCustomerGets!)
- discountClasses ([DiscountClass!]!)
- endsAt (DateTime)
- hasTimelineComment (Boolean!)
- shareableUrls ([DiscountShareableUrl!]!)
- shortSummary (String!)
- startsAt (DateTime!)
- status (DiscountStatus!)
- summary (String!)
- title (String!)
- totalSales (MoneyV2)
- updatedAt (DateTime!)
- usageLimit (Int)
- usesPerOrderLimit (Int)
- Anchor to appliesOncePerCustomerapplies•Boolean!
Once Per Customer non-null Whether a customer can only use the discount once.
- 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 codescodes•Discount
Redeem Code Connection! non-null A list codes that customers can use to redeem the discount.
- 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•Discount
Key Code 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 savedSearchIdsaved•ID
Search Id The ID of a saved search. The search’s query string is used as the query argument.
Arguments
- Anchor to codesCountcodes•Count
Count The number of codes that a customer can use to redeem the discount.
- 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 hasTimelineCommenthas•Boolean!
Timeline Comment non-null Whether there are timeline comments associated with the discount.
- •[Discount
Shareable Url!]! non-null A list of URLs that the app can use to share the discount.
- Anchor to shortSummaryshort•String!
Summary non-null An abbreviated version of the discount
summaryfield.- 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 totalSalestotal•Money
Sales V2 The total sales from orders where the discount was used.
- Anchor to updatedAtupdated•Date
At Time! non-null The date and time when the discount was updated.
- Anchor to usageLimitusage•Int
Limit The maximum number of times the discount can be redeemed. For unlimited usage, specify
null.- Anchor to usesPerOrderLimituses•Int
Per Order Limit The maximum number of times that the discount can be applied to an order.
Deprecated fields
- customerSelection (DiscountCustomerSelection!): deprecated
- discountClass (MerchandiseDiscountClass!): deprecated
- Anchor to customerSelectioncustomer•Discount
Selection Customer Selection! non-nullDeprecated - Anchor to discountClassdiscount•Merchandise
Class Discount Class! non-nullDeprecated