---
title: "Create a gift card"
method: POST
path: "/giftcards"
tags: ["Gift Card"]
---

# Create a gift card

`POST /giftcards`

Creates a gift card for a specific user.

>⚠️ The `redemptionCode` field is auto-generated during gift card creation and cannot be set to an arbitrary value.

## Permissions

Any user or [application key](https://developers.vtex.com/docs/guides/authentication-overview#application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint:

| **Product** | **Category** | **Resource** |
| --------------- | ----------------- | ----------------- |
| GiftCard | GiftCard | **Gift card full access** |

There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint. To learn more about authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).

>❗ To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.

## Headers

- `Content-Type` string, required
- `Accept` string, required

## Response `200`

OK

- Response — Gift card information.
  - `id` string, required — Gift card identification.
  - `redemptionToken` string, required — Gift card redemption token.
  - `redemptionCode` string, required — Gift card identification code used at checkout. Minimum of 6 characters.
  - `balance` number, required — Gift card current balance. For newly created gift cards, the balance will be 0.0.
  - `relationName` string, required — Field to be filled in when it is not necessary to use a loyalty program for the gift card. Note that a new `relationNamevalue` is required for each new gift card to be created.
  - `emissionDate` string, required — Gift card creation date.
  - `expiringDate` string, required — Gift card expiration date.
  - `caption` string, required — Field to be filled in if a loyalty program must be created for the Gift Card.
  - `currencyCode` string — Currency code in ISO 4217.
  - `transactions` Transactions, required — Transactions information.
    - `href` string, required — Gift card resource URL. The number described in the URL refers to the gift card identification.

## Changes

- **2023-09-27** `465fb57948c0` — 1 breaking
  - the `balance` response's property type changed from `integer` to `number` for status `200`
- **2023-09-27** `7e6920bdee2e` — 2 warning
  - deleted the `header` request parameter `X-VTEX-API-AppKey`
  - deleted the `header` request parameter `X-VTEX-API-AppToken`
- **2023-08-30** `0af884ae7f9e` — 1 breaking
  - the `balance` response's property format changed from `int32` to no format for status `200`

[Change history](https://skmtc.dev/vtex/apis/giftcard-api/changes/giftcards/post.md)

---

[API](https://skmtc.dev/vtex/apis/giftcard-api.md) · [All operations](https://skmtc.dev/vtex/apis/giftcard-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/vtex/giftcard-api/revisions/c9e9cdda4cb7/schema)
