Gift Card
Requires access scope.
A gift card that customers use as a payment method. Stores the initial value, current balance, and expiration date.
You can issue gift cards to a specific Customer or send them to a with a personalized message. The card tracks its transaction history through and records. You can create and deactivate gift cards using the and mutations, respectively.
After a gift card is deactivated, it can't be used for further purchases or re-enabled.
Anchor to FieldsFields
- Anchor to balancebalance•Money
V2! non-null The gift card's remaining balance.
- Anchor to createdAtcreated•Date
At Time! non-null The date and time at which the gift card was created.
- Anchor to customercustomer•Customer
The customer who will receive the gift card.
- Anchor to deactivatedAtdeactivated•Date
At Time The date and time at which the gift card was deactivated.
- Anchor to enabledenabled•Boolean!non-null
Whether the gift card is enabled.
- Anchor to expiresOnexpires•Date
On The date at which the gift card will expire.
- •ID!non-null
A globally-unique ID.
- Anchor to initialValueinitial•Money
Value V2! non-null The initial value of the gift card.
- Anchor to lastCharacterslast•String!
Characters non-null The final four characters of the gift card code.
- Anchor to maskedCodemasked•String!
Code non-null The gift card code. Everything but the final four characters is masked.
- Anchor to notenote•String
The note associated with the gift card, which isn't visible to the customer.
- Anchor to orderorder•Order
The order associated with the gift card. This value is
nullif the gift card was issued manually.- Anchor to recipientAttributesrecipient•Gift
Attributes Card Recipient The recipient who will receive the gift card.
- Anchor to templateSuffixtemplate•String
Suffix The theme template used to render the gift card online.
- Anchor to transactionstransactions•Gift
Card Transaction Connection The transaction history of the gift card.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
Arguments
- Anchor to updatedAtupdated•Date
At Time! non-null The date and time at which the gift card was updated.
Anchor to QueriesQueries
- •query
Retrieves a
by its ID. Returns the gift card's balance, transaction history,Customerinformation, and whether it's enabled.Additional fields include the initial value, expiration date, deactivation timestamp (if applicable), and the associated
Orderif the gift card was purchased by a customer through checkout. Gift cards that merchants create manually won't have an associated order.- •ID!required
The ID of the GiftCard to return.
Arguments
- •ID!
- •query
Returns a paginated list of
objects issued for the shop.You can filter gift cards by attributes such as status, last characters of the code, balance status, and other values using the
queryparameter. You can also applyobjects to filter results.- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Gift
Key Card Sort Keys Default:ID Sort the underlying list using a key. If your query is slow or returns an error, then try specifying a sort key that matches the field used in the search.
- Anchor to queryquery•String
A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.
- Anchor to default•string
Filter by a case-insensitive search of multiple fields in a document, including gift card codes.
query=a5bh6h64b329j4k7query=Bob Norman- Anchor to balance_status•string
fullpartialemptyfull_or_partialbalance_status:full- Anchor to created_at•time
created_at:>=2020-01-01T12:00:00Z- Anchor to expires_on•date
expires_on:>=2020-01-01- Anchor to initial_value•string
initial_value:>=100- Anchor to status•string
disabledenabledexpiredexpiringstatus:disabled OR status:expired
Example:
Valid values:
Example:
Example:
Example:
Example:
Valid values:
Example:
- Anchor to savedSearchIdsaved•ID
Search Id The ID of a saved search. The search’s query string is used as the query argument.
Arguments
Anchor to MutationsMutations
- •mutation
Creates a new
with a specified initial value. You can assign the gift card to aCustomeror create it without assignment for manual distribution.You can customize the gift card with an optional code, expiration date, and internal note. If you don't provide a code, the system generates a random 16 character alphanumeric code. The mutation also supports scheduling gift card notifications to recipients, with a personalized message, through the
field on theinput object.- Anchor to inputinput•Gift
Card Create Input! required The input fields to create a gift card.
Arguments
- •mutation
Deactivate a gift card. A deactivated gift card cannot be used by a customer. A deactivated gift card cannot be re-enabled.
- •ID!required
The ID of the gift card to deactivate.
Arguments
- •ID!
- •mutation
Send notification to the customer of a gift card.
- •ID!required
The ID of the gift card to send.
Arguments
- •ID!
- •mutation
Send notification to the recipient of a gift card.
- •ID!required
The ID of the gift card to send.
Arguments
- •ID!
- •mutation
Update a gift card.
- •ID!required
The ID of the gift card to be updated.
- Anchor to inputinput•Gift
Card Update Input! required The input fields to update the gift card.
Arguments
- •ID!