> 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

# CreateReward

# Package: rewards

# Namespace: LoyaltyRewards

# Method link: https://dev.wix.com/docs/api-reference/crm/loyalty-program/rewards/rewards/create-reward?apiView=SDK.md

## Permission Scopes:
Manage Loyalty: SCOPE.DC-LOYALTY.MANAGE-LOYALTY

## Introduction

Creates a reward that customers can redeem with loyalty points.

When a customer redeems a reward, a loyalty coupon is created
based on the specifications detailed in the `discountAmount` or `couponReward` fields. The customer can
then use this coupon to receive the discount. Note that while the Rewards API uses coupon scopes and specifications,
no coupon is actually created until a customer redeems a reward with points.
See the Coupons API for more information about coupons. You can't update the `type` of reward after it's created.

A reward's `active` status defaults to `false`. To make the reward available to customers,
either set the `active` field to `true` during creation or call Update Reward
to change the status.

To customize a reward for each loyalty tier, use `configsByTier`.
This allows you to specify the amount of the earned discount, the cost in loyalty points
to redeem the reward, and the tier to which this configuration applies. Each tier requires its own
`configsByTier` configuration. To create a reward that's available to loyalty accounts in the base tier,
leave the `tierId` field empty. See the Tiers API for more information on tiers.

---

## REST API

### Schema

