> 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: Coupons

# Type: Coupon Object

# Link: https://dev.wix.com/docs/api-reference/crm/loyalty-program/rewards/coupons/coupon-object.md

## Description: A loyalty coupon is created when a customer redeems their loyalty points for a reward. Creating a loyalty coupon
also creates a corresponding "reference" coupon with the Coupons API.

## Schema:

```json
 Type: Coupon Object | type: LoyaltyCoupon
 Description: A loyalty coupon is created when a customer redeems their loyalty points for a reward. Creating a loyalty coupon
also creates a corresponding "reference" coupon with the Coupons API.
       - name: id  | type: string | description: Loyalty coupon ID.
       - name: accountId  | type: string | description: Loyalty [account ID](https://dev.wix.com/docs/rest/crm/loyalty-program/accounts/account-object.md) of the customer that redeemed points for a coupon.
       - name: memberIdDeprecated  | type: string | description: Member ID of the customer that redeemed points for a coupon. See the Members API for more information.
       - name: memberId  | type: string | description: Member ID of the customer that redeemed points for a coupon. See the Members API for more information.
           - name: value  | type: string | description: 
       - name: transactionId  | type: string | description: [Transaction ID](https://dev.wix.com/docs/rest/crm/loyalty-program/transactions/loyalty-transaction-object.md) for the transaction that created a coupon.
       - name: couponReference  | type: CouponReference | description: Reference coupon information for the corresponding [coupon](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/coupon-object.md) that is created along with the loyalty coupon.
           - name: couponId  | type: string | description: Coupon ID.
           - name: code  | type: string | description: Coupon code.  Unique code entered by a customer to apply the coupon.
           - name: name  | type: string | description: Name of coupon.
           - name: specification  | type: Specification | description: The information to use when creating the coupon.
               - name: name  | type: string | description: Name of coupon.
               - name: type  | type: string | description: 
               - name: limitedToOneItem  | type: boolean | description: Whether the coupon is limited to 1 discount per order. If true and a customer pays for multiple items that the coupon applies to, only the lowest priced item is discounted. Coupons with a `bookings` `namespace` are always limited to 1 item.
               - name: appliesToSubscriptions  | type: boolean | description: Whether the coupon also applies to subscriptions.
               - name: discountedCycleCount  | type: number | description: Specifies the amount of cycles to apply the discount to for a subscription item.  Can only be set when `appliesToSubscriptions` is `TRUE` and `specification.scope.namespace` is `pricingPlans`. If `discountedCycleCount` is empty, the coupon applies to all available cycles.  Min: `1`  Max: `999`
               - ONE-OF:
                   - name: moneyOffAmount  | type: number | description: Fixed price discount.
                   - name: percentOffRate  | type: number | description: Discount as a percentage.
                   - name: freeShipping  | type: boolean | description: Free shipping. If true, the coupon applies to all items in all `namespaces` on a site.
                   - name: fixedPriceAmount  | type: number | description: Specific sale price. Currently only supported for coupons with a `stores` `namespace`.
                   - name: buyXGetY  | type: BuyXGetY | description: Free products when making a purchase. `buyXGetY` is an object that specifies `x` and `y` in the following scenario: if a visitor purchases x number of products, they receive y number of products for free. C urrently only supported for coupons with a `stores` `namespace`.
               - ONE-OF:
                   - name: scope  | type: Scope | description: Scope of the coupon. When no scope is defined, the coupon applies to all items in all `namespaces` in the site.
                   - name: minimumSubtotal  | type: number | description: The coupon is only applicable when the order subtotal is over this amount.
           - name: deleted  | type: boolean | description: Whether the referenced coupon was deleted.
               - name: value  | type: boolean | description: 
       - name: status  | type: string | description: Loyalty coupon status.  This status relates to the corresponding coupon that is created at the same time as the loyalty coupon and is included in `couponReference`.
           enum: UNKNOWN, PENDING, ACTIVE, APPLIED, FAILED, ARCHIVED
       - name: rewardName  | type: string | description: Name of reward that was redeemed to create this coupon.
       - name: revision  | type: string | description: Revision number, which increments by 1 each time the loyalty coupon is updated.  To prevent conflicting changes, the current `revision` must be passed when updating the loyalty coupon.
           - name: value  | type: number | description: 
       - name: createdDate  | type: string | description: Date and time the loyalty coupon was created.
           - name: seconds  | type: string | description: 
           - name: nanos  | type: number | description: 
       - name: updatedDate  | type: string | description: Date and time the loyalty coupon was last updated.
       - name: refundable  | type: boolean | description: Whether the loyalty coupon was created in a "refundable workflow" i.e. checkout-exchange, and therefore can be deleted in the background. Refundable coupons should not be visible to customers in the UI.

```