discount Code App Create
Requires 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 <a href="https://shopify.dev/docs/api/admin-graphql/latest/mutations/discountAutomaticAppCreate"><code><span class="PreventFireFoxApplyingGapToWBR">discount<wbr/>Automatic<wbr/>App<wbr/>Create</span></code></a>.
Arguments
- codeAppDiscount (DiscountCodeAppInput!)
- Anchor to codeAppDiscountcode•Discount
App Discount Code App Input! required The input data used to create the discount.
- codeAppDiscount (DiscountCodeApp)
- userErrors ([DiscountUserError!]!)
- 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.