```
 Method: createReward
 Description: Creates a reward that customers can redeem with loyalty points.  When a customer redeems a reward, a loyalty coupon is created based on the specifications detailed in the `discountAmount` or `couponReward` fields. The customer can then use this coupon to receive the discount. Note that while the Rewards API uses coupon scopes and specifications, no coupon is actually created until a customer redeems a reward with points. See the Coupons API for more information about coupons. You can't update the `type` of reward after it's created.  A reward's `active` status defaults to `false`. To make the reward available to customers, either set the `active` field to `true` during creation or call Update Reward to change the status.  To customize a reward for each loyalty tier, use `configsByTier`. This allows you to specify the amount of the earned discount, the cost in loyalty points to redeem the reward, and the tier to which this configuration applies. Each tier requires its own `configsByTier` configuration. To create a reward that's available to loyalty accounts in the base tier, leave the `tierId` field empty. See the Tiers API for more information on tiers.
 URL: https://www.wixapis.com/loyalty-rewards/v1/rewards
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  reward, reward.name
 Method parameters: 
   param name: reward | type: Reward | description: A loyalty reward is an object a customer can redeem with loyalty points. Redeeming a reward then creates a loyalty coupon that the customer can use. | required: true 
    - ONE-OF: - required: true
     - name: discountAmount | type: DiscountAmount | description: Discount details.  
        - name: configsByTier | type: array<DiscountAmountConfig> | description: Discount details for each tier.  | validation: maxItems 21
           - name: amount | type: string | description: Discount amount. Must be a positive value.  | validation: format DECIMAL_VALUE, decimalValue {"gt":"0","maxScale":2}
           - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier.  | validation: format GUID
           - name: costInPoints | type: integer | description: Amount of points required to redeem the reward.  | validation: minimum 1, maximum 9999999
     - name: couponReward | type: CouponReward | description: Coupon details.  
        - ONE-OF: 
           - name: fixedAmount | type: FixedAmountDiscount | description: Discount as a fixed amount.  
              - name: configsByTier | type: array<FixedAmountDiscountConfig> | description: Discount details for each tier.  | validation: minItems 1, maxItems 21
                 - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier.  | validation: format GUID
                 - name: costInPoints | type: integer | description: Amount of points required to redeem the reward.  | validation: minimum 1, maximum 9999999
                 - name: amount | type: number | description: Discount amount.  | validation: minimum 0.01
           - name: percentage | type: PercentageDiscount | description: Discount as a percentage.  
              - name: configsByTier | type: array<PercentageDiscountConfig> | description: Discount details for each tier.  | validation: minItems 1, maxItems 21
                 - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier.  | validation: format GUID
                 - name: costInPoints | type: integer | description: Amount of points required to redeem the reward.  | validation: minimum 1, maximum 9999999
                 - name: percentage | type: number | description: Percentage discount.  
           - name: freeShipping | type: FreeShippingDiscount | description: Free shipping.  
              - name: configsByTier | type: array<FreeShippingDiscountConfig> | description: Discount details for each tier.  | validation: minItems 1, maxItems 21
                 - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier.  | validation: format GUID
                 - name: costInPoints | type: integer | description: Amount of points required to redeem the reward.  | validation: minimum 1, maximum 9999999
        - ONE-OF: 
           - name: minimumSubtotal | type: number | description: Limit the coupon to carts with a subtotal greater than this number.  
           - name: scope | type: CouponScope | description: Specifies the type of line items this coupon applies to.  For more information, see [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values.md).  
              - name: namespace | type: string | description: Scope namespace.  See [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values.md) for valid namespaces.  
              - name: group | type: Group | description: Coupon scope's applied group.  See [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values.md) for valid groups.  
                 - name: name | type: string | description: Name of coupon scope's group.  See [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values.md) for valid groups.  
                 - name: entityId | type: string | description: Entity GUID, if the coupon scope is limited to just 1 item.  
        - name: limitedToOneItem | type: boolean | description: Whether the coupon is limited to 1 item.  
        - name: appliesToSubscriptions | type: boolean | description: Whether the coupon also applies to subscriptions.  
        - name: discountedCycleCount | type: integer | description: Specifies the amount of discounted cycles for a subscription item.  Can only be set when `appliesToSubscriptions` is `true` and `scope.namespace` is `pricingPlans`. If `discountedCycleCount` is empty, the coupon applies to all available cycles.  | validation: minimum 1, maximum 999, format int32
        - name: name | type: string | description: Reward name. | required: true | validation: minLength 1, maxLength 50
        - name: active | type: boolean | description: Whether the reward is active. Default: `FALSE`  
        - name: type | type: RewardType | description: Reward type.  
             - enum:
             -     UNDEFINED: Undefined reward type.
             -     DISCOUNT_AMOUNT: Discount reward. Special flexible reward type used in checkout.
             -     COUPON_REWARD: Coupon reward. [Learn more about coupons](https://support.wix.com/en/article/using-coupons-as-loyalty-rewards).
 Return type: CreateRewardResponse
  - name: reward | type: Reward | description: Created reward.  
     - ONE-OF: 
        - name: discountAmount | type: DiscountAmount | description: Discount details.  
           - name: configsByTier | type: array<DiscountAmountConfig> | description: Discount details for each tier.  | validation: maxItems 21
              - name: amount | type: string | description: Discount amount. Must be a positive value.  | validation: format DECIMAL_VALUE, decimalValue {"gt":"0","maxScale":2}
              - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier.  | validation: format GUID
              - name: costInPoints | type: integer | description: Amount of points required to redeem the reward.  | validation: minimum 1, maximum 9999999
        - name: couponReward | type: CouponReward | description: Coupon details.  
           - ONE-OF: 
              - name: fixedAmount | type: FixedAmountDiscount | description: Discount as a fixed amount.  
                 - name: configsByTier | type: array<FixedAmountDiscountConfig> | description: Discount details for each tier.  | validation: minItems 1, maxItems 21
                    - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier.  | validation: format GUID
                    - name: costInPoints | type: integer | description: Amount of points required to redeem the reward.  | validation: minimum 1, maximum 9999999
                    - name: amount | type: number | description: Discount amount.  | validation: minimum 0.01
              - name: percentage | type: PercentageDiscount | description: Discount as a percentage.  
                 - name: configsByTier | type: array<PercentageDiscountConfig> | description: Discount details for each tier.  | validation: minItems 1, maxItems 21
                    - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier.  | validation: format GUID
                    - name: costInPoints | type: integer | description: Amount of points required to redeem the reward.  | validation: minimum 1, maximum 9999999
                    - name: percentage | type: number | description: Percentage discount.  
              - name: freeShipping | type: FreeShippingDiscount | description: Free shipping.  
                 - name: configsByTier | type: array<FreeShippingDiscountConfig> | description: Discount details for each tier.  | validation: minItems 1, maxItems 21
                    - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier.  | validation: format GUID
                    - name: costInPoints | type: integer | description: Amount of points required to redeem the reward.  | validation: minimum 1, maximum 9999999
           - ONE-OF: 
              - name: minimumSubtotal | type: number | description: Limit the coupon to carts with a subtotal greater than this number.  
              - name: scope | type: CouponScope | description: Specifies the type of line items this coupon applies to.  For more information, see [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values.md).  
                 - name: namespace | type: string | description: Scope namespace.  See [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values.md) for valid namespaces.  
                 - name: group | type: Group | description: Coupon scope's applied group.  See [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values.md) for valid groups.  
                    - name: name | type: string | description: Name of coupon scope's group.  See [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values.md) for valid groups.  
                    - name: entityId | type: string | description: Entity GUID, if the coupon scope is limited to just 1 item.  
           - name: limitedToOneItem | type: boolean | description: Whether the coupon is limited to 1 item.  
           - name: appliesToSubscriptions | type: boolean | description: Whether the coupon also applies to subscriptions.  
           - name: discountedCycleCount | type: integer | description: Specifies the amount of discounted cycles for a subscription item.  Can only be set when `appliesToSubscriptions` is `true` and `scope.namespace` is `pricingPlans`. If `discountedCycleCount` is empty, the coupon applies to all available cycles.  | validation: minimum 1, maximum 999, format int32
     - name: id | type: string | description: Reward GUID.  | read-only: true | validation: format GUID
     - name: name | type: string | description: Reward name.  | validation: minLength 1, maxLength 50
     - name: active | type: boolean | description: Whether the reward is active. Default: `FALSE`  
     - name: type | type: RewardType | description: Reward type.  
         - enum:
         -     UNDEFINED: Undefined reward type.
         -     DISCOUNT_AMOUNT: Discount reward. Special flexible reward type used in checkout.
         -     COUPON_REWARD: Coupon reward. [Learn more about coupons](https://support.wix.com/en/article/using-coupons-as-loyalty-rewards).
     - name: revision | type: string | description: Revision number, which increments by 1 each time the loyalty reward is updated.  To prevent conflicting changes, the current `revision` must be passed when updating the loyalty reward.  | read-only: true | validation: format uint64
     - name: createdDate | type: string | description: Date and time the reward was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the reward was last updated.  | read-only: true | validation: format date-time


```

