Cart API script in transform map script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2024 08:48 AM
Hello community,
How can we use cart API script in transform map to create RITM variables for a catalog item.
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2024 06:04 PM
below is sample script. you can trigger this from any server side script.
var cart = new sn_sc.CartJS();
var request =
{
'sysparm_id': '0d08837237153000158bbfc8bcbe5d02',
'sysparm_quantity': '1',
'variables':{
'carrier': 'at_and_t_mobility',
'data_plan': '500MB',
'duration': 'eighteen_months',
'color': 'slate',
'storage': 'sixtyfour'
}
}
var cartDetails = cart.orderNow(request);
gs.info(cartDetails);
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2024 09:29 PM
Hello @Gangadhar Ravi ,
Thanks for this sample script
I tried implementing the same through transform map script and it's not working. Could you please help what extra modification needs to be done?
Thanks!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2024 07:21 AM
Can you please post your script.