Schema Documentation
CreateCouponInput
Description
Input for the createCoupon mutation.
Fields
Input Field | Description |
---|---|
amount - Float | The amount of discount. Should always be numeric, even if setting a percentage. |
clientMutationId - String | This is an ID that can be passed to a mutation by the client to track the progress of mutations and catch possible duplicate mutation submissions. |
code - String! | Coupon code. |
dateExpires - String | The date the coupon expires, in the site's timezone. |
dateExpiresGmt - String | The date the coupon expires, as GMT. |
description - String | Coupon description. |
discountType - DiscountTypeEnum | Determines the type of discount that will be applied. |
emailRestrictions - [String] | List of email addresses that can use this coupon. |
excludeSaleItems - Boolean | If true, this coupon will not be applied to items that have sale prices. |
excludedProductCategories - [Int] | List of category IDs the coupon does not apply to. |
excludedProductIds - [Int] | List of product IDs the coupon cannot be used on. |
freeShipping - Boolean | If true and if the free shipping method requires a coupon, this coupon will enable free shipping. |
individualUse - Boolean | If true, the coupon can only be used individually. Other applied coupons will be removed from the cart. |
limitUsageToXItems - Int | Max number of items in the cart the coupon can be applied to. |
maximumAmount - String | Maximum order amount allowed when using the coupon. |
metaData - [MetaDataInput] | Meta data. |
minimumAmount - String | Minimum order amount that needs to be in the cart before coupon applies. |
productCategories - [Int] | List of category IDs the coupon applies to. |
productIds - [Int] | List of product IDs the coupon can be used on. |
usageLimit - Int | How many times the coupon can be used in total. |
usageLimitPerUser - Int | How many times the coupon can be used per customer. |
Example
{"amount":123.45,"clientMutationId":"abc123","code":"abc123","dateExpires":"abc123","dateExpiresGmt":"abc123","description":"xyz789","discountType":"FIXED_CART","emailRestrictions":["xyz789"],"excludeSaleItems":true,"excludedProductCategories":[123],"excludedProductIds":[987],"freeShipping":true,"individualUse":true,"limitUsageToXItems":987,"maximumAmount":"xyz789","metaData":[MetaDataInput],"minimumAmount":"xyz789","productCategories":[123],"productIds":[987],"usageLimit":987,"usageLimitPerUser":123}