---
title: "Create a gift card transaction"
method: POST
path: "/giftcards/{giftCardId}/transactions"
tags: ["Transactions"]
---

# Create a gift card transaction

`POST /giftcards/{giftCardId}/transactions`

Creates a transaction (credit or debit) to a gift card and authorize the item reservation.

## Permissions

Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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 API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.

## Path parameters

- `giftCardId` string, required

## Headers

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

## Request body

- CreateGiftCardTransactionRequest — Transaction information.
  - `operation` string, required — Type of operation. Possible values are: `Debit` or `Credit`.
  - `value` number, required — Operation value.
  - `description` string, required — Description information.
  - `redemptionToken` string, required — Gift card redemption token.
  - `redemptionCode` string, required — Gift card identification code used at checkout. Minimum of 6 characters.
  - `requestId` string, required — Request identification of the transaction. You need to send a different `requestId` value every time you make a new transaction. If you send the same `requestId`two or more times with a specific `redemptionCode`or `redemptionToken`, the gift card balance will not be updated.
  - `orderInfo` OrderInfo — Order information.
    - `orderId` string — Order ID.
    - `sequence` integer — Sequence number.
    - `cart` Cart1 — Order information.
      - `items` Item2[], required — Items information.
        - `id` string, required — SKU ID.
        - `productId` string, required — Product ID.
        - `refId` string, required — Product Reference ID.
        - `name` string, required — Product name.
        - `value` number, required — Product value.
        - `price` number, required — Product price.
        - `quantity` integer, required — Product quantity.
        - `shippingDiscount` integer, required — Discount to be applied for the shipping value.
        - `discount` number, required — Discount applied on item.
        - `priceTags` PriceTag[], required — Array of price tags, each of which modifies the price in some way, like discounts or rates that apply to the item in the context of the order.
          - `name` string, required — Price tag name.
          - `value` integer, required — Price tag value.
      - `grandTotal` integer, required — Total payment value.
      - `discounts` number, required — Discounts value.
      - `shipping` number, required — Shipping value.
      - `taxes` integer, required — Taxes value.
      - `itemsTotal` number, required — Total items value.
    - `clientProfile` ClientProfile — Client Profile information.
      - `email` string, required — Customer's email address.
      - `firstName` string, required — Customer's first name.
      - `lastName` string, required — Customer's last name.
      - `document` string, required — Document number informed by the customer.
      - `phone` string, required — Customer's phone number.
      - `birthDate` string, required — Customer's birth date.
      - `isCorporate` boolean, required — Defines if the customer is a company (`true`) or not (`false`).
    - `shipping` Shipping — Shipping information.
      - `receiverName` string, required — Name of the person who is going to receive the order.
      - `postalCode` string, required — Postal code.
      - `city` string, required — City of the shipping address.
      - `state` string, required — State of the shipping address.
      - `country` string, required — Country of the shipping address.
      - `street` string, required — Street of the shipping address.
      - `number` string, required — Number of the building, house or apartment in the shipping address.
      - `neighborhood` string, required — Neighborhood of the address.
      - `complement` string, nullable, required — Complement to the shipping address in case it applies.
      - `reference` string, nullable, required — Complement that might help locate the shipping address more precisely in case of delivery.

## Response `200`

OK

- Response3 — Transaction information.
  - `id` string, required — Transaction identification.
  - `_self` Self, required — Object that carries an auto reference of the transaction (on its API).
    - `href` string, required — Gift card resource URL. The first number described in the URL refers to the gift card identification. The second number, refers to the transaction identification.

---

[API](https://skmtc.net/vtex/apis/giftcard-api.md) · [All operations](https://skmtc.net/vtex/apis/giftcard-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vtex/giftcard-api/versions/9df748187523/schema)
