QuillObjects
Gift Card
The gift card object for balances, redemption, and card details.
The gift_card object represents a gift card or store credit. It is available on gift card display pages and through customer.wallet for balance checks.
Properties
| Property | Type | Description |
|---|---|---|
gift_card.code | string | The full gift card code |
gift_card.code_last4 | string | The last 4 characters of the code |
gift_card.balance | number | The remaining balance |
gift_card.initial_value | number | The original amount when issued |
gift_card.currency | string | The currency code |
gift_card.enabled | boolean | true if the card is active |
gift_card.expired | boolean | true if the card has expired |
gift_card.expires_on | string | The expiration date, if set |
gift_card.customer | customer | The customer this card is assigned to |
gift_card.sender_name | string | Who sent the gift card |
gift_card.personal_message | string | A message from the sender |
gift_card.source_type | string | How the card was created: admin, purchase, refund, promotion, loyalty, auto |
Displaying a gift card
<div class="gift-card">
<p class="gift-card__code">{{ gift_card.code }}</p>
<p class="gift-card__balance">Balance: {{ gift_card.balance | money }}</p>
{% if gift_card.personal_message %}
<blockquote>
<p>{{ gift_card.personal_message }}</p>
<cite>From {{ gift_card.sender_name }}</cite>
</blockquote>
{% endif %}
{% if gift_card.expires_on %}
<p class="gift-card__expiry">
{% if gift_card.expired %}
Expired on {{ gift_card.expires_on | date: '%d %B %Y' }}
{% else %}
Expires {{ gift_card.expires_on | date: '%d %B %Y' }}
{% endif %}
</p>
{% endif %}
</div>Customer wallet
The customer's wallet balance is the sum of all active gift cards and store credit:
{% if customer and customer.wallet > 0 %}
<p>You have {{ customer.wallet | money }} in store credit.</p>
{% endif %}