Discount User Error
An error that occurs during the execution of a discount mutation.
Anchor to FieldsFields
- Anchor to codecode•Discount
Error Code The error code.
- Anchor to extraInfoextra•String
Info Extra information about this error.
- Anchor to fieldfield•[String!]
The path to the input field that caused the error.
- Anchor to messagemessage•String!non-null
The error message.
Anchor to MutationsMutations
- •mutation
Activates an automatic discount.
- •ID!required
The ID of the automatic discount to activate.
Arguments
- Anchor to automaticDiscountNodeautomatic•Discount
Discount Node Automatic Node The activated automatic discount.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Creates an automatic discount that's managed by an app. Use this mutation with Shopify Functions when you need advanced, custom, or dynamic discount capabilities that aren't supported by Shopify's native discount types.
For example, use this mutation to create an automatic discount using an app's "Volume" discount type that applies a percentage off when customers purchase more than the minimum quantity of a product. For an example implementation, refer to our tutorial.
- Anchor to automaticAppDiscountautomatic•Discount
App Discount Automatic App Input!required The input data used to create the automatic discount.
Arguments
- Anchor to automaticAppDiscountautomatic•Discount
App Discount Automatic App The automatic discount that the app manages.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Updates an existing automatic discount that's managed by an app using Shopify Functions. Use this mutation when you need advanced, custom, or dynamic discount capabilities that aren't supported by Shopify's native discount types.
For example, use this mutation to update a new "Volume" discount type that applies a percentage off when customers purchase more than the minimum quantity of a product. For an example implementation, refer to our tutorial.
- Anchor to automaticAppDiscountautomatic•Discount
App Discount Automatic App Input!required The input fields required to update the automatic discount.
- •ID!required
The ID of the automatic discount to update.
Arguments
- Anchor to automaticAppDiscountautomatic•Discount
App Discount Automatic App The updated automatic discount that the app provides.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
- Anchor to automaticBasicDiscountautomatic•Discount
Basic Discount Automatic Basic Input!required The input data used to create the automatic amount off discount.
Arguments
- Anchor to automaticDiscountNodeautomatic•Discount
Discount Node Automatic Node The automatic discount that was created.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
- 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
- Anchor to automaticDiscountNodeautomatic•Discount
Discount Node Automatic Node The automatic discount that was updated.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Asynchronously delete automatic discounts in bulk if a
search
orargument is provided or if a maximum discount threshold is reached (1,000). Otherwise, deletions will occur inline. Warning: All automatic discounts will be deleted if a blank
search
argument is provided.- •[ID!]
The IDs of the automatic discounts to delete.
- Anchor to savedSearchIdsaved•ID
Search Id The ID of the saved search to use for filtering automatic discounts to delete.
- Anchor to searchsearch•String
The search query for filtering automatic discounts to delete.
For more information on the list of supported fields and search syntax, refer to the AutomaticDiscountNodes query section.
Arguments
- •Job
The asynchronous job removing the automatic discounts.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
- Anchor to automaticBxgyDiscountautomatic•Discount
Bxgy Discount Automatic Bxgy Input!required The input data used to create the automatic BXGY discount.
Arguments
- Anchor to automaticDiscountNodeautomatic•Discount
Discount Node Automatic Node The automatic discount that was created.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Updates an existing buy X get Y discount (BXGY) that's automatically applied on a cart and at checkout.
- 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
- Anchor to automaticDiscountNodeautomatic•Discount
Discount Node Automatic Node The automatic discount that was updated.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Deactivates an automatic discount.
- •ID!required
The ID of the automatic discount to deactivate.
Arguments
- Anchor to automaticDiscountNodeautomatic•Discount
Discount Node Automatic Node The deactivated automatic discount.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Deletes an automatic discount.
- •ID!required
The ID of the automatic discount to delete.
Arguments
- Anchor to deletedAutomaticDiscountIddeleted•ID
Automatic Discount Id The ID of the automatic discount that was deleted.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
- Anchor to freeShippingAutomaticDiscountfree•Discount
Shipping Automatic Discount Automatic Free Shipping Input!required The input data used to create the automatic free shipping discount.
Arguments
- Anchor to automaticDiscountNodeautomatic•Discount
Discount Node Automatic Node The automatic free shipping discount that was created.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
- 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 automaticDiscountNodeautomatic•Discount
Discount Node Automatic Node The automatic discount that was updated.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Activates a code discount.
- •ID!required
The ID of the code discount to activate.
Arguments
- Anchor to codeDiscountNodecode•Discount
Discount Node Code Node The activated code discount.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Creates a code discount. The discount type must be provided by an app extension that uses Shopify Functions. Functions can implement order, product, or shipping discount functions. Use this mutation with Shopify Functions when you need custom logic beyond Shopify's native discount types.
For example, use this mutation to create a code discount using an app's "Volume" discount type that applies a percentage off when customers purchase more than the minimum quantity of a product. For an example implementation, refer to our tutorial.
- Anchor to codeAppDiscountcode•Discount
App Discount Code App Input!required The input data used to create the discount.
Arguments
- Anchor to codeAppDiscountcode•Discount
App Discount Code App The discount that the app provides.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Updates a code discount, where the discount type is provided by an app extension that uses Shopify Functions. Use this mutation when you need advanced, custom, or dynamic discount capabilities that aren't supported by Shopify's native discount types.
- Anchor to codeAppDiscountcode•Discount
App Discount Code App Input!required The input fields required to update the discount.
- •ID!required
The ID of the discount to update.
Arguments
- Anchor to codeAppDiscountcode•Discount
App Discount Code App The updated discount that the app provides.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Creates an amount off discount that's applied on a cart and at checkout when a customer enters a code. Amount off discounts can be a percentage off or a fixed amount off.
- Anchor to basicCodeDiscountbasic•Discount
Code Discount Code Basic Input!required The input data used to create the discount code.
Arguments
- Anchor to codeDiscountNodecode•Discount
Discount Node Code Node The discount code that was created.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Updates an amount off discount that's applied on a cart and at checkout when a customer enters a code. Amount off discounts can be a percentage off or a fixed amount off.
- Anchor to basicCodeDiscountbasic•Discount
Code Discount Code Basic Input!required The input data used to update the discount code.
- •ID!required
The ID of the discount code to update.
Arguments
- Anchor to codeDiscountNodecode•Discount
Discount Node Code Node The discount code that was updated.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Activates multiple code discounts asynchronously using one of the following:
- A search query
- A saved search ID
- A list of discount code IDs
For example, you can activate discounts for all codes that match a search criteria, or activate a predefined set of discount codes.
- •[ID!]
The IDs of the discounts to activate.
- Anchor to savedSearchIdsaved•ID
Search Id The ID of the saved search for filtering discounts to activate. Saved searches represent customer segments that merchants have built in the Shopify admin.
- Anchor to searchsearch•String
Arguments
- •Job
The asynchronous job that activates the discounts.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Deactivates multiple code-based discounts asynchronously using one of the following:
- A search query
- A saved search ID
- A list of discount code IDs
For example, you can deactivate discounts for all codes that match a search criteria, or deactivate a predefined set of discount codes.
- •[ID!]
The IDs of the discounts to deactivate.
- Anchor to savedSearchIdsaved•ID
Search Id The ID of the saved search for filtering discounts to deactivate. Saved searches represent customer segments that merchants have built in the Shopify admin.
- Anchor to searchsearch•String
Arguments
- •Job
The asynchronous job that deactivates the discounts.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Deletes multiple code-based discounts asynchronously using one of the following:
- A search query
- A saved search ID
- A list of discount code IDs
For example, you can delete discounts for all codes that match a search criteria, or delete a predefined set of discount codes.
- •[ID!]
The IDs of the discounts to delete.
- Anchor to savedSearchIdsaved•ID
Search Id The ID of the saved search for filtering discounts to delete. Saved searches represent customer segments that merchants have built in the Shopify admin.
- Anchor to searchsearch•String
Arguments
- •Job
The asynchronous job that deletes the discounts.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Creates a buy X get Y discount (BXGY) that's applied on a cart and at checkout when a customer enters a code.
- Anchor to bxgyCodeDiscountbxgy•Discount
Code Discount Code Bxgy Input!required The input data used to create the BXGY code discount.
Arguments
- Anchor to codeDiscountNodecode•Discount
Discount Node Code Node The code discount that was created.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Updates a buy X get Y discount (BXGY) that's applied on a cart and at checkout when a customer enters a code.
- Anchor to bxgyCodeDiscountbxgy•Discount
Code Discount Code Bxgy Input!required The input data used to update the BXGY code discount.
- •ID!required
The ID of the BXGY code discount to update.
Arguments
- Anchor to codeDiscountNodecode•Discount
Discount Node Code Node The code discount that was updated.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Deactivates a code discount.
- •ID!required
The ID of the code discount to deactivate.
Arguments
- Anchor to codeDiscountNodecode•Discount
Discount Node Code Node The deactivated code discount.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Deletes a code discount.
- •ID!required
The ID of the code discount to delete.
Arguments
- Anchor to deletedCodeDiscountIddeleted•ID
Code Discount Id The ID of the code discount that was deleted.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Creates an free shipping discount that's applied on a cart and at checkout when a customer enters a code.
- Anchor to freeShippingCodeDiscountfree•Discount
Shipping Code Discount Code Free Shipping Input!required The input data used to create the discount code.
Arguments
- Anchor to codeDiscountNodecode•Discount
Discount Node Code Node The discount code that was created.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Updates a free shipping discount that's applied on a cart and at checkout when a customer enters a code.
Note- Anchor to freeShippingCodeDiscountfree•Discount
Shipping Code Discount Code Free Shipping Input!required The input data used to update the discount code.
- •ID!required
The ID of the discount code to update.
Arguments
- Anchor to codeDiscountNodecode•Discount
Discount Node Code Node The discount code that was updated.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Asynchronously delete discount codes in bulk that customers can use to redeem a discount.
- Anchor to discountIddiscount•ID!required
Id The ID of the
object that the codes will be removed from. For example,
. You can use the
query to retrieve the ID.
- Anchor to savedSearchIdsaved•ID
Search Id The ID of a saved search.
- Anchor to searchsearch•String
A filter made up of terms, connectives, modifiers, and comparators that you can use to search for code discounts. You can apply one or more filters to a query. Learn more about Shopify API search syntax.
For a list of accepted values for the
search
field, refer to thequery
argument on thequery.
Arguments
- •Job
The asynchronous job that deletes the discount codes.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields
- •mutation
Asynchronously add discount codes in bulk that customers can use to redeem a discount. You can use the
mutation to automate the distribution of discount codes through emails or other marketing channels.
- Anchor to codescodes•[Discount
Redeem Code Input!]!required The list of codes to associate with the code discount. Maximum: 100 codes.
- Anchor to discountIddiscount•ID!required
Id The ID of the
object that the codes will be added to. For example,
. You can use the
query to retrieve the ID.
Arguments
- Anchor to bulkCreationbulk•Discount
Creation Redeem Code Bulk Creation The ID of bulk operation that creates multiple unique discount codes. You can use the
query to track the status of the bulk operation.
- Anchor to userErrorsuser•[Discount
Errors User Error!]!non-null The list of errors that occurred from executing the mutation.
Fields