Setup
To use the Coupons API, install the @wix/loyalty
package using npm or Yarn:
1npm install @wix/loyalty
or
1yarn add @wix/loyalty
Then import { coupons }
from @wix/loyalty
:
1import { coupons } from '@wix/loyalty'
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:function deleteLoyaltyCoupon(_id: string, revision: string): Promise<void>
ID of the loyalty coupon to delete.
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.
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:function getCurrentMemberCoupons(): Promise<GetCurrentMemberCouponsResponse>
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:function getLoyaltyCoupon(loyaltyCouponId: string): Promise<LoyaltyCoupon>
ID of the loyalty coupon to retrieve.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves a list of loyalty coupons, given the provided paging, filtering, and sorting.
Note: This endpoint requires visitor or member authentication.
PROPERTY | SUPPORTED FILTERS & SORTING |
---|---|
memberId | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() ,ascending() ,descending() |
transactionId | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() ,ascending() ,descending() |
couponReference | eq() ,ne() ,exists() ,in() ,hasSome() ,ascending() ,descending() |
status | eq() ,ne() ,exists() ,in() ,hasSome() ,ascending() ,descending() |
rewardName | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() ,ascending() ,descending() |
_createdDate | eq() ,ne() ,exists() ,in() ,hasSome() ,lt() ,le() ,gt() ,ge() ,ascending() ,descending() |
_updatedDate | eq() ,ne() ,exists() ,in() ,hasSome() ,lt() ,le() ,gt() ,ge() ,ascending() ,descending() |
Permission Scopes
For app development, you must have one of the following permission scopes:function queryLoyaltyCoupons(): LoyaltyCouponsQueryBuilder
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.
function redeemCurrentMemberPointsForCoupon(rewardId: string): Promise<RedeemCurrentMemberPointsForCouponResponse>
ID of the loyalty reward to redeem.
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.
function redeemPointsForCoupon(rewardId: string, options: RedeemPointsForCouponOptions): Promise<RedeemPointsForCouponResponse>
ID of the loyalty reward to redeem.