Setup

To use the Coupons API, install the @wix/loyalty package using npm or Yarn:

Copy
1
npm install @wix/loyalty

or

Copy
1
yarn add @wix/loyalty

Then import { coupons } from @wix/loyalty:

Copy
1
import { coupons } from '@wix/loyalty'
Was this helpful?
Yes
No

deleteLoyaltyCoupon( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Deletes a loyalty coupon.

The deletion of a loyalty coupon does not impact the functionality of the corresponding coupon itself.

Note: This endpoint requires visitor or member authentication.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Loyalty
Learn more about permission scopes.
Copy
function deleteLoyaltyCoupon(_id: string, revision: string): Promise<void>
Method Parameters
_idstringRequired

ID of the loyalty coupon to delete.


revisionstringRequired

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.

Was this helpful?
Yes
No

getCurrentMemberCoupons( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves the loyalty coupons for the currently logged-in member.

Note: This endpoint requires visitor or member authentication.

Permission Scopes

For app development, you must have one of the following permission scopes:
Read Loyalty
Manage Loyalty
Learn more about permission scopes.
Copy
function getCurrentMemberCoupons(): Promise<GetCurrentMemberCouponsResponse>
Request
This method does not take any parameters
Returns
Return Type:Promise<GetCurrentMemberCouponsResponse>
Was this helpful?
Yes
No

getLoyaltyCoupon( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a loyalty coupon.

Note: This endpoint requires visitor or member authentication.

Permission Scopes

For app development, you must have one of the following permission scopes:
Read Loyalty
Manage Loyalty
Learn more about permission scopes.
Copy
function getLoyaltyCoupon(loyaltyCouponId: string): Promise<LoyaltyCoupon>
Method Parameters
loyaltyCouponIdstringRequired

ID of the loyalty coupon to retrieve.

Returns
Return Type:Promise<LoyaltyCoupon>
Was this helpful?
Yes
No

queryLoyaltyCoupons( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Permission Scopes

For app development, you must have one of the following permission scopes:
Read Loyalty
Manage Loyalty
Learn more about permission scopes.
Copy
function queryLoyaltyCoupons(): LoyaltyCouponsQueryBuilder
Request
This method does not take any parameters
Returns
Was this helpful?
Yes
No

redeemCurrentMemberPointsForCoupon( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

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

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.

Note: This endpoint requires visitor or member authentication.

Copy
function redeemCurrentMemberPointsForCoupon(rewardId: string): Promise<RedeemCurrentMemberPointsForCouponResponse>
Method Parameters
rewardIdstringRequired

ID of the loyalty reward to redeem.

Returns
Return Type:Promise<RedeemCurrentMemberPointsForCouponResponse>
Was this helpful?
Yes
No

redeemPointsForCoupon( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

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

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.

Note: This endpoint requires visitor or member authentication.

Copy
function redeemPointsForCoupon(rewardId: string, options: RedeemPointsForCouponOptions): Promise<RedeemPointsForCouponResponse>
Method Parameters
rewardIdstringRequired

ID of the loyalty reward to redeem.


optionsRedeemPointsForCouponOptionsRequired
Returns
Return Type:Promise<RedeemPointsForCouponResponse>
Was this helpful?
Yes
No