voucher Query
Look up a voucher by ID or external reference.
voucher(id: ID, externalReference: String, channel: String): Voucher
Returns
Show return type
type Voucher implements Node & ObjectWithMetadata {
id: ID!
privateMetadata: [MetadataItem!]!
privateMetafield(key: String!): String
privateMetafields(keys: [String!]): Metadata
metadata: [MetadataItem!]!
metafield(key: String!): String
metafields(keys: [String!]): Metadata
name: String
externalReference: String
codes(before: String, after: String, first: Int, last: Int): VoucherCodeCountableConnection
code: String
usageLimit: Int
used: Int!
startDate: DateTime!
endDate: DateTime
applyOncePerOrder: Boolean!
applyOncePerCustomer: Boolean!
singleUse: Boolean!
onlyForStaff: Boolean!
minCheckoutItemsQuantity: Int
categories(before: String, after: String, first: Int, last: Int): CategoryCountableConnection
collections(before: String, after: String, first: Int, last: Int): CollectionCountableConnection
products(before: String, after: String, first: Int, last: Int): ProductCountableConnection
variants(before: String, after: String, first: Int, last: Int): ProductVariantCountableConnection
countries: [CountryDisplay!]
translation(languageCode: LanguageCodeEnum!): VoucherTranslation
discountValueType: DiscountValueTypeEnum!
discountValue: Float
currency: String
minSpent: Money
type: VoucherTypeEnum!
channelListings: [VoucherChannelListing!]
}Arguments
id
id · ID
ID of the voucher.
externalReference
externalReference · String
External ID of the voucher.
Added in Saleor 3.23channel
channel · String
Slug of a channel for which the data should be returned.
Schema: Saleor 3.23.43. Download SDL.