Skip to content
Saleor
Esc
↑↓navigate↵open⌘Jpreview

Schema: Saleor 3.23.43Download SDLUpgrade guides

On this page

GiftCard Object

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
  assignedTo: User
  assignedToEmail: 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 @deprecated(reason: "Use `createdBy` field instead.")
  endDate: DateTime @deprecated(reason: "Use `expiryDate` field instead.")
  startDate: DateTime @deprecated
}

Interfaces

Node, ObjectWithMetadata

Fields

id

id · ID!

ID of the gift card.

privateMetadata

privateMetadata · [MetadataItem!]!

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

privateMetafield

privateMetafield · String

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

Tip: Use GraphQL aliases to fetch multiple keys.

key

key · String!

privateMetafields

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.

keys

keys · [String!]

metadata

metadata · [MetadataItem!]!

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

metafield

metafield · String

A single key from public metadata.

Tip: Use GraphQL aliases to fetch multiple keys.

key

key · String!

metafields

metafields · Metadata

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

keys

keys · [String!]

displayCode

displayCode · String!

Code in format which allows displaying in a user interface.

last4CodeChars

last4CodeChars · String!

Last 4 characters of gift card code.

code

code · String!

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

created

created · DateTime!

Date and time when gift card was created.

createdBy

createdBy · User

The user who bought or issued a gift card.

usedBy

usedBy · User

The customer who used a gift card.

createdByEmail

createdByEmail · String

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

Requires one of the following permissions:MANAGE_USERSOWNER

usedByEmail

usedByEmail · String

Email address of the customer who used a gift card.

assignedTo

assignedTo · User

The customer the gift card usage is restricted to.

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

assignedToEmail

assignedToEmail · String

Email of the customer the gift card is restricted to.

Requires one of the following permissions:MANAGE_GIFT_CARDOWNER
Added in Saleor 3.23

lastUsedOn

lastUsedOn · DateTime

Date and time when gift card was last used.

expiryDate

expiryDate · Date

Expiry date of the gift card.

app

app · App

App which created the gift card.

Requires one of the following permissions:MANAGE_APPSOWNER

product

product · Product

Related gift card product.

events

events · [GiftCardEvent!]!

List of events associated with the gift card. Requires MANAGE_GIFT_CARD permission to access all events. Users with MANAGE_ORDERS permission can access only USED_IN_ORDER and REFUNDED_IN_ORDER events.

Requires one of the following permissions:MANAGE_GIFT_CARDMANAGE_ORDERS

filter

filter · GiftCardEventFilterInput

Filtering options for gift card events.

tags

tags · [GiftCardTag!]!

The gift card tag.

Requires one of the following permissions:MANAGE_GIFT_CARD

boughtInChannel

boughtInChannel · String

Slug of the channel where the gift card was bought.

isActive

isActive · Boolean!

initialBalance

initialBalance · Money!

currentBalance

currentBalance · Money!

user

user · User

The customer who bought a gift card.

endDate

endDate · DateTime

End date of gift card.

startDate

startDate · DateTime

Start date of gift card.

Used by


Schema: Saleor 3.23.43. Download SDL.

Last updated on August 10, 2026

Was this page helpful?