Skip to main content

Voucher

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

type Voucher implements Node {
id: ID!
type: VoucherTypeEnum!
name: String
code: String!
usageLimit: Int
used: Int!
startDate: DateTime!
endDate: DateTime
applyOncePerOrder: Boolean!
applyOncePerCustomer: Boolean!
discountValueType: DiscountValueTypeEnum!
discountValue: Decimal!
currency: String!
minSpent: Money
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!]!
}
Show more ↓

Fields

Voucher.id ● ID! non-null scalar

The ID of the object

Voucher.type ● VoucherTypeEnum! non-null enum

Determines a type of voucher.

Voucher.name ● String scalar

Voucher.code ● String! non-null scalar

Voucher.usageLimit ● Int scalar

Voucher.used ● Int! non-null scalar

Voucher.startDate ● DateTime! non-null scalar

Voucher.endDate ● DateTime scalar

Voucher.applyOncePerOrder ● Boolean! non-null scalar

Voucher.applyOncePerCustomer ● Boolean! non-null scalar

Voucher.discountValueType ● DiscountValueTypeEnum! non-null enum

Determines a type of discount for voucher - value or percentage

Voucher.discountValue ● Decimal! non-null scalar

Voucher.currency ● String! non-null scalar

Voucher.minSpent ● Money object

Voucher.minCheckoutItemsQuantity ● Int scalar

Voucher.categories ● CategoryCountableConnection object

List of categories this voucher applies to.

Voucher.categories.before ● String scalar

Return the elements in the list that come before the specified cursor.

Voucher.categories.after ● String scalar

Return the elements in the list that come after the specified cursor.

Voucher.categories.first ● Int scalar

Return the first n elements from the list.

Voucher.categories.last ● Int scalar

Return the last n elements from the list.

Voucher.collections ● CollectionCountableConnection object

List of collections this voucher applies to.

Voucher.collections.before ● String scalar

Return the elements in the list that come before the specified cursor.

Voucher.collections.after ● String scalar

Return the elements in the list that come after the specified cursor.

Voucher.collections.first ● Int scalar

Return the first n elements from the list.

Voucher.collections.last ● Int scalar

Return the last n elements from the list.

Voucher.products ● ProductCountableConnection object

List of products this voucher applies to.

Voucher.products.before ● String scalar

Return the elements in the list that come before the specified cursor.

Voucher.products.after ● String scalar

Return the elements in the list that come after the specified cursor.

Voucher.products.first ● Int scalar

Return the first n elements from the list.

Voucher.products.last ● Int scalar

Return the last n elements from the list.

Voucher.variants ● ProductVariantCountableConnection object

List of variants this voucher applies to.

Voucher.variants.before ● String scalar

Return the elements in the list that come before the specified cursor.

Voucher.variants.after ● String scalar

Return the elements in the list that come after the specified cursor.

Voucher.variants.first ● Int scalar

Return the first n elements from the list.

Voucher.variants.last ● Int scalar

Return the last n elements from the list.

Voucher.countries ● [CountryDisplay!]! non-null object

List of countries available for the shipping voucher.

Interfaces

Node interface

An object with an ID

Returned By

voucher query

Member Of

Collection object ● NauticalOrder object ● Order object ● Product object ● ProductVariant object ● VoucherAddCatalogues object ● VoucherCountableEdge object ● VoucherCreate object ● VoucherDelete object ● VoucherRemoveCatalogues object ● VoucherUpdate object

Implemented By

RefundMethod union

Was this page helpful?