Newer Version Available

This content describes an older version of this product. View Latest

CommercePromotions Class

Evaluate promotions for Commerce orders. Get coupon code redemption usage.

Namespace

ConnectApi

CommercePromotions Methods

The following are methods for CommercePromotions. All methods are static.

decreaseRedemption(couponCodeRedemption)

Get coupon code redemption usage to revert a previously redeemed coupon code.

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.

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

Type: ConnectApi.PromotionEvaluation

increaseRedemption(couponCodeRedemption)

Get coupon code redemption addition (increase) usage.

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.