# DiscountUserError - admin-graphql - OBJECT Version: 2024-10 ## Description An error that occurs during the execution of a discount mutation. ### Access Scopes ## Fields * [code](/docs/api/admin-graphql/2024-10/enums/DiscountErrorCode): DiscountErrorCode - The error code. * [extraInfo](/docs/api/admin-graphql/2024-10/scalars/String): String - Extra information about this error. * [field](/docs/api/admin-graphql/2024-10/scalars/String): String - The path to the input field that caused the error. * [message](/docs/api/admin-graphql/2024-10/scalars/String): String! - The error message. ## Connections ## Related queries ## Related mutations * [discountAutomaticActivate](/docs/api/admin-graphql/2024-10/mutations/discountAutomaticActivate) Activates an automatic discount. * [discountAutomaticAppCreate](/docs/api/admin-graphql/2024-10/mutations/discountAutomaticAppCreate) Creates an automatic discount that's managed by an app. Use this mutation with [Shopify Functions](https://shopify.dev/docs/apps/build/functions) when you need advanced, custom, or dynamic discount capabilities that aren't supported by [Shopify's native discount types](https://help.shopify.com/manual/discounts/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](https://shopify.dev/docs/apps/build/discounts/build-discount-function). > Note: > To create code discounts with custom logic, use the [`discountCodeAppCreate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountCodeAppCreate) mutation. * [discountAutomaticAppUpdate](/docs/api/admin-graphql/2024-10/mutations/discountAutomaticAppUpdate) Updates an existing automatic discount that's managed by an app using [Shopify Functions](https://shopify.dev/docs/apps/build/functions). Use this mutation when you need advanced, custom, or dynamic discount capabilities that aren't supported by [Shopify's native discount types](https://help.shopify.com/manual/discounts/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](https://shopify.dev/docs/apps/build/discounts/build-discount-function). > Note: > To update code discounts with custom logic, use the [`discountCodeAppUpdate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountCodeAppUpdate) mutation instead. * [discountAutomaticBasicCreate](/docs/api/admin-graphql/2024-10/mutations/discountAutomaticBasicCreate) Creates an [amount off discount](https://help.shopify.com/manual/discounts/discount-types/percentage-fixed-amount) that's automatically applied on a cart and at checkout. > Note: > To create code discounts, use the [`discountCodeBasicCreate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountCodeBasicCreate) mutation. * [discountAutomaticBasicUpdate](/docs/api/admin-graphql/2024-10/mutations/discountAutomaticBasicUpdate) Updates an existing [amount off discount](https://help.shopify.com/manual/discounts/discount-types/percentage-fixed-amount) that's automatically applied on a cart and at checkout. > Note: > To update code discounts, use the [`discountCodeBasicUpdate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountCodeBasicUpdate) mutation instead. * [discountAutomaticBulkDelete](/docs/api/admin-graphql/2024-10/mutations/discountAutomaticBulkDelete) Asynchronously delete automatic discounts in bulk if a `search` or `saved_search_id` argument 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. * [discountAutomaticBxgyCreate](/docs/api/admin-graphql/2024-10/mutations/discountAutomaticBxgyCreate) Creates a [buy X get Y discount (BXGY)](https://help.shopify.com/manual/discounts/discount-types/buy-x-get-y) that's automatically applied on a cart and at checkout. > Note: > To create code discounts, use the [`discountCodeBxgyCreate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountCodeBxgyCreate) mutation. * [discountAutomaticBxgyUpdate](/docs/api/admin-graphql/2024-10/mutations/discountAutomaticBxgyUpdate) Updates an existing [buy X get Y discount (BXGY)](https://help.shopify.com/manual/discounts/discount-types/buy-x-get-y) that's automatically applied on a cart and at checkout. > Note: > To update code discounts, use the [`discountCodeBxgyUpdate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountCodeBxgyUpdate) mutation instead. * [discountAutomaticDeactivate](/docs/api/admin-graphql/2024-10/mutations/discountAutomaticDeactivate) Deactivates an automatic discount. * [discountAutomaticDelete](/docs/api/admin-graphql/2024-10/mutations/discountAutomaticDelete) Deletes an [automatic discount](https://help.shopify.com/manual/discounts/discount-types#automatic-discounts). * [discountAutomaticFreeShippingCreate](/docs/api/admin-graphql/2024-10/mutations/discountAutomaticFreeShippingCreate) Creates a [free shipping discount](https://help.shopify.com/manual/discounts/discount-types/free-shipping) that's automatically applied on a cart and at checkout. > Note: > To create code discounts, use the [`discountCodeFreeShippingCreate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountCodeFreeShippingCreate) mutation. * [discountAutomaticFreeShippingUpdate](/docs/api/admin-graphql/2024-10/mutations/discountAutomaticFreeShippingUpdate) Updates an existing [free shipping discount](https://help.shopify.com/manual/discounts/discount-types/free-shipping) that's automatically applied on a cart and at checkout. > Note: > To update code discounts, use the [`discountCodeFreeShippingUpdate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountCodeFreeShippingUpdate) mutation instead. * [discountCodeActivate](/docs/api/admin-graphql/2024-10/mutations/discountCodeActivate) Activates a code discount. * [discountCodeAppCreate](/docs/api/admin-graphql/2024-10/mutations/discountCodeAppCreate) Creates a code discount. The discount type must be provided by an app extension that uses [Shopify Functions](https://shopify.dev/docs/apps/build/functions). Functions can implement [order](https://shopify.dev/docs/api/functions/reference/order-discounts), [product](https://shopify.dev/docs/api/functions/reference/product-discounts), or [shipping](https://shopify.dev/docs/api/functions/reference/shipping-discounts) discount functions. Use this mutation with Shopify Functions when you need custom logic beyond [Shopify's native discount types](https://help.shopify.com/manual/discounts/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](https://shopify.dev/docs/apps/build/discounts/build-discount-function). > Note: > To create automatic discounts with custom logic, use [`discountAutomaticAppCreate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountAutomaticAppCreate). * [discountCodeAppUpdate](/docs/api/admin-graphql/2024-10/mutations/discountCodeAppUpdate) Updates a code discount, where the discount type is provided by an app extension that uses [Shopify Functions](https://shopify.dev/docs/apps/build/functions). Use this mutation when you need advanced, custom, or dynamic discount capabilities that aren't supported by [Shopify's native discount types](https://help.shopify.com/manual/discounts/discount-types). > Note: > To update automatic discounts, use [`discountAutomaticAppUpdate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountAutomaticAppUpdate). * [discountCodeBasicCreate](/docs/api/admin-graphql/2024-10/mutations/discountCodeBasicCreate) Creates an [amount off discount](https://help.shopify.com/manual/discounts/discount-types/percentage-fixed-amount) 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. > Note: > To create discounts that are automatically applied on a cart and at checkout, use the [`discountAutomaticBasicCreate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountAutomaticBasicCreate) mutation. * [discountCodeBasicUpdate](/docs/api/admin-graphql/2024-10/mutations/discountCodeBasicUpdate) Updates an [amount off discount](https://help.shopify.com/manual/discounts/discount-types/percentage-fixed-amount) 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. > Note: > To update discounts that are automatically applied on a cart and at checkout, use the [`discountAutomaticBasicUpdate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountAutomaticBasicUpdate) mutation. * [discountCodeBulkActivate](/docs/api/admin-graphql/2024-10/mutations/discountCodeBulkActivate) Activates multiple [code discounts](https://help.shopify.com/manual/discounts/discount-types#discount-codes) 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. * [discountCodeBulkDeactivate](/docs/api/admin-graphql/2024-10/mutations/discountCodeBulkDeactivate) Deactivates multiple [code-based discounts](https://help.shopify.com/manual/discounts/discount-types#discount-codes) 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. * [discountCodeBulkDelete](/docs/api/admin-graphql/2024-10/mutations/discountCodeBulkDelete) Deletes multiple [code-based discounts](https://help.shopify.com/manual/discounts/discount-types#discount-codes) 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. * [discountCodeBxgyCreate](/docs/api/admin-graphql/2024-10/mutations/discountCodeBxgyCreate) Creates a [buy X get Y discount (BXGY)](https://help.shopify.com/manual/discounts/discount-types/buy-x-get-y) that's applied on a cart and at checkout when a customer enters a code. > Note: > To create discounts that are automatically applied on a cart and at checkout, use the [`discountAutomaticBxgyCreate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountAutomaticBxgyCreate) mutation. * [discountCodeBxgyUpdate](/docs/api/admin-graphql/2024-10/mutations/discountCodeBxgyUpdate) Updates a [buy X get Y discount (BXGY)](https://help.shopify.com/manual/discounts/discount-types/buy-x-get-y) that's applied on a cart and at checkout when a customer enters a code. > Note: > To update discounts that are automatically applied on a cart and at checkout, use the [`discountAutomaticBxgyUpdate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountAutomaticBxgyUpdate) mutation. * [discountCodeDeactivate](/docs/api/admin-graphql/2024-10/mutations/discountCodeDeactivate) Deactivates a code discount. * [discountCodeDelete](/docs/api/admin-graphql/2024-10/mutations/discountCodeDelete) Deletes a [code discount](https://help.shopify.com/manual/discounts/discount-types#discount-codes). * [discountCodeFreeShippingCreate](/docs/api/admin-graphql/2024-10/mutations/discountCodeFreeShippingCreate) Creates an [free shipping discount](https://help.shopify.com/manual/discounts/discount-types/free-shipping) that's applied on a cart and at checkout when a customer enters a code. > Note: > To create discounts that are automatically applied on a cart and at checkout, use the [`discountAutomaticFreeShippingCreate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountAutomaticFreeShippingCreate) mutation. * [discountCodeFreeShippingUpdate](/docs/api/admin-graphql/2024-10/mutations/discountCodeFreeShippingUpdate) Updates a [free shipping discount](https://help.shopify.com/manual/discounts/discount-types/free-shipping) that's applied on a cart and at checkout when a customer enters a code. > Note: > To update a free shipping discount that's automatically applied on a cart and at checkout, use the [`discountAutomaticFreeShippingUpdate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountAutomaticFreeShippingUpdate) mutation. * [discountCodeRedeemCodeBulkDelete](/docs/api/admin-graphql/2024-10/mutations/discountCodeRedeemCodeBulkDelete) Asynchronously delete discount redeem codes in bulk. Specify the redeem codes to delete by providing a search query, a saved search ID, or a list of redeem code IDs. * [discountRedeemCodeBulkAdd](/docs/api/admin-graphql/2024-10/mutations/discountRedeemCodeBulkAdd) Asynchronously add discount redeem codes in bulk. Specify the codes to add and the discount code ID that the codes will belong to. ## Related Unions ## Examples