loyalty/redeem/reward
Redeem a reward
Fields
appId
• string required
appId
• string requiredThe unique identifier for the store. This value is accessible at the block level via tapcartData?.appId
rewardId
• string required
rewardId
• string requiredThe unique identifier of the reward to be redeemed
Description
Redeems a specified reward for the customer through the enabled loyalty provider.
Example
Tapcart.action("loyalty/rewards", {
appId: "AbC123XyZ9",
rewardId: 12345
});
// Alternatively
Tapcart.actions?.redeemLoyaltyReward({
appId: tapcartData?.appId,
rewardId: Number("12345")
})
Response Structure
The returned identity object contains:
{
code: string; // Discount code to redeem
createdAt: Date; // Timestamp when the reward was created
description?: string; // Optional description of the reward
customAttributes?: T; // Optional raw custom data from the provider API
}
Important Notes
- Upon redeeming a reward or completing a purchase, the customer’s loyalty data is automatically refreshed by invoking
loyalty/customer
, ensuring their points balance is current and accurate.
Updated about 17 hours ago