> 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

# GetGiftCard

# Package: giftCards

# Namespace: GiftCardService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/gift-cards/gift-cards/get-gift-card.md

## Permission Scopes:
Manage eCommerce - all permissions: SCOPE.DC-ECOM-MEGA.MANAGE-ECOM

## Introduction

Retrieves a gift card by ID.

Use this method to get current gift card details including balance, status, and metadata.
The gift card code is obfuscated in the response for security.

---

## REST API

### Schema

```
 Method: getGiftCard
 Description: Retrieves a gift card by GUID.  Use this method to get current gift card details including balance, status, and metadata. The gift card code is obfuscated in the response for security.
 URL: https://www.wixapis.com/gift-cards/v1/gift-cards/{giftCardId}
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  giftCardId
 Method parameters: 
   param name: giftCardId | type:   none | required: true 
 Return type: GetGiftCardResponse
  - name: giftCard | type: GiftCard | description: Retrieved gift card with obfuscated code for security.  
     - ONE-OF: 
        - name: orderInfo | type: OrderInfo | description: Order details when the gift card was purchased through an order.  | validation: immutable
           - name: orderId | type: string | description: Order GUID associated with the gift card purchase.  | validation: format GUID, immutable
           - name: orderNumber | type: string | description: Human-readable order number displayed to customers. For example, `"1001"`.  | validation: maxLength 100, format DECIMAL_VALUE, immutable, decimalValue {"gt":"0","maxScale":0}
     - name: id | type: string | description: Gift card GUID.  | read-only: true | validation: format GUID
     - name: code | type: string | description: Gift card code used for redemption.  > **Notes:** > + The gift card code can be custom-provided or automatically generated by omitting the field. > + The `code` field contains the **obfuscated** gift card code, for example, `****-****-****-4444`. > + Only the returned code is obfuscated. You can still find a gift card by filtering `code` with the full code.  | validation: minLength 8, maxLength 20, immutable
     - name: initialValue | type: Amount | description: Initial monetary value assigned to the gift card when created.  | validation: immutable
        - name: amount | type: string | description: Monetary amount in the specified currency as a decimal string. For example, `"10.50"` for $10.50, or `"100"` for $100.00.  | validation: format DECIMAL_VALUE, decimalValue {"gte":"0","maxScale":2}
        - name: formattedAmount | type: string | description: Amount formatted with currency symbol for display purposes. For example: `"$10.50"` or `"€25.00"`.  | read-only: true | validation: maxLength 20
     - name: balance | type: Amount | description: Current available balance that can be spent.  Decreases when the gift card is used for purchases and increases with refunds.  | read-only: true 
     - name: currency | type: string | description: Three-letter currency code in [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format. For example, `"USD"`, `"EUR"`.  | validation: format CURRENCY, immutable
     - name: expirationDate | type: string | description: Date and time when the gift card expires and becomes unusable.  | validation: format date-time, immutable
     - name: createdDate | type: string | description: Date and time the gift card was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the gift card was last updated.  | read-only: true | validation: format date-time
     - name: disabledDate | type: string | description: Date and time the gift card was disabled, if applicable.  | read-only: true | validation: format date-time
     - name: notificationInfo | type: NotificationInfo | description: Email notification settings including recipient, sender, and delivery options.  | validation: immutable
        - name: recipient | type: Recipient | description: Recipient information for email delivery.  | validation: immutable
           - name: email | type: string | description: Email address where the gift card will be sent.  | validation: format EMAIL, immutable
           - name: name | type: string | description: Display name shown in the gift card email.  | validation: maxLength 200, immutable
        - name: notificationDate | type: string | description: Scheduled date and time to send the gift card email notification. Leave empty to send the email immediately.  | validation: format date-time, immutable
        - name: personalizedMessage | type: string | description: Custom message to include in the gift card email. Personalizes the gift card for the recipient.  | validation: minLength 1, maxLength 500, immutable
        - name: sender | type: Sender | description: Sender information for email display.  | validation: immutable
           - name: email | type: string | description: Email address displayed in the gift card notification.  | validation: format EMAIL, immutable
           - name: name | type: string | description: Display name shown in the gift card email.  | validation: maxLength 200, immutable
     - name: source | type: Source | description: How the gift card was created.  | validation: immutable
         - enum:
         -     ORDER: Gift card was purchased through an order.
         -     MANUAL: Gift card was created manually via API.
     - name: codeSuffix | type: string | description: Last 4 characters of the gift card code for search and identification purposes.  | read-only: true | validation: minLength 4, maxLength 4


```

### Examples

### Get Gift Card
Retrieves an existing gift card by ID

