Skip to main content
Log inSign up

Shopify uses cookies to provide necessary site functionality and improve your experience. By using our website, you agree to our privacy policy and our cookie policy.

Anchor to discountCodeAppCreate

discountCodeAppCreate

mutation

Requires write_discounts access scope.

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.


Note

To create automatic discounts with custom logic, use discountAutomaticAppCreate.


The input data used to create the discount.


Was this section helpful?

Anchor to DiscountCodeAppCreatePayload returnsDiscountCodeAppCreatePayload returns

The discount that the app provides.

The list of errors that occurred from executing the mutation.


Was this section helpful?