Skip to main content

GiftCard

A gift card is a prepaid electronic payment card accepted in stores. They can be used during checkout by providing a valid gift card codes.

type GiftCard 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
displayCode: String!
last4CodeChars: String!
code: String!
created: DateTime!
createdBy: User
usedBy: User @deprecated
createdByEmail: String
usedByEmail: String @deprecated
lastUsedOn: DateTime
expiryDate: Date
app: App
product: Product
events(filter: GiftCardEventFilterInput): [GiftCardEvent!]!
tags: [GiftCardTag!]!
boughtInChannel: String
isActive: Boolean!
initialBalance: Money!
currentBalance: Money!
user: User @deprecated
endDate: DateTime @deprecated
startDate: DateTime @deprecated
}
Expand ▼

Fields

GiftCard.id ● ID! non-null scalar miscellaneous

ID of the gift card.

GiftCard.privateMetadata ● [MetadataItem!]! non-null object miscellaneous

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

GiftCard.privateMetafield ● String scalar miscellaneous

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

Tip: Use GraphQL aliases to fetch multiple keys.

Added in Saleor 3.3
GiftCard.privateMetafield.key ● String! non-null scalar miscellaneous

GiftCard.privateMetafields ● Metadata scalar miscellaneous

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

Added in Saleor 3.3
GiftCard.privateMetafields.keys ● [String!] list scalar miscellaneous

GiftCard.metadata ● [MetadataItem!]! non-null object miscellaneous

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

GiftCard.metafield ● String scalar miscellaneous

A single key from public metadata.

Tip: Use GraphQL aliases to fetch multiple keys.

Added in Saleor 3.3
GiftCard.metafield.key ● String! non-null scalar miscellaneous

GiftCard.metafields ● Metadata scalar miscellaneous

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

Added in Saleor 3.3
GiftCard.metafields.keys ● [String!] list scalar miscellaneous

GiftCard.displayCode ● String! non-null scalar miscellaneous

Code in format which allows displaying in a user interface.

GiftCard.last4CodeChars ● String! non-null scalar miscellaneous

Last 4 characters of gift card code.

GiftCard.code ● String! non-null scalar miscellaneous

Gift card code. It can be fetched both by a staff member with 'MANAGE_GIFT_CARD' when gift card hasn't been used yet or a user who bought or issued the gift card.

Requires one of the following permissions: MANAGE_GIFT_CARDOWNER

GiftCard.created ● DateTime! non-null scalar miscellaneous

Date and time when gift card was created.

GiftCard.createdBy ● User object users

The user who bought or issued a gift card.

Added in Saleor 3.1

GiftCard.usedBy ● User deprecated object users

DEPRECATED

This field will be removed in Saleor 4.0.

The customer who used a gift card.

Added in Saleor 3.1

GiftCard.createdByEmail ● String scalar miscellaneous

Email address of the user who bought or issued gift card.

Added in Saleor 3.1
Requires one of the following permissions: MANAGE_USERSOWNER

GiftCard.usedByEmail ● String deprecated scalar miscellaneous

DEPRECATED

This field will be removed in Saleor 4.0.

Email address of the customer who used a gift card.

Added in Saleor 3.1

GiftCard.lastUsedOn ● DateTime scalar miscellaneous

Date and time when gift card was last used.

GiftCard.expiryDate ● Date scalar miscellaneous

Expiry date of the gift card.

GiftCard.app ● App object apps

App which created the gift card.

Added in Saleor 3.1
Requires one of the following permissions: MANAGE_APPSOWNER

GiftCard.product ● Product object products

Related gift card product.

Added in Saleor 3.1

GiftCard.events ● [GiftCardEvent!]! non-null object gift-cards

List of events associated with the gift card.

Added in Saleor 3.1
Requires MANAGE_GIFT_CARDpermission.
GiftCard.events.filter ● GiftCardEventFilterInput input gift-cards

Filtering options for gift card events.

GiftCard.tags ● [GiftCardTag!]! non-null object gift-cards

The gift card tag.

Added in Saleor 3.1
Requires MANAGE_GIFT_CARDpermission.

GiftCard.boughtInChannel ● String scalar miscellaneous

Slug of the channel where the gift card was bought.

Added in Saleor 3.1

GiftCard.isActive ● Boolean! non-null scalar miscellaneous

GiftCard.initialBalance ● Money! non-null object miscellaneous

GiftCard.currentBalance ● Money! non-null object miscellaneous

GiftCard.user ● User deprecated object users

DEPRECATED

This field will be removed in Saleor 4.0. Use createdBy field instead.

The customer who bought a gift card.

GiftCard.endDate ● DateTime deprecated scalar miscellaneous

DEPRECATED

This field will be removed in Saleor 4.0. Use expiryDate field instead.

End date of gift card.

GiftCard.startDate ● DateTime deprecated scalar miscellaneous

DEPRECATED

This field will be removed in Saleor 4.0.

Start date of gift card.

Interfaces

Node interface miscellaneous

An object with an ID

ObjectWithMetadata interface miscellaneous

Returned By

giftCard query

Member Of

Checkout object ● GiftCardActivate object ● GiftCardAddNote object ● GiftCardBulkCreate object ● GiftCardCountableEdge object ● GiftCardCreate object ● GiftCardCreated object ● GiftCardDeactivate object ● GiftCardDelete object ● GiftCardDeleted object ● GiftCardMetadataUpdated object ● GiftCardResend object ● GiftCardSent object ● GiftCardStatusChanged object ● GiftCardUpdate object ● GiftCardUpdated object ● Order object