Search.../

redeemCurrentMemberPointsForCoupon( )

Developer Preview

Redeems a current customer's loyalty points for a loyalty reward and creates a loyalty coupon.

Description

Creating a loyalty coupon also creates a corresponding "reference" coupon with the Coupons API. The customer receives the reference coupon, which they can apply to their order. The loyalty coupon and its corresponding reference coupon are linked and the loyalty coupon's status reflects the current state of the reference coupon.

Check which loyalty rewards a site has available with List Rewards.

Syntax

function redeemCurrentMemberPointsForCoupon(rewardId: string): Promise<RedeemCurrentMemberPointsForCouponResponse>

redeemCurrentMemberPointsForCoupon Parameters

NAME
TYPE
DESCRIPTION
rewardId
string

ID of the loyalty reward to redeem.

Returns

Return Type:

Promise<
RedeemCurrentMemberPointsForCouponResponse
>
NAME
TYPE
DESCRIPTION
coupon
LoyaltyCoupon

Created loyalty coupon.

Was this helpful?

redeemCurrentMemberPointsForCoupon example

Copy Code
1import { coupons } from 'wix-loyalty.v2';
2
3 async function redeemCurrentMemberPointsForCoupon(rewardId) {
4 try {
5 const result = await coupons.redeemCurrentMemberPointsForCoupon(rewardId);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13