Skip to main content
Version: 3.x

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
createdByEmail: String
usedByEmail: String
lastUsedOn: DateTime
expiryDate: Date
app: App
product: Product
events(filter: GiftCardEventFilterInput): [GiftCardEvent!]!
tags: [GiftCardTag!]!
boughtInChannel: String
isActive: Boolean!
initialBalance: Money!
currentBalance: Money!
user: User
endDate: DateTime
startDate: DateTime
}

Fields

id (ID!)

privateMetadata ([MetadataItem!]!)

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

privateMetafield (String)

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

Tip: Use GraphQL aliases to fetch multiple keys.

Added in Saleor 3.3.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

privateMetafields (Metadata)

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.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

metadata ([MetadataItem!]!)

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

metafield (String)

A single key from public metadata.

Tip: Use GraphQL aliases to fetch multiple keys.

Added in Saleor 3.3.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

metafields (Metadata)

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

Added in Saleor 3.3.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

displayCode (String!)

Code in format which allows displaying in a user interface.

last4CodeChars (String!)

Last 4 characters of gift card code.

code (String!)

Gift card code. Can be fetched by a staff member with MANAGE_GIFT_CARD when gift card wasn't yet used and by the gift card owner.

created (DateTime!)

createdBy (User)

The user who bought or issued a gift card.

Added in Saleor 3.1.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

usedBy (User)

The customer who used a gift card.

Added in Saleor 3.1.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

createdByEmail (String)

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

Added in Saleor 3.1.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

Requires one of the following permissions: MANAGE_USERS, OWNER.

usedByEmail (String)

Email address of the customer who used a gift card.

Added in Saleor 3.1.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

lastUsedOn (DateTime)

expiryDate (Date)

app (App)

App which created the gift card.

Added in Saleor 3.1.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

Requires one of the following permissions: MANAGE_APPS, OWNER.

product (Product)

Related gift card product.

Added in Saleor 3.1.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

events ([GiftCardEvent!]!)

List of events associated with the gift card.

Added in Saleor 3.1.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

Requires one of the following permissions: MANAGE_GIFT_CARD.

Filtering options for gift card events.

tags ([GiftCardTag!]!)

The gift card tag.

Added in Saleor 3.1.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

Requires one of the following permissions: MANAGE_GIFT_CARD.

boughtInChannel (String)

Slug of the channel where the gift card was bought.

Added in Saleor 3.1.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

isActive (Boolean!)

initialBalance (Money!)

currentBalance (Money!)

user (User)

The customer who bought a gift card.

endDate (DateTime)

End date of gift card.

startDate (DateTime)

Start date of gift card.

Interfaces

Node

An object with an ID

ObjectWithMetadata