> 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`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # ListRewards # Package: rewards # Namespace: LoyaltyRewards # Method link: https://dev.wix.com/docs/api-reference/crm/loyalty-program/rewards/rewards/list-rewards.md ## Permission Scopes: Read Loyalty: SCOPE.DC-LOYALTY.READ-LOYALTY ## Introduction Retrieves a list of rewards. The list includes rewards that are currently nonredeemable due to insufficient points held by any customers. --- ## REST API ### Schema ``` Method: listRewards Description: Retrieves a list of rewards. The list includes rewards that are currently nonredeemable due to insufficient points held by any customers. URL: https://www.wixapis.com/v1/rewards Method: GET Method parameters: param name: cursorPaging | type: CursorPaging - name: limit | type: integer | description: Maximum number of items to return in the results. - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. Return type: ListRewardsResponse - name: rewards | type: array | description: Retrieved loyalty rewards. - ONE-OF: - name: discountAmount | type: DiscountAmount | description: Discount details. - name: configsByTier | type: array | description: Discount details for each tier. - name: amount | type: string | description: Discount amount. Must be a positive value. - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier. - name: costInPoints | type: integer | description: Amount of points required to redeem the reward. - name: couponReward | type: CouponReward | description: Coupon details. - ONE-OF: - name: fixedAmount | type: FixedAmountDiscount | description: Discount as a fixed amount. - name: configsByTier | type: array | description: Discount details for each tier. - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier. - name: costInPoints | type: integer | description: Amount of points required to redeem the reward. - name: amount | type: number | description: Discount amount. - name: percentage | type: PercentageDiscount | description: Discount as a percentage. - name: configsByTier | type: array | description: Discount details for each tier. - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier. - name: costInPoints | type: integer | description: Amount of points required to redeem the reward. - name: percentage | type: number | description: Percentage discount. - name: freeShipping | type: FreeShippingDiscount | description: Free shipping. - name: configsByTier | type: array | description: Discount details for each tier. - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier. - name: costInPoints | type: integer | description: Amount of points required to redeem the reward. - 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. - name: id | type: string | description: Reward GUID. - name: name | type: string | description: Reward name. - 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. - name: createdDate | type: string | description: Date and time the reward was created. - name: updatedDate | type: string | description: Date and time the reward was last updated. - name: pagingMetadata | type: PagingMetadataV2 | description: Details on the paged set of results returned. - name: count | type: integer | description: Number of items returned in the response. - name: offset | type: integer | description: Offset that was requested. - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field. - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. - name: next | type: string | description: Cursor string pointing to the next page in the list of results. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. ``` ### Examples ### List rewards ```curl curl -X GET \ 'https://www.wixapis.com/loyalty-rewards/v1/rewards' \ -H 'Authorization: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.rewards.LoyaltyRewards.listRewards(options) Description: Retrieves a list of rewards. The list includes rewards that are currently nonredeemable due to insufficient points held by any customers. Method parameters: param name: options | type: ListRewardsOptions none - name: cursorPaging | type: CursorPaging | description: Pagination options. - name: limit | type: integer | description: Maximum number of items to return in the results. - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. Return type: PROMISE - name: rewards | type: array | description: Retrieved loyalty rewards. - ONE-OF: - name: discountAmount | type: DiscountAmount | description: Discount details. - name: configsByTier | type: array | description: Discount details for each tier. - name: amount | type: string | description: Discount amount. Must be a positive value. - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier. - name: costInPoints | type: integer | description: Amount of points required to redeem the reward. - name: couponReward | type: CouponReward | description: Coupon details. - ONE-OF: - name: fixedAmount | type: FixedAmountDiscount | description: Discount as a fixed amount. - name: configsByTier | type: array | description: Discount details for each tier. - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier. - name: costInPoints | type: integer | description: Amount of points required to redeem the reward. - name: amount | type: number | description: Discount amount. - name: percentage | type: PercentageDiscount | description: Discount as a percentage. - name: configsByTier | type: array | description: Discount details for each tier. - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier. - name: costInPoints | type: integer | description: Amount of points required to redeem the reward. - name: percentage | type: number | description: Percentage discount. - name: freeShipping | type: FreeShippingDiscount | description: Free shipping. - name: configsByTier | type: array | description: Discount details for each tier. - name: tierId | type: string | description: Tier GUID, or empty if config applies to the base tier. - name: costInPoints | type: integer | description: Amount of points required to redeem the reward. - 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. - name: _id | type: string | description: Reward GUID. - name: name | type: string | description: Reward name. - 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. - name: _createdDate | type: Date | description: Date and time the reward was created. - name: _updatedDate | type: Date | description: Date and time the reward was last updated. - name: pagingMetadata | type: PagingMetadataV2 | description: Details on the paged set of results returned. - name: count | type: integer | description: Number of items returned in the response. - name: offset | type: integer | description: Offset that was requested. - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field. - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. - name: next | type: string | description: Cursor string pointing to the next page in the list of results. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. ``` ### Examples ### listRewards ```javascript import { rewards } from '@wix/loyalty'; async function listRewards(options) { const response = await rewards.listRewards(options); }; ``` ### listRewards (with elevated permissions) ```javascript import { rewards } from '@wix/loyalty'; import { auth } from '@wix/essentials'; async function myListRewardsMethod(options) { const elevatedListRewards = auth.elevate(rewards.listRewards); const response = await elevatedListRewards(options); } ``` ### listRewards (self-hosted) Self-hosted 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 listRewards(options) { const response = await myWixClient.rewards.listRewards(options); }; ``` ---