> For the complete documentation index, see [llms.txt](https://docs.commercelayer.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.commercelayer.io/core-api-reference/2026-05/gift_cards.md).

# 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.

{% hint style="info" %}
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.
{% endhint %}

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.

{% hint style="info" %}
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.
{% endhint %}

## Using gift cards as payment

Gift card redemption is managed through [payment sessions](/core-api-reference/2026-05/payment_sessions.md). To apply a gift card to an order, create a payment session using a [gift card payment setting](/core-api-reference/2026-05/payment_setting_gift_cards.md) and provide the gift card code. The session amount is automatically capped at the gift card's available balance.

{% hint style="success" %}
Multiple gift card sessions can be combined with other payment methods to cover the full order total.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.commercelayer.io/core-api-reference/2026-05/gift_cards.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
