VoucherInput Input Type
input VoucherInput {
type: VoucherTypeEnum
name: String
externalReference: String
code: String @deprecated(reason: "Use `addCodes` instead.")
addCodes: [String!]
startDate: DateTime
endDate: DateTime
discountValueType: DiscountValueTypeEnum
products: [ID!]
variants: [ID!]
collections: [ID!]
categories: [ID!]
minCheckoutItemsQuantity: Int
countries: [String!]
applyOncePerOrder: Boolean
applyOncePerCustomer: Boolean
onlyForStaff: Boolean
singleUse: Boolean
usageLimit: Int
}
Fields
type
type · VoucherTypeEnum
Voucher type: PRODUCT, CATEGORY SHIPPING or ENTIRE_ORDER.
name
name · String
Voucher name.
externalReference
externalReference · String
External ID of this voucher.
Added in Saleor 3.23code
code · String
Code to use the voucher.
addCodes
addCodes · [String!]
List of codes to add.
Added in Saleor 3.18startDate
startDate · DateTime
Start date of the voucher in ISO 8601 format.
endDate
endDate · DateTime
End date of the voucher in ISO 8601 format.
discountValueType
discountValueType · DiscountValueTypeEnum
Choices: fixed or percentage.
products
products · [ID!]
Products discounted by the voucher.
variants
variants · [ID!]
Variants discounted by the voucher.
collections
collections · [ID!]
Collections discounted by the voucher.
categories
categories · [ID!]
Categories discounted by the voucher.
minCheckoutItemsQuantity
minCheckoutItemsQuantity · Int
Minimal quantity of checkout items required to apply the voucher.
countries
countries · [String!]
Country codes that can be used with the shipping voucher.
applyOncePerOrder
applyOncePerOrder · Boolean
Voucher should be applied to the cheapest item or entire order.
applyOncePerCustomer
applyOncePerCustomer · Boolean
Voucher should be applied once per customer.
onlyForStaff
onlyForStaff · Boolean
Voucher can be used only by staff user.
singleUse
singleUse · Boolean
When set to ‘True’, each voucher code can be used only once; otherwise, codes can be used multiple times depending on usageLimit.
The option can only be changed if none of the voucher codes have been used.
Added in Saleor 3.18usageLimit
usageLimit · Int
Limit number of times this voucher can be used in total.
Used by
Schema: Saleor 3.23.43. Download SDL.