Newer Version Available
Commerce Webstore Promotions, Execute Action
- Resource
-
1/commerce/webstores/webstoreId/promotions/actions/execute - Available version
- 53.0
- Requires Chatter
- No
- HTTP methods
- POST
- Request body for POST
-
- Root XML tag
- <salesTransaction>
- JSON example (percentage discount applied to entire transaction)
-
1{ 2 "effectiveAccountId":"001RM000004ywq7YAA", 3 "salesTransaction":{ 4 "attributes":{ 5 "type":"WebCart" 6 }, 7 "Id":"0a6RM00000009XAYAY", 8 "CurrencyIsoCode":"USD", 9 "WebCartAdjustmentGroups":{ 10 "records":[ 11 { 12 "attributes":{ 13 "type":"WebCartAdjustmentGroup" 14 }, 15 "AdjustmentSource":"Promotion", 16 "AdjustmentType":"AdjustmentPercentage", 17 "AdjustmentValue":-20, 18 "PriceAdjustmentCauseId":"0c8RM0000004CrMYAU", 19 "Priority":2 20 } 21 ] 22 }, 23 "CartItems":{ 24 "records":[ 25 { 26 "attributes":{ 27 "type":"CartItem" 28 }, 29 "Id":"0a9RM0000004OseYAE", 30 "Product2Id":"01tRM000000QVWKYA4", 31 "Quantity":15, 32 "SalesPrice":45.00, 33 "CartItemPriceAdjustments":{ 34 "records":[ 35 { 36 "attributes":{ 37 "type":"CartItemPriceAdjustment" 38 }, 39 "AdjustmentSource":"Promotion", 40 "AdjustmentType":"AdjustmentPercentage", 41 "AdjustmentValue":"-10.0", 42 "PriceAdjustmentCauseId":"0c8RM00000000xUYAQ", 43 "Priority":1 44 } 45 ] 46 } 47 }, 48 { 49 "attributes":{ 50 "type":"CartItem" 51 }, 52 "Id":"0a9RM0000004OsfYAE", 53 "Product2Id":"01tRM000000QVW7YAO", 54 "Quantity":5, 55 "SalesPrice":99.50 56 } 57 ] 58 } 59 } 60} - JSON example (specific adjustment amount applied to one item)
-
1{ 2 "effectiveAccountId":"001RM000004ywq7YAA", 3 "salesTransaction":{ 4 "attributes":{ 5 "type":"WebCart" 6 }, 7 "Id":"0a6RM00000009XAYAY", 8 "CurrencyIsoCode":"USD", 9 "WebCartAdjustmentGroups":{ 10 "records":[ 11 { 12 "attributes":{ 13 "type":"WebCartAdjustmentGroup" 14 }, 15 "AdjustmentSource":"Promotion", 16 "AdjustmentType":"AdjustmentPercentage", 17 "AdjustmentValue":-20, 18 "PriceAdjustmentCauseId":"0c8RM0000004CrMYAU", 19 "Priority":2 20 } 21 ] 22 }, 23 "CartItems":{ 24 "records":[ 25 { 26 "attributes":{ 27 "type":"CartItem" 28 }, 29 "Id":"0a9RM0000004OseYAE", 30 "Product2Id":"01tRM000000QVWKYA4", 31 "Quantity":15, 32 "SalesPrice":45.00, 33 "CartItemPriceAdjustments":{ 34 "records":[ 35 { 36 "attributes":{ 37 "type":"CartItemPriceAdjustment" 38 }, 39 "AdjustmentSource":"Promotion", 40 "AdjustmentType":"AdjustmentAmount", 41 "AdjustmentAmountScope":"Unit", 42 "AdjustmentValue":"-10.0", 43 "PriceAdjustmentCauseId":"0c8RM00000000xUYAQ", 44 "Priority":1 45 } 46 ] 47 } 48 }, 49 { 50 "attributes":{ 51 "type":"CartItem" 52 }, 53 "Id":"0a9RM0000004OsfYAE", 54 "Product2Id":"01tRM000000QVW7YAO", 55 "Quantity":5, 56 "SalesPrice":99.50 57 } 58 ] 59 } 60 } 61} - Properties
-
Name Type Description Required or Optional Available Version effectiveAccountId String ID of the account for which the request is made. Required 53.0 salesTransaction Map<String, Object> Map of a cart, its items, and its price adjustments. The fields shown in the example are required. Additional fields are allowed but ignored. Required 53.0
- Response body for POST
- Promotion Execution