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

## Changes

- **2024-06-13** `c9e9cdda4cb7` — 2 info
  - api tag `Transactions` added
  - api tag `Transaction` removed
- **2023-09-27** `7e6920bdee2e` — 1 info
  - the `orderInfo` request property default value `{"orderId":"v500","sequence":5006128,"cart":{"items":[{"id":"2001023","productId":"2000492","refId":"35994","name":"insert name here","value":14.99,"price":14.99,"quantity":1,"shippingDiscount":0,"discount":2.5,"priceTags":[{"name":"insert name here","value":0}]}],"grandTotal":0,"discounts":2.5,"shipping":7.27,"taxes":0,"itemsTotal":14.99},"clientProfile":{"email":"email@email.com.br","firstName":"example","lastName":"example","document":"02906792063","phone":"+551111111111","birthDate":"0001-01-01T00:00:00","isCorporate":false},"shipping":{"receiverName":"example","postalCode":"22250040","city":"Rio de Janeiro","state":"RJ","country":"BRA","street":"Praia de Botafogo","number":"11","neighborhood":"example","complement":null,"reference":null}}` was removed

[Change history](https://skmtc.dev/vtex/apis/giftcard-api/changes/giftcards/:giftCardId/transactions/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/108d07014ee3/schema)
