CommercePromotions Class
Evaluate promotions for Commerce orders. Get coupon code redemption usage.
These methods are for CommercePromotions. All methods are static.
Don’t write an Apex test that calls these CommercePromotions APIs within the context of a guest.
-
decreaseRedemption(couponCodeRedemption)
Get coupon code redemption usage to revert a previously redeemed coupon code.
-
Determine which promotions the customer is eligible for based on the store and buyer group, and compute the applicable price adjustments based on the coupons and the items in the cart. This API evaluates only the first 50 active manual promotions and first 50 active automatic promotions, based on priority. This API computes and returns applicable price adjustments, but it does not apply those adjustments to the webcart record. If you want to enable promotions based on shipping, contact Salesforce Customer Support.
-
increaseRedemption(couponCodeRedemption)
Get coupon code redemption addition (increase) usage.
Get coupon code redemption usage to revert a previously redeemed coupon code.
58.0
58.0
No
public static ConnectApi.CouponCodeRedemptionCollection decreaseRedemption(ConnectApi.CouponCodeRedemptionInput couponCodeRedemption)
- couponCodeRedemption
Type:
ConnectApi.CouponCodeRedemptionInputTracks each coupon code redemption.
Type: ConnectApi.CouponCodeRedemptionCollection
Determine which promotions the customer is eligible for based on the store and buyer group, and compute the applicable price adjustments based on the coupons and the items in the cart. This API evaluates only the first 50 active manual promotions and first 50 active automatic promotions, based on priority. This API computes and returns applicable price adjustments, but it does not apply those adjustments to the webcart record. If you want to enable promotions based on shipping, contact Salesforce Customer Support.
57.0
57.0
No
global static ConnectApi.PromotionEvaluation evaluate(ConnectApi.PromotionEvaluateInput salesTransaction)
- salesTransaction
Type:
ConnectApi.PromotionEvaluateInputFind promotions that the customer is eligible for and compute their discounts.
Type: ConnectApi.PromotionEvaluation
Get coupon code redemption addition (increase) usage.
58.0
58.0
No
public static ConnectApi.CouponCodeRedemptionCollection increaseRedemption(ConnectApi.CouponCodeRedemptionInput couponCodeRedemption)
- couponCodeRedemption
Type:
ConnectApi.CouponCodeRedemptionInputTracks each coupon code redemption.