> 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 # GetReferralReward # Package: referralProgram # Namespace: ReferralRewards # Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/referral-program/referral-rewards/get-referral-reward.md ## Permission Scopes: Manage Referrals: SCOPE.DC-REFERRALS.MANAGE-REFERRALS ## Introduction Retrieves a referral reward. --- ## REST API ### Schema ``` Method: getReferralReward Description: Retrieves a referral reward. URL: https://www.wixapis.com/v1/referral-rewards/{id} Method: GET # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: id Method parameters: param name: id | type: none | required: true Return type: GetReferralRewardResponse - name: referralReward | type: ReferralReward | description: Retrieved referral reward. - ONE-OF: - name: coupon | type: Coupon | description: Details of a coupon reward. Present when `rewardType` is `COUPON`. - name: id | type: string | description: Coupon GUID. Example: `8934b045-7052-4a90-be2b-832c70afc9da`. - name: code | type: string | description: The code that customers can use to apply the coupon. Example: `6RFD2A3HSPXW`. - name: status | type: Status | description: Current status of the coupon. - enum: - UNKNOWN: Coupon status is unknown or not specified. - ACTIVE: Coupon is active and can be applied to purchases. - APPLIED: Coupon was applied and can't be used again. - DELETED: Coupon was deleted and is no longer valid. - name: couponSpecification | type: Coupon | description: Detailed specifications of the coupon. - ONE-OF: - name: fixedAmountOptions | type: FixedAmountDiscount | description: Options for fixed amount discount. - name: amount | type: number | description: Amount of the discount as a fixed value. - name: percentageOptions | type: PercentageDiscount | description: Options for percentage discounts. - name: percentage | type: number | description: Percentage of discount. - ONE-OF: - name: minimumSubtotal | type: number | description: Limit the coupon to carts with a subtotal above this number. - name: scope | type: CouponScope | description: Specifies the type of line items this coupon will apply to. See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values). - name: namespace | type: string | description: Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans) - name: group | type: Group | description: Coupon scope's applied group, for example, Event or ticket in Wix Events. - name: name | type: string | description: Name of the group. - name: entityId | type: string | description: Entity GUID of the group. - name: name | type: string | description: Coupon name. - name: discountType | type: DiscountType | description: Coupon discount type. - enum: - UNKNOWN: Unknown discount type. - FIXED_AMOUNT: Discount as a fixed amount. - PERCENTAGE: Discount as a percentage. - FREE_SHIPPING: Free shipping. If `true`, the coupon applies to all items in all `namespaces`. - name: limitedToOneItem | type: boolean | description: Whether the coupon is limited to one item. If `true` and a customer pays for multiple items, the discount applies to only the lowest priced item. Coupons with a bookings `scope.namespace` are always limited to one item. - name: appliesToSubscriptions | type: boolean | description: Whether the coupon applies to subscription products. - name: discountedCycleCount | type: integer | description: Specifies the amount of discounted cycles for a subscription item. - Can only be set when `scope.namespace = pricingPlans`. - If `discountedCycleCount` is empty, the coupon applies to all available cycles. - `discountedCycleCount` is ignored if `appliesToSubscriptions = true`. Max: `999` - name: loyaltyPoints | type: LoyaltyPoints | description: Details of a loyalty points reward. Present when `rewardType` is `LOYALTY_POINTS`. - name: transactionId | type: string | description: Loyalty transaction GUID. - name: amount | type: integer | description: The number of loyalty points awarded. - name: id | type: string | description: Referral reward GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the referral reward is updated. To prevent conflicting changes, the current revision must be passed when updating the referral reward. - name: createdDate | type: string | description: Date and time the referral reward was created. - name: updatedDate | type: string | description: Date and time the referral reward was last updated. - name: rewardType | type: Type | description: Type of reward given. - enum: - UNKNOWN: Unknown reward type. - COUPON: Loyalty coupon is given. - LOYALTY_POINTS: Loyalty points are awarded. - NOTHING: No reward is given. ``` ### Examples ### Get Referral Reward ```curl curl -X GET \ 'https://www.wixapis.com/_api/referral-rewards/v1/referral-rewards/c8c732cf-2ca2-4025-9b1c-3be02f099cdb' \ -H 'Authorization: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.referralProgram.ReferralRewards.getReferralReward(_id) Description: Retrieves a referral reward. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: _id Method parameters: param name: _id | type: string | description: Referral reward GUID. | required: true Return type: PROMISE - ONE-OF: - name: coupon | type: Coupon | description: Details of a coupon reward. Present when `rewardType` is `COUPON`. - name: _id | type: string | description: Coupon GUID. Example: `8934b045-7052-4a90-be2b-832c70afc9da`. - name: code | type: string | description: The code that customers can use to apply the coupon. Example: `6RFD2A3HSPXW`. - name: status | type: Status | description: Current status of the coupon. - enum: - UNKNOWN: Coupon status is unknown or not specified. - ACTIVE: Coupon is active and can be applied to purchases. - APPLIED: Coupon was applied and can't be used again. - DELETED: Coupon was deleted and is no longer valid. - name: couponSpecification | type: Coupon | description: Detailed specifications of the coupon. - ONE-OF: - name: fixedAmountOptions | type: FixedAmountDiscount | description: Options for fixed amount discount. - name: amount | type: number | description: Amount of the discount as a fixed value. - name: percentageOptions | type: PercentageDiscount | description: Options for percentage discounts. - name: percentage | type: number | description: Percentage of discount. - ONE-OF: - name: minimumSubtotal | type: number | description: Limit the coupon to carts with a subtotal above this number. - name: scope | type: CouponScope | description: Specifies the type of line items this coupon will apply to. See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values). - name: namespace | type: string | description: Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans) - name: group | type: Group | description: Coupon scope's applied group, for example, Event or ticket in Wix Events. - name: name | type: string | description: Name of the group. - name: entityId | type: string | description: Entity GUID of the group. - name: name | type: string | description: Coupon name. - name: discountType | type: DiscountType | description: Coupon discount type. - enum: - UNKNOWN: Unknown discount type. - FIXED_AMOUNT: Discount as a fixed amount. - PERCENTAGE: Discount as a percentage. - FREE_SHIPPING: Free shipping. If `true`, the coupon applies to all items in all `namespaces`. - name: limitedToOneItem | type: boolean | description: Whether the coupon is limited to one item. If `true` and a customer pays for multiple items, the discount applies to only the lowest priced item. Coupons with a bookings `scope.namespace` are always limited to one item. - name: appliesToSubscriptions | type: boolean | description: Whether the coupon applies to subscription products. - name: discountedCycleCount | type: integer | description: Specifies the amount of discounted cycles for a subscription item. - Can only be set when `scope.namespace = pricingPlans`. - If `discountedCycleCount` is empty, the coupon applies to all available cycles. - `discountedCycleCount` is ignored if `appliesToSubscriptions = true`. Max: `999` - name: loyaltyPoints | type: LoyaltyPoints | description: Details of a loyalty points reward. Present when `rewardType` is `LOYALTY_POINTS`. - name: transactionId | type: string | description: Loyalty transaction GUID. - name: amount | type: integer | description: The number of loyalty points awarded. - name: _id | type: string | description: Referral reward GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the referral reward is updated. To prevent conflicting changes, the current revision must be passed when updating the referral reward. - name: _createdDate | type: Date | description: Date and time the referral reward was created. - name: _updatedDate | type: Date | description: Date and time the referral reward was last updated. - name: rewardType | type: Type | description: Type of reward given. - enum: - UNKNOWN: Unknown reward type. - COUPON: Loyalty coupon is given. - LOYALTY_POINTS: Loyalty points are awarded. - NOTHING: No reward is given. ``` ### Examples ### getReferralReward ```javascript import { rewards } from '@wix/referral'; async function getReferralReward(_id) { const response = await rewards.getReferralReward(_id); }; ``` ### getReferralReward (with elevated permissions) ```javascript import { rewards } from '@wix/referral'; import { auth } from '@wix/essentials'; async function myGetReferralRewardMethod(_id) { const elevatedGetReferralReward = auth.elevate(rewards.getReferralReward); const response = await elevatedGetReferralReward(_id); } ``` ### getReferralReward (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/referral'; // 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 getReferralReward(_id) { const response = await myWixClient.rewards.getReferralReward(_id); }; ``` ---