# The gift card object

A gift card object is returned as part of the response body of each successful list, retrieve, create or update API call to the `/api/gift_cards` endpoint.

## Fields

| Field                                      | Type       | Description                                                                                                                                                                                         |
| ------------------------------------------ | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **type**                                   | `string`   | `gift_cards`                                                                                                                                                                                        |
| **id**                                     | `string`   | The gift card unique identifier                                                                                                                                                                     |
| links.**self**                             | `string`   | The gift card endpoint URL                                                                                                                                                                          |
| attributes.**status**                      | `string`   | The gift card status. One of 'draft' (default), 'inactive', 'active', or 'redeemed'.                                                                                                                |
| attributes.**code**                        | `string`   | The gift card code UUID. If not set, it's automatically generated.                                                                                                                                  |
| attributes.**currency\_code**              | `string`   | The international 3-letter currency code as defined by the ISO 4217 standard.                                                                                                                       |
| attributes.**initial\_balance\_cents**     | `integer`  | The gift card initial balance, in cents.                                                                                                                                                            |
| attributes.**initial\_balance\_float**     | `float`    | The gift card initial balance, float.                                                                                                                                                               |
| attributes.**formatted\_initial\_balance** | `string`   | The gift card initial balance, formatted.                                                                                                                                                           |
| attributes.**balance\_cents**              | `integer`  | The gift card balance, in cents.                                                                                                                                                                    |
| attributes.**balance\_float**              | `float`    | The gift card balance, float.                                                                                                                                                                       |
| attributes.**formatted\_balance**          | `string`   | The gift card balance, formatted.                                                                                                                                                                   |
| attributes.**balance\_max\_cents**         | `integer`  | The gift card balance max, in cents.                                                                                                                                                                |
| attributes.**balance\_max\_float**         | `float`    | The gift card balance max, float.                                                                                                                                                                   |
| attributes.**formatted\_balance\_max**     | `string`   | The gift card balance max, formatted.                                                                                                                                                               |
| attributes.**balance\_log**                | `array`    | The gift card balance log. Tracks all the gift card transactions.                                                                                                                                   |
| attributes.**usage\_log**                  | `object`   | The gift card usage log. Tracks all the gift card usage actions by orders.                                                                                                                          |
| attributes.**single\_use**                 | `boolean`  | Indicates if the gift card can be used only one.                                                                                                                                                    |
| attributes.**rechargeable**                | `boolean`  | Indicates if the gift card can be recharged.                                                                                                                                                        |
| attributes.**distribute\_discount**        | `boolean`  | Indicates if redeemed gift card amount is distributed for tax calculation.                                                                                                                          |
| attributes.**image\_url**                  | `string`   | The URL of an image that represents the gift card.                                                                                                                                                  |
| attributes.**expires\_at**                 | `datetime` | Time at which the gift card will expire.                                                                                                                                                            |
| attributes.**recipient\_email**            | `string`   | The email address of the associated recipient. When creating or updating a gift card, this is a shortcut to find or create the associated recipient by email.                                       |
| attributes.**\_purchase**                  | `boolean`  | Send this attribute if you want to confirm a draft gift card. The gift card becomes 'inactive', waiting to be activated.                                                                            |
| attributes.**\_activate**                  | `boolean`  | Send this attribute if you want to activate a gift card.                                                                                                                                            |
| attributes.**\_deactivate**                | `boolean`  | Send this attribute if you want to deactivate a gift card.                                                                                                                                          |
| attributes.**\_balance\_change\_cents**    | `integer`  | The balance change, in cents. Send a negative value to reduces the card balance by the specified amount. Send a positive value to recharge the gift card (if rechargeable).                         |
| attributes.**\_add\_tags**                 | `string`   | Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.                                                              |
| attributes.**\_remove\_tags**              | `string`   | Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.                                                            |
| attributes.**created\_at**                 | `datetime` | Time at which the resource was created.                                                                                                                                                             |
| attributes.**updated\_at**                 | `datetime` | Time at which the resource was last updated.                                                                                                                                                        |
| attributes.**reference**                   | `string`   | A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever. |
| attributes.**reference\_origin**           | `string`   | Any identifier of the third party system that defines the reference code.                                                                                                                           |
| attributes.**metadata**                    | `object`   | Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.                                        |
| relationships.**market**                   | `object`   | The associated market (optional).                                                                                                                                                                   |
| relationships.**gift\_card\_recipient**    | `object`   | The associated gift card recipient (optional).                                                                                                                                                      |
| relationships.**attachments**              | `array`    | The associated attachments.                                                                                                                                                                         |
| relationships.**events**                   | `array`    | The associated events.                                                                                                                                                                              |
| relationships.**tags**                     | `array`    | The associated tags. Cannot be passed by sales channels.                                                                                                                                            |
| relationships.**versions**                 | `array`    | The associated changes.                                                                                                                                                                             |
| relationships.**event\_stores**            | `array`    | The associated event stores.                                                                                                                                                                        |
| meta.**mode**                              | `string`   | The resource environment (can be one of `test` or `live`)                                                                                                                                           |
