Skip to main content
Anchor to DiscountAutomaticNode

DiscountAutomaticNode

object

Requires Apps must have read_discounts access scope.

The DiscountAutomaticNode 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.

•DiscountAutomatic!
non-null

A discount that's applied automatically when an order meets specific criteria. Learn more about automatic discounts.

•EventConnection!
non-null

The paginated list of events associated with the host subject.

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.

•EventSortKeys
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.

•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.

•string

The action that occured.

Example:

  • action:create
Anchor to comments
•boolean

Whether or not to include comment-events in your search, passing false will exclude comment-events, any other value will include comment-events.

Example:

  • false
  • true
Anchor to created_at
•time

Filter by the date and time when the event happened.

Example:

  • created_at:>2020-10-21
  • created_at:<now
•id

Filter by id range.

Example:

  • id:1234
  • id:>=1234
  • id:<=1234
Anchor to subject_type
•string

The resource type affected by this event. See EventSubjectType for possible values.

Example:

  • PRODUCT_VARIANT
  • PRODUCT
  • COLLECTION

•ID!
non-null

A globally-unique ID.

•Metafield

A custom field, including its namespace and key, that's associated with a Shopify resource for the purposes of adding and storing additional information.

Arguments

•String

The container the metafield belongs to. If omitted, the app-reserved namespace will be used.

•String!
required

The key for the metafield.


•MetafieldConnection!
non-null

A list of custom fields that a merchant associates with a Shopify resource.

Arguments

•String

The metafield namespace to filter by. If omitted, all metafields are returned.

•[String!]

List of keys of metafields in the format namespace.key, will be returned in the same format.

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.


Anchor to metafieldsByIdentifiersmetafieldsByIdentifiers
•[Metafield]!
non-null

The metafields associated with the resource matching the supplied list of namespaces and keys.

Arguments

•[HasMetafieldsIdentifier!]!
required

The list of metafields to retrieve by namespace and key.


Anchor to metafieldDefinitionsmetafieldDefinitions
•MetafieldDefinitionConnection!
non-nullDeprecated

Arguments

•String

Filter metafield definitions by namespace.

•MetafieldDefinitionPinnedStatus
Default:ANY

Filter by the definition's pinned status.

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.

•MetafieldDefinitionSortKeys
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.

•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.

Example:

  • query=Bob Norman
  • query=title:green hoodie
Anchor to created_at
•time

Filter by the date and time when the metafield definition was created.

Example:

  • created_at:>2020-10-21T23:39:20Z
  • created_at:<now
  • created_at:<=2024
•id

Filter by id range.

Example:

  • id:1234
  • id:>=1234
  • id:<=1234
•string

Filter by the metafield definition key field.

Example:

  • key:some-key
Anchor to namespace
•string

Filter by the metafield definition namespace field.

Example:

  • namespace:some-namespace
Anchor to owner_type
•string

Filter by the metafield definition ownerType field.

Example:

  • owner_type:PRODUCT
•string

Filter by the metafield definition type field.

Example:

  • type:single_line_text_field
Anchor to updated_at
•time

Filter by the date and time when the metafield definition was last updated.

Example:

  • updated_at:>2020-10-21T23:39:20Z
  • updated_at:<now
  • updated_at:<=2024


Was this section helpful?

•query

Returns a DiscountAutomaticNode resource by ID.

Arguments

•ID!
required

The ID of the DiscountAutomaticNode to return.


•query
Deprecated

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.

•AutomaticDiscountSortKeys
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.

•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.

Example:

  • query=Bob Norman
  • query=title:green hoodie
•id

Filter by id range.

Example:

  • id:1234
  • id:>=1234
  • id:<=1234
•string

Filter by the discount status.

Valid values:

  • active
  • expired
  • scheduled

Example:

  • status:scheduled
•string

Filter by the discount type.

Valid values:

  • all
  • all_with_app
  • app
  • bxgy
  • fixed_amount
  • percentage

Example:

  • type:bxgy
•ID

The ID of a saved search. The search’s query string is used as the query argument.



Was this section helpful?

•mutation

Activates an automatic discount.

Arguments

•ID!
required

The ID of the automatic discount to activate.


•mutation

Creates an amount off discount that's automatically applied on a cart and at checkout.


Note

To create code discounts, use the discountCodeBasicCreate mutation.


Arguments

Anchor to automaticBasicDiscountautomaticBasicDiscount
•DiscountAutomaticBasicInput!
required

The input data used to create the automatic amount off discount.


•mutation

Updates an existing amount off discount that's automatically applied on a cart and at checkout.


Note

To update code discounts, use the discountCodeBasicUpdate mutation instead.


Arguments

•ID!
required

The ID of the automatic amount off discount to update.

Anchor to automaticBasicDiscountautomaticBasicDiscount
•DiscountAutomaticBasicInput!
required

The input data used to update the automatic amount off discount.


•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 discountCodeBxgyCreate mutation.


Arguments

Anchor to automaticBxgyDiscountautomaticBxgyDiscount
•DiscountAutomaticBxgyInput!
required

The input data used to create the automatic BXGY discount.


•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 discountCodeBxgyUpdate mutation instead.


Arguments

•ID!
required

The ID of the automatic BXGY discount to update.

Anchor to automaticBxgyDiscountautomaticBxgyDiscount
•DiscountAutomaticBxgyInput!
required

The input data used to update the automatic BXGY discount.


•mutation

Deactivates an automatic discount.

Arguments

•ID!
required

The ID of the automatic discount to deactivate.


•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 DiscountAutomaticFreeShippingCreate 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.

Arguments

Anchor to freeShippingAutomaticDiscountfreeShippingAutomaticDiscount
•DiscountAutomaticFreeShippingInput!
required

The input data used to create the automatic free shipping discount.


•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 DiscountAutomaticFreeShippingUpdate 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.

Arguments

•ID!
required

The ID of the automatic free shipping discount to update.

Anchor to freeShippingAutomaticDiscountfreeShippingAutomaticDiscount
•DiscountAutomaticFreeShippingInput!
required

The input data used to update the automatic free shipping discount.



Was this section helpful?