Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Gift cards

The gift card object and the allowed CRUD operations on the related resource endpoint

A gift card is a store-issued payment instrument with an outstanding balance. All gift cards must be activated before use. Rechargeable gift cards can be reloaded at any time. Single-use gift cards become redeemed after the first use, regardless of how much of the balance is used.

You can set an expiration date for a gift card. Expired gift cards can no longer be used, but they remain active so you can use them again once the expiration date is updated.

You can associate a gift card with a market if you want to restrict its availability to that market.

Log information

Two attributes provide additional information:

  • balance_log — check this attribute to browse the history of a gift card's balance changes.

  • usage_log — check this attribute for more information about how, when, and by which order the gift card has been used.

Log retention

Both log attributes retain only the most recent 100 entries. Older entries are dropped at write time to keep the fields compact:

  • Balance — the most recent entries up to the cap are kept, older ones are discarded.

  • Usage — entries are grouped by order. The cap applies globally across all orders: the most recent entries are retained regardless of which order they belong to, and orders whose entries fall entirely outside the cap are removed.

The retention limit is designed to keep log payloads compact. For high-volume gift cards with a long history, only the most recent activity will be visible in these attributes.

Using gift cards as payment

Gift card redemption is managed through payment sessions. To apply a gift card to an order, create a payment session using a gift card payment setting and provide the gift card code. The session amount is automatically capped at the gift card's available balance.

Balance usage and restore

A gift card's balance is debited when the related payment authorization succeeds. Gift card sessions are captured automatically, so the session moves straight to paid and the debit can't be voided. To credit the balance back, issue a payment refund against the session's capture: the refunded amount is restored to the gift card (a redeemed single-use gift card is reactivated).

You can cap how much a restore can credit back by setting the balance_max_cents attribute on the gift card. When present, any restore — refund, automatic, or otherwise — is capped at that value rather than added without limit.

Last updated