Skip to main content

voucher Query

Look up a voucher by ID.

Requires the MANAGE_DISCOUNTSpermission.
voucher(
id: ID!
channel: String
): Voucher
Details
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
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 of the voucher.

channel ● String

Slug of a channel for which the data should be returned.

Type

Voucher

Vouchers allow giving discounts to particular customers on categories, collections or specific products. They can be used during checkout by providing valid voucher codes.