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
- 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 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 happened.
created_at:>2020-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
- •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.- Anchor to namespacenamespace•String
The container the metafield belongs to. If omitted, the app-reserved namespace will be used.
- •String!required
The key for the metafield.
Arguments
- Anchor to metafieldsmetafields•Metafield
Connection! non-null A list of custom fields that a merchant associates with a Shopify resource.
- Anchor to namespacenamespace•String
The metafield namespace to filter by. If omitted, all metafields are returned.
- Anchor to keyskeys•[String!]
List of keys of metafields in the format
namespace.key, will be returned in the same format.- 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.
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 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 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•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.
- 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:
Arguments
Anchor to QueriesQueries
- •query
Returns a
resource by ID.- •ID!required
The ID of the
to return.
Arguments
- •ID!
- •queryDeprecated
- 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•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.
- 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 status•string
Filter by the discount status.
activeexpiredscheduledstatus:scheduled- Anchor to type•string
Filter by the discount type.
allall_with_appappbxgyfixed_amountpercentagetype:bxgy
Example:
Valid values:
Example:
Valid values:
Example:
- 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 MutationsMutations
- •mutation
Activates an automatic discount.
- •ID!required
The ID of the automatic discount to activate.
Arguments
- •ID!
- •mutation
- Anchor to automaticBasicDiscountautomatic•Discount
Basic Discount Automatic Basic Input! required The input data used to create the automatic amount off discount.
Arguments
- •mutation
- •ID!required
The ID of the automatic amount off discount to update.
- Anchor to automaticBasicDiscountautomatic•Discount
Basic Discount Automatic Basic Input! required The input data used to update the automatic amount off discount.
Arguments
- •ID!
- •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.
- •ID!required
The ID of the automatic BXGY discount to update.
- Anchor to automaticBxgyDiscountautomatic•Discount
Bxgy Discount Automatic Bxgy Input! required The input data used to update the automatic BXGY discount.
Arguments
- •ID!
- •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.
- •ID!required
The ID of the automatic free shipping discount to update.
- Anchor to freeShippingAutomaticDiscountfree•Discount
Shipping Automatic Discount Automatic Free Shipping Input! required The input data used to update the automatic free shipping discount.
Arguments