```curl
curl -X GET \
  'https://www.wixapis.com/gift-cards/v1/gift-cards/ec3c4a90-cf46-4325-913b-c2ab2ae36549' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.giftVouchers.giftVouchers.getGiftCard(giftCardId)
 Description: Retrieves a gift card by GUID.  Use this method to get current gift card details including balance, status, and metadata. The gift card code is obfuscated in the response for security.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  giftCardId
 Method parameters: 
   param name: giftCardId | type: string | description: Gift card GUID. | required: true | validation: format GUID
 Return type: PROMISE<GiftCard>
  - ONE-OF: 
     - name: orderInfo | type: OrderInfo | description: Order details when the gift card was purchased through an order.  | validation: immutable
        - name: orderId | type: string | description: Order GUID associated with the gift card purchase.  | validation: format GUID, immutable
        - name: orderNumber | type: string | description: Human-readable order number displayed to customers. For example, `"1001"`.  | validation: maxLength 100, format DECIMAL_VALUE, immutable, decimalValue {"gt":"0","maxScale":0}
  - name: _id | type: string | description: Gift card GUID.  | read-only: true | validation: format GUID
  - name: code | type: string | description: Gift card code used for redemption.  > **Notes:** > + The gift card code can be custom-provided or automatically generated by omitting the field. > + The `code` field contains the **obfuscated** gift card code, for example, `****-****-****-4444`. > + Only the returned code is obfuscated. You can still find a gift card by filtering `code` with the full code.  | validation: minLength 8, maxLength 20, immutable
  - name: initialValue | type: Amount | description: Initial monetary value assigned to the gift card when created.  | validation: immutable
     - name: amount | type: string | description: Monetary amount in the specified currency as a decimal string. For example, `"10.50"` for $10.50, or `"100"` for $100.00.  | validation: format DECIMAL_VALUE, decimalValue {"gte":"0","maxScale":2}
     - name: formattedAmount | type: string | description: Amount formatted with currency symbol for display purposes. For example: `"$10.50"` or `"€25.00"`.  | read-only: true | validation: maxLength 20
  - name: balance | type: Amount | description: Current available balance that can be spent.  Decreases when the gift card is used for purchases and increases with refunds.  | read-only: true 
  - name: currency | type: string | description: Three-letter currency code in [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format. For example, `"USD"`, `"EUR"`.  | validation: format CURRENCY, immutable
  - name: expirationDate | type: Date | description: Date and time when the gift card expires and becomes unusable.  | validation: immutable
  - name: _createdDate | type: Date | description: Date and time the gift card was created.  | read-only: true 
  - name: _updatedDate | type: Date | description: Date and time the gift card was last updated.  | read-only: true 
  - name: disabledDate | type: Date | description: Date and time the gift card was disabled, if applicable.  | read-only: true 
  - name: notificationInfo | type: NotificationInfo | description: Email notification settings including recipient, sender, and delivery options.  | validation: immutable
     - name: recipient | type: Recipient | description: Recipient information for email delivery.  | validation: immutable
        - name: email | type: string | description: Email address where the gift card will be sent.  | validation: format EMAIL, immutable
        - name: name | type: string | description: Display name shown in the gift card email.  | validation: maxLength 200, immutable
     - name: notificationDate | type: Date | description: Scheduled date and time to send the gift card email notification. Leave empty to send the email immediately.  | validation: immutable
     - name: personalizedMessage | type: string | description: Custom message to include in the gift card email. Personalizes the gift card for the recipient.  | validation: minLength 1, maxLength 500, immutable
     - name: sender | type: Sender | description: Sender information for email display.  | validation: immutable
        - name: email | type: string | description: Email address displayed in the gift card notification.  | validation: format EMAIL, immutable
        - name: name | type: string | description: Display name shown in the gift card email.  | validation: maxLength 200, immutable
  - name: source | type: Source | description: How the gift card was created.  | validation: immutable
     - enum:
     -     ORDER: Gift card was purchased through an order.
     -     MANUAL: Gift card was created manually via API.
  - name: codeSuffix | type: string | description: Last 4 characters of the gift card code for search and identification purposes.  | read-only: true | validation: minLength 4, maxLength 4


```

### Examples

### Get gift card by ID
```javascript
import { giftVouchers } from "@wix/gift-vouchers";

async function getGiftCard() {
  const response = await giftVouchers.getGiftCard(
    "ec3c4a90-cf46-4325-913b-c2ab2ae36549"
  );
  return response;
}

/* Promise resolves to:
 * {
 *   id: "ec3c4a90-cf46-4325-913b-c2ab2ae36549",
 *   code: "************4N6C",
 *   initialValue: { amount: "50", formattedAmount: "$50.00" },
 *   balance: { amount: "50", formattedAmount: "$50.00" },
 *   currency: "USD",
 *   expirationDate: null,
 *   createdDate: "2024-10-30T14:52:02.588Z",
 *   updatedDate: "2024-10-30T14:52:02.631Z",
 *   disabledDate: null,
 *   notificationInfo: {
 *     recipient: { email: "johndoe@gmail.com", name: "John Doe" },
 *     sender: { email: "janedoe@gmail.com", name: "Jane Doe" },
 *   },
 *   source: "ORDER",
 *   orderInfo: { orderId: "582e3195-de2d-4a83-a2ec-90ffe0e4d191", orderNumber: "10121" },
 * }
 */

```

### getGiftCard (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { giftVouchers } from '@wix/gift-vouchers';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { giftVouchers },
  // Include the auth strategy and host as relevant
});


async function getGiftCard(giftCardId) {
  const response = await myWixClient.giftVouchers.getGiftCard(giftCardId);
};
```

---