1// validate and price 2input.put('validate', false);3input.put('price', false);
Basket API: Delete From Basket for Anonymous or Logged in Users:
1String methodName;23Map<String, Object> input = new Map<String, Object>();4Map<String, Object> output = new Map<String, Object>();5Map<String, Object> options = new Map<String, Object>();67// Setting remote parameters8methodName = 'deleteFromBasket';9input.put('apiName','basketOperations');10input.put('methodName','deleteFromBasket');11input.put('catalogCode', 'ECOMM-CAT1');12input.put('requestURL', '/v3/catalogs/ECOMM-CAT1/basket');13input.put('cartContextKey', 'cartContextKey');1415//Use the cart context16keyinput.put('bundleContextKey', 'bundleContextKey');1718//Use the key of the bundle under which the line to be deleted19input.put('lineItemKey', 'lineItemKey');2021//Use the key of the line to be deleted22input.put('context','{"accountId":"accountId1", "contractId":"contractId1"}');23input.put('isloggedin','true');2425//remote action invocation26vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler();27appHandler.invokeMethod(methodName, input, output, options);
Additional parameters:
1// validate and price 2input.put('validate', false);3input.put('price', false);
Basket API: Update Basket for Anonymous or Logged In Users:
1String methodName;23Map<String, Object> input = new Map<String, Object>();4Map<String, Object> output = new Map<String, Object>();5Map<String, Object> options = new Map<String, Object>();67// Setting remote parameters8methodName = 'updateBasket';input.put('apiName','basketOperations');9input.put('methodName','updateBasket');10input.put('catalogCode', 'ECOMM-CAT1');11input.put('requestURL', '/v3/catalogs/ECOMM-CAT1/basket');12input.put('cartContextKey', 'cartContextKey');1314//Use the cart context keyinput.put('bundleContextKey', 'bundleContextKey');1516//Use the key of the bundle under which the line to be deleted17input.put('lineItemKey', 'lineItemKey');1819//Use the key of the line to be updatedinput.put('Quantity', 5);2021//Quantity to be updated22input.put('context','{"accountId":"accountId1", "contractId":"contractId1"}');23input.put('isloggedin','true');2425//remote action invocation26vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler();27appHandler.invokeMethod(methodName, input, output, options);
Additional parameters:
1// validate and price2input.put('validate', false);3input.put('price', false);45// to update attribute 6input.put('attributeCategories', 'attributecategorystring'); //attribute category to be updated
Basket API : Add Multiple Items to a Basket:
1String methodName;2Map<String, Object> input = new Map<String, Object>();3Map<String, Object> output = new Map<String, Object>();4Map<String, Object> options = new Map<String, Object>();56methodName = 'addWithNoConfig';7input.put('apiName','basketOperations');8input.put('catalogCode', 'ECOMM-CAT1');9input.put('productConfig', [list of product configs]); //this is the list of product configs or single product config to add10input.put('offer', [list of offers to add]); //list of offer codes to add or single offer code to add11input.put('methodName', 'addAfterConfig');12input.put('requestURL', '/v3/catalogs/ECOMM-CAT1/basket');1314//remote action invocation15vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler();16appHandler.invokeMethod(methodName, input, output, options);
Create Cart for Logged In Users:
1String methodName;23Map<String, Object> input = new Map<String, Object>();4Map<String, Object> output = new Map<String, Object>();5Map<String, Object> options = new Map<String, Object>();67// Setting remote parameters8methodName = 'createEcomCart';9input.put('apiName','createEcomCart');10input.put('methodName','createEcomCart');11input.put('catalogCode', 'ECOMM-CAT1');12input.put('requestURL', '/v3/carts');13input.put('cartContextKey', 'cartContextKey');//Use the cart context key14input.put('context','{"accountId":"accountId1", "contractId":"contractId1"}');15input.put('isloggedin','true');1617//remote action invocation18vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler();19appHandler.invokeMethod(methodName, input, output, options);