1// Set external price for items in the cart
2Map<String, Object> priceArgs = new Map<String, Object>{
3 // Item pricing information for multiple items
4 'itemFieldsInfo' => new Map<String, Object>{
5 // First item
6 '58f1a32b-a0f9-4455-9e53-dcd4dd839bb0' => new Map<String, Object>{. //Asset Reference Id for Item
7 'vlocity_cmt__OneTimeCharge__c' => new Map<String, Object>{
8 'value' => 100,
9 'detail' => 'Priced from AttributePricingProcedure',
10 'source' => 'ABP',
11 'code' => 'OT_STD_PRC'
12 },
13 'vlocity_cmt__RecurringCharge__c' => new Map<String, Object>{
14 'value' => 50,
15 'detail' => 'Priced from AttributePricingProcedure',
16 'source' => 'ABP',
17 'code' => 'REC_MNTH_STD_PRC'
18 }
19 },
20 // Second item
21 '57d29a96-59c0-49b9-b4f8-a61f5d51a7ef' => new Map<String, Object>{
22 'vlocity_cmt__OneTimeCharge__c' => new Map<String, Object>{
23 'value' => 70,
24 'detail' => 'Priced from AttributePricingProcedure',
25 'source' => 'ABP',
26 'code' => 'OT_STD_PRC'
27 },
28 'vlocity_cmt__RecurringCharge__c' => new Map<String, Object>{
29 'value' => 80,
30 'detail' => 'Priced from AttributePricingProcedure',
31 'source' => 'ABP',
32 'code' => 'REC_MNTH_STD_PRC'
33 }
34 }
35 },
36 // Time plan policies for the items
37 'timePlanPolicyList' => new List<Map<String, Object>>{
38 new Map<String, Object>{
39 'ID' => '57d29a96-59c0-49b9-b4f8-a61f5d51a7ef',
40 'TimePolicyName' => 'Purchase Date To End Of Plan Duration',
41 'TimePlanName' => '12 Months Time Plan'
42 },
43 new Map<String, Object>{
44 'ID' => '58f1a32b-a0f9-4455-9e53-dcd4dd839bb0',
45 'TimePolicyName' => 'Purchase Date To End Of Plan Duration',
46 'TimePlanName' => '6 Months Time Plan'
47 }
48 }
49};
50
51// Call setExternalPrice
52Map<String, Object> output = cart.call('setExternalPrice', priceArgs);