DiscountAutomaticAppInput
The input fields for creating or updating an automatic discount that's managed by an app.
Use these input fields when you need advanced, custom, or dynamic discount capabilities that aren't supported by Shopify's native discount types.
Anchor to FieldsFields
- Anchor to appliesOnOneTimePurchaseapplies•
On One Time Purchase BooleanDefault:true Whether the discount applies on one-time purchases.
- Anchor to appliesOnSubscriptionapplies•
On Subscription BooleanDefault:false Whether the discount applies on subscription items. Subscriptions enable customers to purchase products on a recurring basis.
- Anchor to combinesWithcombines•
With The discount classes that you can use in combination with Shopify discount types.
- Anchor to endsAtends•
At The date and time when the discount expires and is no longer available to customers. For discounts without a fixed expiration date, specify
null
.- Anchor to functionIdfunction•
Id The function ID associated with the app extension providing the discount type.
- Anchor to metafieldsmetafields•[Metafield
Input!] Default:[] Additional metafields to associate to the discount. Metafields provide dynamic function configuration with different parameters, such as
percentage
for a percentage discount. Merchants can set metafield values in the Shopify admin, which makes the discount function more flexible and customizable.- Anchor to recurringCycleLimitrecurring•
Cycle Limit IntDefault:1 The number of billing cycles for which the discount can be applied, which is useful for subscription-based discounts. For example, if you set this field to
3
, then the discount only applies to the first three billing cycles of a subscription. If you specify0
, then the discount applies indefinitely.- Anchor to startsAtstarts•
At The date and time when the discount becomes active and is available to customers.
- Anchor to titletitle•
The discount's name that displays to merchants in the Shopify admin and to customers.