> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Introduction

## Article: Introduction

## Article Link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/payments/gift-cards/gift-cards/introduction.md

## Article Content:

# About the Wix eCommerce Gift Card API

The Wix eCommerce Gift Card API enables clients to perform various operations related to gift cards, including retrieving gift card data, applying gift card balances to purchases, and voiding previously redeemed transactions.

## Use cases
- [Check a gift card balance during checkout](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/payments/gift-cards/gift-cards/sample-flows.md#check-a-gift-card-balance-during-checkout)
- [Apply a gift card balance to a purchase](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/payments/gift-cards/gift-cards/sample-flows.md#apply-a-gift-card-balance-to-a-purchase)
- [Void a gift card transaction](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/payments/gift-cards/gift-cards/sample-flows.md#void-a-gift-card-transaction)

## Before you begin
- Redeem and Void actions require the `appId` of the gift card provider, as returned in [Get Checkout](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/checkout/checkout/get-checkout.md) `giftCard.appId` or [List Transactions for Single Order](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/order-transactions/list-transactions-for-single-order.md) `payments.giftcardPaymentDetails.appId`. 
- For these APIs to function, a gift card provider must be integrated into the site. This integration can be achieved by any of the following:
  - Marking your app as [dependent](https://dev.wix.com/docs/build-apps/launch-your-app/market-listing/add-your-app-audience-info.md) on Wix Stores, Wix Bookings, or Wix Restaurants, which blocks the installation of your app and prompts users to install the required app first.
  - Making your app dependent on a third-party app that implements the Service Plugin. There is currently no way to block installation on sites that don't have the third-party app installed, or to check that a site has installed the required app.
  - Building your own app that implements the [Wix eCommerce Gift Cards Service Plugin](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/payments/gift-cards/gift-cards-service-plugin/introduction.md).

## Terminology
- **Redeem**: Applying a gift card balance to a purchase, including subtracting the applied value from the gift card balance.
- **Void**: Reversing a redeem action and returning the applied value to the gift card balance.

## SDK Setup
  `@wix/ecom`

To use the API, install the `@wix/ecom` package.

#### Install the package

Follow the installation instructions for your development environment.

| Development environment | Installation method |
|--|--|
| Wix sites (editor or IDE) | Use the [package manager](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/packages/work-with-npm-packages-in-the-editor.md). |
| Wix sites (local IDE) | Run `wix install @wix/ecom` using the [Wix CLI](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/packages/work-with-npm-packages-with-the-wix-cli.md).|
| Blocks apps | Use the same installation method as Wix sites. |
| CLI and self-hosted apps | Run `npm install @wix/ecom` or `yarn add @wix/ecom`. |
| Headless sites and apps | Run `npm install @wix/ecom` or `yarn add @wix/ecom`. |

#### Import the package

To import the package in your code:

```js
import { giftVouchers } from '@wix/ecom'
```

#### Import types

Types for this API are accessed through the `giftVouchers` namespace you already imported above, as `giftVouchers.<TypeName>`, using any type name shown in these docs.
  