Discount Automatic Node
Requires Apps must have access scope.
The object enables you to manage automatic discounts
that are applied when an order meets specific criteria. You can create amount
off, free shipping, or buy X get Y automatic discounts. For example, you can
offer customers a free shipping discount that applies when conditions are met.
Or you can offer customers a buy X get Y discount that's automatically applied
when customers spend a specified amount of money, or a specified quantity of products.
Learn more about working with Shopify's discount model, including related queries, mutations, limitations, and considerations.
Anchor to FieldsFields
- automaticDiscount (DiscountAutomatic!)
- events (EventConnection!)
- id (ID!)
- metafield (Metafield)
- metafields (MetafieldConnection!)
- metafieldsByIdentifiers ([Metafield]!)
- metafieldDefinitions (MetafieldDefinitionConnection!): deprecated
- Anchor to automaticDiscountautomatic•Discount
Discount Automatic! non-null A discount that's applied automatically when an order meets specific criteria. Learn more about automatic discounts.
- Anchor to eventsevents•Event
Connection! non-null The paginated list of events associated with the host subject.
- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to lastlast•Int
The last
nelements from the paginated list.- 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:
- 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.
Arguments
- •ID!non-null
A globally-unique ID.
- Anchor to metafieldmetafield•Metafield
A custom field, including its
namespaceandkey, that's associated with a Shopify resource for the purposes of adding and storing additional information.- •String!required
The key for the metafield.
- Anchor to namespacenamespace•String
The container the metafield belongs to. If omitted, the app-reserved namespace will be used.
Arguments
- •String!
- Anchor to metafieldsmetafields•Metafield
Connection! non-null A list of custom fields that a merchant associates with a Shopify resource.
- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to keyskeys•[String!]
List of keys of metafields in the format
namespace.key, will be returned in the same format.- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to namespacenamespace•String
The metafield namespace to filter by. If omitted, all metafields are returned.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
Arguments
- Anchor to metafieldsByIdentifiersmetafields•[Metafield]!
By Identifiers non-null The metafields associated with the resource matching the supplied list of namespaces and keys.
- Anchor to identifiersidentifiers•[Has
Metafields Identifier!]! required The list of metafields to retrieve by namespace and key.
Arguments
- Anchor to metafieldDefinitionsmetafield•Metafield
Definitions Definition Connection! non-nullDeprecated - Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to namespacenamespace•String
Filter metafield definitions by namespace.
- Anchor to pinnedStatuspinned•Metafield
Status Definition Pinned Status Default:ANY Filter by the definition's pinned status.
- 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 default•string
Filter by a case-insensitive search of multiple fields in a document.
query=Bob Normanquery=title:green hoodie- Anchor to created_at•time
Filter by the date and time when the metafield definition was created.
created_at:>2020-10-21T23:39:20Zcreated_at:<nowcreated_at:<=2024- Anchor to namespace•string
Filter by the metafield definition
namespacefield.namespace:some-namespace- Anchor to type•string
Filter by the metafield definition
typefield.type:single_line_text_field- Anchor to updated_at•time
Filter by the date and time when the metafield definition was last updated.
updated_at:>2020-10-21T23:39:20Zupdated_at:<nowupdated_at:<=2024
Example:
Example:
Example:
Example:
Example:
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Metafield
Key Definition 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.
Arguments
Anchor to QueriesQueries
- automaticDiscountNode (DiscountAutomaticNode)
- automaticDiscountNodes (DiscountAutomaticNodeConnection!): deprecated
- •query
Returns a
resource by ID.- •ID!required
The ID of the
to return.
Arguments
- •ID!
- •queryDeprecated
- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to lastlast•Int
The last
nelements from the paginated list.- 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 default•string
Filter by a case-insensitive search of multiple fields in a document.
query=Bob Normanquery=title:green hoodie- •string
Filter by a combines with tag applied to discounts on the same cart line. Supports multiple tags separated by commas (e.g., combines_with.product_discounts_with_tags_on_same_cart_line:priority,exclusive).
combines_with.product_discounts_with_tags_on_same_cart_line:prioritycombines_with.product_discounts_with_tags_on_same_cart_line:priority,exclusive- Anchor to status•string
Filter by the discount status.
activeexpiredscheduledstatus:scheduled- Anchor to type•string
Filter by the discount type.
allall_with_appappbxgyfixed_amountpercentagetype:bxgy
Example:
Example:
Valid values:
Example:
Valid values:
Example:
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to savedSearchIdsaved•ID
Search Id The ID of a saved search. The search’s query string is used as the query argument.
- Anchor to sortKeysort•Automatic
Key Discount 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.
Arguments
Anchor to MutationsMutations
- discountAutomaticActivate (DiscountAutomaticActivatePayload)
- discountAutomaticBasicCreate (DiscountAutomaticBasicCreatePayload)
- discountAutomaticBasicUpdate (DiscountAutomaticBasicUpdatePayload)
- discountAutomaticBxgyCreate (DiscountAutomaticBxgyCreatePayload)
- discountAutomaticBxgyUpdate (DiscountAutomaticBxgyUpdatePayload)
- discountAutomaticDeactivate (DiscountAutomaticDeactivatePayload)
- discountAutomaticFreeShippingCreate (DiscountAutomaticFreeShippingCreatePayload)
- discountAutomaticFreeShippingUpdate (DiscountAutomaticFreeShippingUpdatePayload)
- •mutation
Activates an automatic discount.
- •ID!required
The ID of the automatic discount to activate.
Arguments
- •ID!
- •mutation
Creates an amount off discount that's automatically applied on a cart and at checkout.
Note: To create code discounts, use the <a href="https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountCodeBasicCreate"><code><span class="PreventFireFoxApplyingGapToWBR">discount<wbr/>Code<wbr/>Basic<wbr/>Create</span></code></a> mutation.
- Anchor to automaticBasicDiscountautomatic•Discount
Basic Discount Automatic Basic Input! required The input data used to create the automatic amount off discount.
Arguments
- •mutation
Updates an existing amount off discount that's automatically applied on a cart and at checkout.
Note: To update code discounts, use the <a href="https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountCodeBasicUpdate"><code><span class="PreventFireFoxApplyingGapToWBR">discount<wbr/>Code<wbr/>Basic<wbr/>Update</span></code></a> mutation instead.
- Anchor to automaticBasicDiscountautomatic•Discount
Basic Discount Automatic Basic Input! required The input data used to update the automatic amount off discount.
- •ID!required
The ID of the automatic amount off discount to update.
Arguments
- •mutation
Creates a buy X get Y discount (BXGY) that's automatically applied on a cart and at checkout.
Note: To create code discounts, use the <a href="https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountCodeBxgyCreate"><code><span class="PreventFireFoxApplyingGapToWBR">discount<wbr/>Code<wbr/>Bxgy<wbr/>Create</span></code></a> mutation.
- Anchor to automaticBxgyDiscountautomatic•Discount
Bxgy Discount Automatic Bxgy Input! required The input data used to create the automatic BXGY discount.
Arguments
- •mutation
Updates an existing buy X get Y discount (BXGY) that's automatically applied on a cart and at checkout.
Note: To update code discounts, use the <a href="https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountCodeBxgyUpdate"><code><span class="PreventFireFoxApplyingGapToWBR">discount<wbr/>Code<wbr/>Bxgy<wbr/>Update</span></code></a> mutation instead.
- Anchor to automaticBxgyDiscountautomatic•Discount
Bxgy Discount Automatic Bxgy Input! required The input data used to update the automatic BXGY discount.
- •ID!required
The ID of the automatic BXGY discount to update.
Arguments
- •mutation
Deactivates an automatic discount.
- •ID!required
The ID of the automatic discount to deactivate.
Arguments
- •ID!
- •mutation
Creates automatic free shipping discounts that apply to qualifying orders without requiring discount codes. These promotions automatically activate when customers meet specified criteria, streamlining the checkout experience.
For example, a store might create an automatic free shipping discount for orders over variable pricing to encourage larger purchases, or offer free shipping to specific customer segments during promotional periods.
Use
to:- Set up code-free shipping promotions
- Create order value-based shipping incentives
- Target specific customer groups with shipping benefits
- Establish location-based shipping discounts
The mutation validates discount configuration and returns the created automatic discount node along with any configuration errors that need resolution.
Learn more about automatic discounts.
- Anchor to freeShippingAutomaticDiscountfree•Discount
Shipping Automatic Discount Automatic Free Shipping Input! required The input data used to create the automatic free shipping discount.
Arguments
- •mutation
Updates existing automatic free shipping discounts, allowing merchants to modify promotion criteria, shipping destinations, and eligibility requirements without recreating the entire discount structure.
For example, extending a holiday free shipping promotion to include additional countries, adjusting the minimum order value threshold, or expanding customer eligibility to include new segments.
Use
to:- Modify shipping discount thresholds and criteria
- Expand or restrict geographic availability
- Update customer targeting and eligibility rules
- Adjust promotion timing and activation periods
Changes take effect immediately for new orders, while the mutation validates all modifications and reports any configuration conflicts through user errors.
Learn more about managing automatic discounts.
- Anchor to freeShippingAutomaticDiscountfree•Discount
Shipping Automatic Discount Automatic Free Shipping Input! required The input data used to update the automatic free shipping discount.
- •ID!required
The ID of the automatic free shipping discount to update.
Arguments
Anchor to InterfacesInterfaces
- HasEvents
- HasMetafieldDefinitions
- HasMetafields
- Node
- •interface
- •interface
- •interface