> Documentation index: [Saleor](/llms.txt) · [This section](/api-reference/discounts/llms.txt)
> Source: https://docs.saleor.io/api-reference/discounts/objects/voucher

# Voucher Object

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

```graphql
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!]
}
```

<a id="fields"></a>

### Fields

<a id="id"></a>

#### [`id`](#id) ● [`ID!`](/api-reference/miscellaneous/scalars/id.md)

The ID of the voucher.

<a id="private-metadata"></a>

#### [`privateMetadata`](#private-metadata) ● [`[MetadataItem!]!`](/api-reference/miscellaneous/objects/metadata-item.md)

List of private metadata items. Requires staff permissions to access.

<a id="private-metafield"></a>

#### [`privateMetafield`](#private-metafield) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

A single key from private metadata. Requires staff permissions to access.

Tip: Use GraphQL aliases to fetch multiple keys.

<a id="voucher-private-metafield-key"></a>

##### [`key`](#voucher-private-metafield-key) ● [`String!`](/api-reference/miscellaneous/scalars/string.md)

<a id="private-metafields"></a>

#### [`privateMetafields`](#private-metafields) ● [`Metadata`](/api-reference/miscellaneous/scalars/metadata.md)

Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything.

<a id="voucher-private-metafields-keys"></a>

##### [`keys`](#voucher-private-metafields-keys) ● [`[String!]`](/api-reference/miscellaneous/scalars/string.md)

<a id="metadata"></a>

#### [`metadata`](#metadata) ● [`[MetadataItem!]!`](/api-reference/miscellaneous/objects/metadata-item.md)

List of public metadata items. Can be accessed without permissions.

<a id="metafield"></a>

#### [`metafield`](#metafield) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

A single key from public metadata.

Tip: Use GraphQL aliases to fetch multiple keys.

<a id="voucher-metafield-key"></a>

##### [`key`](#voucher-metafield-key) ● [`String!`](/api-reference/miscellaneous/scalars/string.md)

<a id="metafields"></a>

#### [`metafields`](#metafields) ● [`Metadata`](/api-reference/miscellaneous/scalars/metadata.md)

Public metadata. Use `keys` to control which fields you want to include. The default is to include everything.

<a id="voucher-metafields-keys"></a>

##### [`keys`](#voucher-metafields-keys) ● [`[String!]`](/api-reference/miscellaneous/scalars/string.md)

<a id="name"></a>

#### [`name`](#name) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

The name of the voucher.

<a id="codes"></a>

#### [`codes`](#codes) ● [`VoucherCodeCountableConnection`](/api-reference/discounts/objects/voucher-code-countable-connection.md)

List of codes available for this voucher.

Added in Saleor 3.18

<a id="voucher-codes-before"></a>

##### [`before`](#voucher-codes-before) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="voucher-codes-after"></a>

##### [`after`](#voucher-codes-after) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="voucher-codes-first"></a>

##### [`first`](#voucher-codes-first) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

<a id="voucher-codes-last"></a>

##### [`last`](#voucher-codes-last) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

<a id="code"></a>

#### [`code`](#code) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

The code of the voucher.

<a id="usage-limit"></a>

#### [`usageLimit`](#usage-limit) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

The number of times a voucher can be used.

<a id="used"></a>

#### [`used`](#used) ● [`Int!`](/api-reference/miscellaneous/scalars/int.md)

Usage count of the voucher.

<a id="start-date"></a>

#### [`startDate`](#start-date) ● [`DateTime!`](/api-reference/miscellaneous/scalars/date-time.md)

The start date and time of voucher.

<a id="end-date"></a>

#### [`endDate`](#end-date) ● [`DateTime`](/api-reference/miscellaneous/scalars/date-time.md)

The end date and time of voucher.

<a id="apply-once-per-order"></a>

#### [`applyOncePerOrder`](#apply-once-per-order) ● [`Boolean!`](/api-reference/miscellaneous/scalars/boolean.md)

Determine if the voucher should be applied once per order. If set to True, the voucher is applied to a single cheapest eligible product in checkout.

<a id="apply-once-per-customer"></a>

#### [`applyOncePerCustomer`](#apply-once-per-customer) ● [`Boolean!`](/api-reference/miscellaneous/scalars/boolean.md)

Determine if the voucher usage should be limited to one use per customer.

<a id="single-use"></a>

#### [`singleUse`](#single-use) ● [`Boolean!`](/api-reference/miscellaneous/scalars/boolean.md)

Determine if the voucher codes can be used once or multiple times.

Added in Saleor 3.18

This API is currently in **Feature Preview** and can be subject to changes at later point.

<a id="only-for-staff"></a>

#### [`onlyForStaff`](#only-for-staff) ● [`Boolean!`](/api-reference/miscellaneous/scalars/boolean.md)

Determine if the voucher is available only for staff members.

<a id="min-checkout-items-quantity"></a>

#### [`minCheckoutItemsQuantity`](#min-checkout-items-quantity) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Determine minimum quantity of items for checkout.

<a id="categories"></a>

#### [`categories`](#categories) ● [`CategoryCountableConnection`](/api-reference/products/objects/category-countable-connection.md)

List of categories this voucher applies to.

<a id="voucher-categories-before"></a>

##### [`before`](#voucher-categories-before) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="voucher-categories-after"></a>

##### [`after`](#voucher-categories-after) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="voucher-categories-first"></a>

##### [`first`](#voucher-categories-first) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

<a id="voucher-categories-last"></a>

##### [`last`](#voucher-categories-last) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

