Skip to content

Give reward by upc

Give Reward by UPC

Description

The action is used to give a reward to a member using UPC code.

Parameters

Parameter Type Format Description
Policy ID String Text ID of the reward policy
UPC String Text UPC code for the reward
Number of Uses Number Text Number of times the reward can be used
Reward Counter Number Text Counter for the reward
External Fields Object Text Optional. Additional fields to add to the reward
Expiration Date Date Text Optional. Expiration date for the reward

JavaScript API

UDF.giveRewardByUPC(policyId, upc, noOfUses, rewardCounter, extFields, expirationDate, callback)

Events Triggered

Possible Errors

Error Code Error Message Description
3001 Reward policy with "_id" "%s" not found while adding reward to member with unique id "%s" Reported if no matching reward policy is found by _id.
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.
4041 Division Access Denied for user Reported when user lacks division access for the reward policy.

Additional Considerations

  • Unlike most other reward-issuing actions, this action does not accept a checkLimit parameter — limit errors always propagate.
  • The supplied External Fields object is passed through to the reward as-is.
  • The Number of Uses parameter sets noOfUses on the reward (corresponds to usesLeft on the resulting member reward).