### Examples

### Create reward
```curl
curl -X POST \
  'https://www.wixapis.com/loyalty-rewards/v1/rewards' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  --data-raw '{
                 "reward": {
                   "active": true,
                   "name": "Free shipping",
                   "type": "COUPON_REWARD",
                   "couponReward": {
                     "freeShipping": {
                       "configsByTier": [
                         {
                           "tierId": null,
                           "costInPoints": 20
                         }
                       ]
                     }
                   }
                 }
               }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.loyalty.rewards.createReward(reward)
 Description: Creates a reward that customers can redeem with loyalty points.  When a customer redeems a reward, a loyalty coupon is created based on the specifications detailed in the `discountAmount` or `couponReward` fields. The customer can then use this coupon to receive the discount. Note that while the Rewards API uses coupon scopes and specifications, no coupon is actually created until a customer redeems a reward with points. See the Coupons API for more information about coupons. You can't update the `type` of reward after it's created.  A reward's `active` status defaults to `false`. To make the reward available to customers, either set the `active` field to `true` during creation or call Update Reward to change the status.  To customize a reward for each loyalty tier, use `configsByTier`. This allows you to specify the amount of the earned discount, the cost in loyalty points to redeem the reward, and the tier to which this configuration applies. Each tier requires its own `configsByTier` configuration. To create a reward that's available to loyalty accounts in the base tier, leave the `tierId` field empty. See the Tiers API for more information on tiers.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  reward, reward.name
 Method parameters: 
   param name: reward | type: Reward | description: A loyalty reward is an object a customer can redeem with loyalty points. Redeeming a reward then creates a loyalty coupon that the customer can use. | required: true 
    - ONE-OF: - required: true
     - name: discountAmount | type: DiscountAmount | description: Discount details.  
        - name: configsByTier | type: array<DiscountAmountConfig> | description: Discount details for each tier.  | validation: maxItems 21
           - name: amount | type: string | description: Discount amount. Must be a positive value.  | validation: format DECIMAL_VALUE, decimalValue {"gt":"0","maxScale":2}
           - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier.  | validation: format GUID
           - name: costInPoints | type: integer | description: Amount of points required to redeem the reward.  | validation: minimum 1, maximum 9999999
     - name: couponReward | type: CouponReward | description: Coupon details.  
        - ONE-OF: 
           - name: fixedAmount | type: FixedAmountDiscount | description: Discount as a fixed amount.  
              - name: configsByTier | type: array<FixedAmountDiscountConfig> | description: Discount details for each tier.  | validation: minItems 1, maxItems 21
                 - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier.  | validation: format GUID
                 - name: costInPoints | type: integer | description: Amount of points required to redeem the reward.  | validation: minimum 1, maximum 9999999
                 - name: amount | type: number | description: Discount amount.  | validation: minimum 0.01
           - name: percentage | type: PercentageDiscount | description: Discount as a percentage.  
              - name: configsByTier | type: array<PercentageDiscountConfig> | description: Discount details for each tier.  | validation: minItems 1, maxItems 21
                 - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier.  | validation: format GUID
                 - name: costInPoints | type: integer | description: Amount of points required to redeem the reward.  | validation: minimum 1, maximum 9999999
                 - name: percentage | type: number | description: Percentage discount.  
           - name: freeShipping | type: FreeShippingDiscount | description: Free shipping.  
              - name: configsByTier | type: array<FreeShippingDiscountConfig> | description: Discount details for each tier.  | validation: minItems 1, maxItems 21
                 - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier.  | validation: format GUID
                 - name: costInPoints | type: integer | description: Amount of points required to redeem the reward.  | validation: minimum 1, maximum 9999999
        - ONE-OF: 
           - name: minimumSubtotal | type: number | description: Limit the coupon to carts with a subtotal greater than this number.  
           - name: scope | type: CouponScope | description: Specifies the type of line items this coupon applies to.  For more information, see [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values.md).  
              - name: namespace | type: string | description: Scope namespace.  See [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values.md) for valid namespaces.  
              - name: group | type: Group | description: Coupon scope's applied group.  See [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values.md) for valid groups.  
                 - name: name | type: string | description: Name of coupon scope's group.  See [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values.md) for valid groups.  
                 - name: entityId | type: string | description: Entity GUID, if the coupon scope is limited to just 1 item.  
        - name: limitedToOneItem | type: boolean | description: Whether the coupon is limited to 1 item.  
        - name: appliesToSubscriptions | type: boolean | description: Whether the coupon also applies to subscriptions.  
        - name: discountedCycleCount | type: integer | description: Specifies the amount of discounted cycles for a subscription item.  Can only be set when `appliesToSubscriptions` is `true` and `scope.namespace` is `pricingPlans`. If `discountedCycleCount` is empty, the coupon applies to all available cycles.  | validation: minimum 1, maximum 999, format int32
        - name: name | type: string | description: Reward name. | required: true | validation: minLength 1, maxLength 50
        - name: active | type: boolean | description: Whether the reward is active. Default: `FALSE`  
        - name: type | type: RewardType | description: Reward type.  
             - enum:
             -     UNDEFINED: Undefined reward type.
             -     DISCOUNT_AMOUNT: Discount reward. Special flexible reward type used in checkout.
             -     COUPON_REWARD: Coupon reward. [Learn more about coupons](https://support.wix.com/en/article/using-coupons-as-loyalty-rewards).
 Return type: PROMISE<Reward>
  - ONE-OF: 
     - name: discountAmount | type: DiscountAmount | description: Discount details.  
        - name: configsByTier | type: array<DiscountAmountConfig> | description: Discount details for each tier.  | validation: maxItems 21
           - name: amount | type: string | description: Discount amount. Must be a positive value.  | validation: format DECIMAL_VALUE, decimalValue {"gt":"0","maxScale":2}
           - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier.  | validation: format GUID
           - name: costInPoints | type: integer | description: Amount of points required to redeem the reward.  | validation: minimum 1, maximum 9999999
     - name: couponReward | type: CouponReward | description: Coupon details.  
        - ONE-OF: 
           - name: fixedAmount | type: FixedAmountDiscount | description: Discount as a fixed amount.  
              - name: configsByTier | type: array<FixedAmountDiscountConfig> | description: Discount details for each tier.  | validation: minItems 1, maxItems 21
                 - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier.  | validation: format GUID
                 - name: costInPoints | type: integer | description: Amount of points required to redeem the reward.  | validation: minimum 1, maximum 9999999
                 - name: amount | type: number | description: Discount amount.  | validation: minimum 0.01
           - name: percentage | type: PercentageDiscount | description: Discount as a percentage.  
              - name: configsByTier | type: array<PercentageDiscountConfig> | description: Discount details for each tier.  | validation: minItems 1, maxItems 21
                 - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier.  | validation: format GUID
                 - name: costInPoints | type: integer | description: Amount of points required to redeem the reward.  | validation: minimum 1, maximum 9999999
                 - name: percentage | type: number | description: Percentage discount.  
           - name: freeShipping | type: FreeShippingDiscount | description: Free shipping.  
              - name: configsByTier | type: array<FreeShippingDiscountConfig> | description: Discount details for each tier.  | validation: minItems 1, maxItems 21
                 - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier.  | validation: format GUID
                 - name: costInPoints | type: integer | description: Amount of points required to redeem the reward.  | validation: minimum 1, maximum 9999999
        - ONE-OF: 
           - name: minimumSubtotal | type: number | description: Limit the coupon to carts with a subtotal greater than this number.  
           - name: scope | type: CouponScope | description: Specifies the type of line items this coupon applies to.  For more information, see [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values.md).  
              - name: namespace | type: string | description: Scope namespace.  See [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values.md) for valid namespaces.  
              - name: group | type: Group | description: Coupon scope's applied group.  See [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values.md) for valid groups.  
                 - name: name | type: string | description: Name of coupon scope's group.  See [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values.md) for valid groups.  
                 - name: entityId | type: string | description: Entity GUID, if the coupon scope is limited to just 1 item.  
        - name: limitedToOneItem | type: boolean | description: Whether the coupon is limited to 1 item.  
        - name: appliesToSubscriptions | type: boolean | description: Whether the coupon also applies to subscriptions.  
        - name: discountedCycleCount | type: integer | description: Specifies the amount of discounted cycles for a subscription item.  Can only be set when `appliesToSubscriptions` is `true` and `scope.namespace` is `pricingPlans`. If `discountedCycleCount` is empty, the coupon applies to all available cycles.  | validation: minimum 1, maximum 999, format int32
  - name: _id | type: string | description: Reward GUID.  | read-only: true | validation: format GUID
  - name: name | type: string | description: Reward name.  | validation: minLength 1, maxLength 50
  - name: active | type: boolean | description: Whether the reward is active. Default: `FALSE`  
  - name: type | type: RewardType | description: Reward type.  
     - enum:
     -     UNDEFINED: Undefined reward type.
     -     DISCOUNT_AMOUNT: Discount reward. Special flexible reward type used in checkout.
     -     COUPON_REWARD: Coupon reward. [Learn more about coupons](https://support.wix.com/en/article/using-coupons-as-loyalty-rewards).
  - name: revision | type: string | description: Revision number, which increments by 1 each time the loyalty reward is updated.  To prevent conflicting changes, the current `revision` must be passed when updating the loyalty reward.  | read-only: true | validation: format uint64
  - name: _createdDate | type: Date | description: Date and time the reward was created.  | read-only: true 
  - name: _updatedDate | type: Date | description: Date and time the reward was last updated.  | read-only: true 


```

### Examples

### Create reward
```javascript
import { rewards } from "@wix/loyalty";

const reward = {
  active: true,
  name: "Free shipping",
  type: "COUPON_REWARD" as const,
  couponReward: {
    freeShipping: {
      configsByTier: [{ tierId: null, costInPoints: 20 }],
    },
  },
};

async function createReward() {
  const response = await rewards.createReward(reward);
}

```

### createReward (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 { rewards } from '@wix/loyalty';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function createReward(reward) {
  const response = await myWixClient.rewards.createReward(reward);
};
```

---