Newer Version Available
CommercePromotions Class
Evaluate promotions for Commerce orders. Get coupon code redemption usage.
Namespace
CommercePromotions Methods
These methods are for CommercePromotions. All
methods are static.
decreaseRedemption(couponCodeRedemption)
API Version
58.0
Available to Guest Users
58.0
Requires Chatter
No
Signature
public static ConnectApi.CouponCodeRedemptionCollection decreaseRedemption(ConnectApi.CouponCodeRedemptionInput couponCodeRedemption)
Parameters
- couponCodeRedemption
- Type: ConnectApi.CouponCodeRedemptionInput
- Tracks each coupon code redemption.
Return Value
evaluate(salesTransaction)
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.
API Version
57.0
Available to Guest Users
57.0
Requires Chatter
No
Signature
global static ConnectApi.PromotionEvaluation evaluate(ConnectApi.PromotionEvaluateInput salesTransaction)
Parameters
- salesTransaction
- Type: ConnectApi.PromotionEvaluateInput
- Find promotions that the customer is eligible for and compute their discounts.
Return Value
increaseRedemption(couponCodeRedemption)
API Version
58.0
Available to Guest Users
58.0
Requires Chatter
No
Signature
public static ConnectApi.CouponCodeRedemptionCollection increaseRedemption(ConnectApi.CouponCodeRedemptionInput couponCodeRedemption)
Parameters
- couponCodeRedemption
- Type: ConnectApi.CouponCodeRedemptionInput
- Tracks each coupon code redemption.