<a id="collections"></a>

#### [`collections`](#collections) ● [`CollectionCountableConnection`](/api-reference/products/objects/collection-countable-connection.md)

List of collections this voucher applies to.

Requires the MANAGE\_DISCOUNTS permission.

<a id="voucher-collections-before"></a>

##### [`before`](#voucher-collections-before) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="voucher-collections-after"></a>

##### [`after`](#voucher-collections-after) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="voucher-collections-first"></a>

##### [`first`](#voucher-collections-first) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

<a id="voucher-collections-last"></a>

##### [`last`](#voucher-collections-last) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

<a id="products"></a>

#### [`products`](#products) ● [`ProductCountableConnection`](/api-reference/products/objects/product-countable-connection.md)

List of products this voucher applies to.

Requires the MANAGE\_DISCOUNTS permission.

<a id="voucher-products-before"></a>

##### [`before`](#voucher-products-before) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="voucher-products-after"></a>

##### [`after`](#voucher-products-after) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="voucher-products-first"></a>

##### [`first`](#voucher-products-first) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

<a id="voucher-products-last"></a>

##### [`last`](#voucher-products-last) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

<a id="variants"></a>

#### [`variants`](#variants) ● [`ProductVariantCountableConnection`](/api-reference/products/objects/product-variant-countable-connection.md)

List of product variants this voucher applies to.

Requires the MANAGE\_DISCOUNTS permission.

<a id="voucher-variants-before"></a>

##### [`before`](#voucher-variants-before) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="voucher-variants-after"></a>

##### [`after`](#voucher-variants-after) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="voucher-variants-first"></a>

##### [`first`](#voucher-variants-first) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

<a id="voucher-variants-last"></a>

##### [`last`](#voucher-variants-last) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

<a id="countries"></a>

#### [`countries`](#countries) ● [`[CountryDisplay!]`](/api-reference/miscellaneous/objects/country-display.md)

List of countries available for the shipping voucher.

<a id="translation"></a>

#### [`translation`](#translation) ● [`VoucherTranslation`](/api-reference/discounts/objects/voucher-translation.md)

Returns translated voucher fields for the given language code.

<a id="voucher-translation-language-code"></a>

##### [`languageCode`](#voucher-translation-language-code) ● [`LanguageCodeEnum!`](/api-reference/miscellaneous/enums/language-code-enum.md)

A language code to return the translation for voucher.

<a id="discount-value-type"></a>

#### [`discountValueType`](#discount-value-type) ● [`DiscountValueTypeEnum!`](/api-reference/discounts/enums/discount-value-type-enum.md)

Determines a type of discount for voucher - value or percentage

<a id="discount-value"></a>

#### [`discountValue`](#discount-value) ● [`Float`](/api-reference/miscellaneous/scalars/float.md)

Voucher value.

<a id="currency"></a>

#### [`currency`](#currency) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

Currency code for voucher.

<a id="min-spent"></a>

#### [`minSpent`](#min-spent) ● [`Money`](/api-reference/miscellaneous/objects/money.md)

Minimum order value to apply voucher.

<a id="type"></a>

#### [`type`](#type) ● [`VoucherTypeEnum!`](/api-reference/discounts/enums/voucher-type-enum.md)

Determines a type of voucher.

<a id="channel-listings"></a>

#### [`channelListings`](#channel-listings) ● [`[VoucherChannelListing!]`](/api-reference/discounts/objects/voucher-channel-listing.md)

List of availability in channels for the voucher.

Requires the MANAGE\_DISCOUNTS permission.

<a id="interfaces"></a>

### Interfaces

<a id="node"></a>

#### [`Node`](/api-reference/miscellaneous/interfaces/node.md)

An object with an ID

<a id="objectwithmetadata"></a>

#### [`ObjectWithMetadata`](/api-reference/miscellaneous/interfaces/object-with-metadata.md)

<a id="returned-by"></a>

### Returned By

[`voucher`](/api-reference/discounts/queries/voucher.md) query

<a id="member-of"></a>

### Member Of

[`Checkout`](/api-reference/checkout/objects/checkout.md) object  ● [`Order`](/api-reference/orders/objects/order.md) object  ● [`VoucherAddCatalogues`](/api-reference/discounts/objects/voucher-add-catalogues.md) object  ● [`VoucherChannelListingUpdate`](/api-reference/discounts/objects/voucher-channel-listing-update.md) object  ● [`VoucherCountableEdge`](/api-reference/discounts/objects/voucher-countable-edge.md) object  ● [`VoucherCreate`](/api-reference/discounts/objects/voucher-create.md) object  ● [`VoucherCreated`](/api-reference/discounts/objects/voucher-created.md) object  ● [`VoucherDelete`](/api-reference/discounts/objects/voucher-delete.md) object  ● [`VoucherDeleted`](/api-reference/discounts/objects/voucher-deleted.md) object  ● [`VoucherMetadataUpdated`](/api-reference/discounts/objects/voucher-metadata-updated.md) object  ● [`VoucherRemoveCatalogues`](/api-reference/discounts/objects/voucher-remove-catalogues.md) object  ● [`VoucherTranslatableContent`](/api-reference/discounts/objects/voucher-translatable-content.md) object  ● [`VoucherTranslate`](/api-reference/discounts/objects/voucher-translate.md) object  ● [`VoucherUpdate`](/api-reference/discounts/objects/voucher-update.md) object  ● [`VoucherUpdated`](/api-reference/discounts/objects/voucher-updated.md) object
