The CreatorCon Call for Content is officially open! Get started here.

REST API for Order Guide submission

Krishna137
Tera Contributor

Hi,

 

We have an order guide defined in our SNOW instance. Based on the options selected on the first page, 2 catalog items will be associated to the order guide under Rule base. 

Please let me know the REST APIs to be used to submit a request under the order guide from a third party tool.

 

Thanks,

Krishna

7 REPLIES 7

can you please let me know the request body sample to submit the order guide request- how to pass the sys_id of catalog item, variables in the item ....

Also can you please let me know the request body sample to submit the order guide request- how to pass the sys_id of catalog item, variables in the item ....

Mike Moody
Kilo Guru

For anyone still looking for a solution to this. Here is how I was able to achieve a scripted submission of an Order Guide request. I had to dissect the Order Guide Service Portal widget to figure this out because documentation is not clear. I hope this helps someone:

var guideJS = new sn_sc.OrderGuide("43dde2c2879ef5d05bfeb917cebb35ae");
var map = {};
map.sysparm_id = '43dde2c2879ef5d05bfeb917cebb35ae'; // sys_id of the Order Guide record
map.variables = {};
map.variables.laptop_type = "8393d706879e39d05bfeb917cebb3528"; // sys_id of reference value - Dell Precision 16" Developer Config
// Map additional variables
var includedItems = guideJS.init(map);
gs.debug("Order Guide includedItems: " + JSON.stringify(includedItems));

guideJS.navigateFromMap(includedItems); // Navigates to the catalog items of an Order Guide
var cartJS = new sn_sc.CartJS('43dde2c2879ef5d05bfeb917cebb35ae'); // Get the Cart targeting the same Order Guide sys_id 
//cartJS.setRequestedFor(localInput.requested_for.id);
cartJS.activateGuide();
//cartJS.setParentParams(localInput.workspaceParams);
//cartJS.setEngagementChannel(data.engagement_channel);
//cartJS.setReferrer(data.referrer);
var result = cartJS.checkoutGuide();
gs.debug(JSON.stringify(result));