createReward( )


Creates a reward that can be redeemed with loyalty points.

When a customer redeems a reward, a loyalty coupon is created based on the specifications detailed in either the discountAmount or couponReward fields. This coupon can then be used by the customer to receive the discount. Note that while the Rewards API uses coupon scopes and specifications, no coupon is actually created until a reward is redeemed with points. See the Coupons API for more information about coupons.

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 updateReward() to change the status.

To customize a reward for each loyalty tier, use the configsByTier parameter. 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 is available to loyalty accounts in the base tier, leave the tierId field empty. See the Loyalty Tiers API for more information on tiers.

Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user’s permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Loyalty
Learn more about app permissions.
Method Declaration
Copy
function createReward(reward: Reward): Promise<Reward>;
Method Parameters
rewardRewardRequired

Reward to create.

Returns
Return Type:Promise<Reward>
JavaScript
import { rewards } from "@wix/loyalty"; async function createReward(reward) { const response = await rewards.createReward(reward); }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?