Give specific reward
Give Specific Reward
Description
The action is used to give a specific reward to a member.
Parameters
| Parameter |
Type |
Format |
Description |
| Reward Object |
Object |
Text |
Object containing reward details. See the Reward Structure for details on the object structure. |
| Check Limit |
Boolean |
Text |
Optional. Whether to check reward limits. Defaults to true |
| Reward Counter |
Number |
Text |
Optional. Counter for the reward |
JavaScript API
UDF.addSpecificReward(rewardObj, checkLimit, rewardCounter, callback)
Events Triggered
Possible Errors
| Error Code |
Error Message |
Description |
| 3001 |
Reward policy with "%s" "%s" not found while adding reward to member with unique id "%s" |
Reported if no matching reward policy is found (matched by name). |
| 1611 |
Reward Policy %s is not yet effective |
Reported if the policy's effectiveDate is after the activity date. |
| 1684 |
Reward does not belong to member program |
Reported if the reward isn't defined on the program to which the member belongs. |
| 1680 |
Reward cannot be added for member %s with status %s |
Reported if the member's status isn't in policy.applicableMemberStatus. |
| 2023 |
Reward Policy has already expired on %s |
Reported if the reward policy has expired. |
| 2049 |
No more available redemptions for reward "%s" |
Reported when policy.availableRedemptions <= 0. If checkLimit is false, this error is logged and swallowed. |
| 4041 |
Division Access Denied for user |
Reported when user lacks division access for the reward policy. |
Additional Considerations
- The
Reward Object parameter can be a single reward object or an array of reward objects.
- Each reward object must include
name (the action sets lookupField to name and lookupValue to the supplied name).
- If the action receives multiple reward objects with the same
code, every duplicate after the first is replaced by a freshly generated UUID.
- The action sets
member, program, and org on each reward object before invoking member.addSpecificReward.
- When
checkLimit is false, error 2049 (no more redemptions) is logged and swallowed; other errors still propagate.
rewardCounter defaults to 1 when omitted.