Newer Version Available
Commerce Webstore Promotions, Evaluate Action
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.
If a store is segmented into markets, this API looks at the language parameter appended to the URL to determine the shopper’s locale and returns the appropriate values.
- Resource
-
1/commerce/promotions/actions/evaluate - Available version
- 56.0
- HTTP methods
- POST
- Request body for POST
-
- JSON example
-
1{ 2 "cart": { 3 "currencyIsoCode": "USD", 4 "id": "0a6xx0000000001AAA", 5 "cartItems": [ 6 { 7 "id": "0a9xx000000001dAAA", 8 "type": "Product", 9 "product2Id": "01txx0000006i2SAAQ", 10 "sku": null, 11 "quantity": 9, 12 "salesPrice": 154.25 13 } 14 ] 15 }, 16 "couponCodes": [ 17 "P10" 18 ], 19 "webStoreId":"0ZExx000000006TGAQ", 20 "isItemizeHeaderAdjustments" : "true", 21 "effectiveAccountId": "001xx000003GZ6NAAW" 22} - Properties
-
Name Type Description Required or Optional Available Version cart Promotion Cart Input Cart and its items. Required 56.0 cartDeliveryGroups Promotion Cart Delivery Group Input[] List of cart delivery groups associated with the items in the cart. Available if shipping promotions are enabled. Required when evaluating shipping promotions 57.0 couponCodes String[] List of coupon codes to enable promotions. A customer can apply a maximum of two coupons per cart. Optional 56.0 effectiveAccountId String ID of the account for which the request is made. Optional 56.0 isItemizeHeaderAdjustments Boolean Specifies whether order-level adjustments are itemized (true) or not (false). If unspecified, the default value is false. Optional 56.0 parentProducts Promotion Parent Products Input[] Map of the parent product ID to its variation product IDs. Optional 56.0 productCategories Promotion Product Categories Input[] Map of product IDs to their associated category IDs. Optional 56.0 segments String[] All promotions associated with promotion segments specified in this list are active and can be evaluated against the cart. Additionally, any segments associated with a store or buyer group are also still evaluated against the cart. If this field is not present, only the promotions associated with a store or buyer group are evaluated. Optional 56.0 webStoreId List<String> ID of the store for which the request is made. If unspecified, defined segments must be used instead. Optional 56.0
- Response body for POST
- Promotion Evaluation