Skip to main content

gift_card

A gift card that's been issued to a customer or a recipient.

Properties

Anchor to
balance

The remaining balance of the gift card in the currency's subunit.

The value is output in the customer's local (presentment) currency.

For currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000.

Tip

Use money filters to output a formatted amount.

The code used to redeem the gift card.

Anchor to
currency

The ISO code of the currency that the gift card was issued in.

Anchor to
customer

The customer associated with the gift card.

Anchor to
enabled

Returns true if the gift card is enabled. Returns false if not.

Anchor to
expired

Returns true if the gift card is expired. Returns false if not.

Anchor to
expires_on

A timestamp for when the gift card expires.

If the gift card never expires, then nil is returned.

Tip

Use the date filter to format the timestamp.

Anchor to
initial_value

The initial balance of the gift card in the currency's subunit.

The value is output in the customer's local (presentment) currency.

For currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000.

Tip

Use money filters to output a formatted amount.

Anchor to
last_four_characters

The last 4 characters of the code used to redeem the gift card.

Anchor to
message

The personalized message intended for the recipient.

If there is no message intended for the recipient, then nil is returned.

Anchor to
pass_url

The URL to download the gift card as an Apple Wallet Pass.

Anchor to
product

The product associated with the gift card.

Anchor to
properties

The line item properties assigned to the gift card.

If there aren't any line item properties, then an EmptyDrop is returned.

Anchor to
qr_identifier

A string used to generate a QR code for the gift card.

Anchor to
recipient

The recipient associated with the gift card.

If there is no recipient associated with the gift card, then nil is returned.

Anchor to
send_on

The scheduled date on which the gift card will be sent to the recipient.

If the gift card does not have a scheduled date, then nil is returned.

Tip

Use the date filter to format the date.

Anchor to
template_suffix

The name of the custom template assigned to the gift card.

The name doesn't include the gift_card. prefix, or the .liquid file extension.

If a custom template isn't assigned to the gift card, then nil is returned.

The URL to view the gift card. This URL is on the checkout.shopify.com domain.

Tip

The page at this URL is rendered through the gift_card.liquid template of the theme.

Anchor to
variant

The variant associated with the gift card.

If there is no variant associated with the gift card, then nil is returned.

{
"balance": 5000,
"code": "WCGX 7X97 K9HJ DFR8",
"currency": "CAD",
"customer": {},
"enabled": true,
"expired": false,
"expires_on": null,
"initial_value": 5000,
"last_four_characters": "DFR8",
"message": null,
"send_on": null,
"pass_url": "https://polinas-potent-potions.myshopify.com/v1/passes/pass.com.shopify.giftcardnext/94af7fbe55d010130df8d8bc4a338d36/",
"product": {},
"variant": {},
"properties": {},
"qr_identifier": "shopify-giftcard-v1-3TKWJKJBM3X7PBRK",
"recipient": null,
"template_suffix": null,
"url": "https://checkout.shopify.com/gift_cards/56174706753/0011c591fc720d0a51b80cdb694f969e"
}
Was this section helpful?