Delete Cart (After)

This action occurs after the cart is deleted. Changes made to the cart or cart items in this action do not persist in Kibo eCommerce.

Action TypeEmbedded
Full Action IDembedded.commerce.carts.deleteCart.after
Runs multiple custom functions?No

JavaScript File Structure

Action files share the following basic structure:

module.exports = function(context, callback) {
    // Your custom code here
    callback();
};

When you code the custom function for an action, you have access to two arguments:

callback—This argument follows the established JavaScript callback pattern: it takes an error as the first argument (or null if there is no error) and a result as the second argument (if required).

context—This argument provides the function access to relevant objects and methods that interface with Kibo eCommerce.

Context: Cart

The following methods and objects are available to this action through the use of the context argument.

Microservice Operation
This action corresponds to the microservice that deletes a cart.

Get Methods

Exec Methods

Context Objects Available to All Actions

Get

get.cart

Obtains a response that includes information about the current cart.

ParametersTypeDescription
N/AN/AN/A

Example:

context.get.cart();

Response:

{
   "auditInfo": {
      "createBy": "string",
      "createDate": "DateTime",
      "updateBy": "string",
      "updateDate": "DateTime"
   },
   "changeMessages": [
      {
         "amount": "decimal",
         "appId": "string",
         "appKey": "string",
         "appName": "string",
         "correlationId": "string",
         "createDate": "DateTime",
         "id": "string",
         "identifier": "string",
         "message": "string",
         "metadata": "object",
         "newValue": "string",
         "oldValue": "string",
         "subject": "string",
         "subjectType": "string",
         "success": "bool",
         "userFirstName": "string",
         "userId": "string",
         "userLastName": "string",
         "userScopeType": "string",
         "verb": "string"
      }
   ],
   "channelCode": "string",
   "couponCodes": "string",
   "currencyCode": "string",
   "customerInteractionType": "string",
   "data": "string",
   "discountedSubtotal": "decimal",
   "discountedTotal": "decimal",
   "discountTotal": "decimal",
   "expirationDate": "DateTime",
   "extendedProperties": [
      {
         "key": "string",
         "value": "string"
      }
   ],
   "feeTotal": "decimal",
   "fulfillmentInfo": {
      "auditInfo": {
         "createBy": "string",
         "createDate": "DateTime",
         "updateBy": "string",
         "updateDate": "DateTime"
      },
      "data": "string",
      "fulfillmentContact": {
         "address": {
            "address1": "string",
            "address2": "string",
            "address3": "string",
            "address4": "string",
            "addressType": "string",
            "cityOrTown": "string",
            "countryCode": "string",
            "isValidated": "bool",
            "postalOrZipCode": "string",
            "stateOrProvince": "string"
         },
         "companyOrOrganization": "string",
         "email": "string",
         "firstName": "string",
         "id": "int",
         "lastNameOrSurname": "string",
         "middleNameOrInitial": "string",
         "phoneNumbers": {
            "home": "string",
            "mobile": "string",
            "work": "string"
         }
      },
      "isDestinationCommercial": "bool",
      "shippingMethodCode": "string",
      "shippingMethodName": "string"
   },
   "handlingTaxTotal": "decimal",
   "id": "string",
   "invalidCoupons": [
      {
         "couponCode": "string",
         "createDate": "DateTime",
         "discountId": "int",
         "reason": "string",
         "reasonCode": "int"
      }
   ],
   "items": [
      {
         "auditInfo": {
            "createBy": "string",
            "createDate": "DateTime",
            "updateBy": "string",
            "updateDate": "DateTime"
         },
         "data": "string",
         "discountedTotal": "decimal",
         "discountTotal": "decimal",
         "extendedTotal": "decimal",
         "feeTotal": "decimal",
         "fulfillmentLocationCode": "string",
         "fulfillmentMethod": "string",
         "handlingAmount": "decimal",
         "id": "string",
         "isRecurring": "bool",
         "isTaxable": "bool",
         "itemTaxTotal": "decimal",
         "lineId": "int",
         "localeCode": "string",
         "product": {
            "allocationExpiration": "DateTime",
            "allocationId": "int",
            "bundledProducts": [
               {
                  "allocationExpiration": "DateTime",
                  "allocationId": "int",
                  "creditValue": "decimal",
                  "description": "string",
                  "fulfillmentStatus": "string",
                  "goodsType": "string",
                  "isPackagedStandAlone": "bool",
                  "measurements": {
                     "height": {
                        "unit": "string",
                        "value": "decimal"
                     },
                     "length": {
                        "unit": "string",
                        "value": "decimal"
                     },
                     "weight": {
                        "unit": "string",
                        "value": "decimal"
                     },
                     "width": {
                        "unit": "string",
                        "value": "decimal"
                     }
                  },
                  "name": "string",
                  "optionAttributeFQN": "string",
                  "optionValue": "object",
                  "productCode": "string",
                  "productReservationId": "int",
                  "quantity": "int"
               }
            ],
            "categories": [
               {
                  "id": "int",
                  "parent": "self"
               }
            ],
            "description": "string",
            "discountsRestricted": "bool",
            "discountsRestrictedEndDate": "DateTime",
            "discountsRestrictedStartDate": "DateTime",
            "fulfillmentStatus": "string",
            "fulfillmentTypesSupported": "string",
            "goodsType": "string",
            "imageAlternateText": "string",
            "imageUrl": "string",
            "isPackagedStandAlone": "bool",
            "isRecurring": "bool",
            "isTaxable": "bool",
            "measurements": {
               "height": {
                  "unit": "string",
                  "value": "decimal"
               },
               "length": {
                  "unit": "string",
                  "value": "decimal"
               },
               "weight": {
                  "unit": "string",
                  "value": "decimal"
               },
               "width": {
                  "unit": "string",
                  "value": "decimal"
               }
            },
            "mfgPartNumber": "string",
            "name": "string",
            "options": [
               {
                  "attributeFQN": "string",
                  "dataType": "string",
                  "name": "string",
                  "shopperEnteredValue": "object",
                  "stringValue": "string",
                  "value": "object"
               }
            ],
            "price": {
               "creditValue": "decimal",
               "msrp": "decimal",
               "price": "decimal",
               "salePrice": "decimal",
               "tenantOverridePrice": "decimal"
            },
            "productCode": "string",
            "productReservationId": "int",
            "productType": "string",
            "productUsage": "string",
            "properties": [
               {
                  "attributeFQN": "string",
                  "dataType": "string",
                  "isMultiValue": "bool",
                  "name": "string",
                  "values": [
                     {
                        "stringValue": "string",
                        "value": "object"
                     }
                  ]
               }
            ],
            "upc": "string",
            "variationProductCode": "string"
         },
         "productDiscount": {
            "appliesToSalePrice": "bool",
            "couponCode": "string",
            "discount": {
               "expirationDate": "DateTime",
               "id": "int",
               "itemIds": "string",
               "name": "string"
            },
            "discountQuantity": "int",
            "excluded": "bool",
            "impact": "decimal",
            "impactPerUnit": "decimal",
            "productQuantity": "int"
         },
         "productDiscounts": [
            {
               "appliesToSalePrice": "bool",
               "couponCode": "string",
               "discount": {
                  "expirationDate": "DateTime",
                  "id": "int",
                  "itemIds": "string",
                  "name": "string"
               },
               "discountQuantity": "int",
               "excluded": "bool",
               "impact": "decimal",
               "impactPerUnit": "decimal",
               "productQuantity": "int"
            }
         ],
         "quantity": "int",
         "shippingDiscounts": [
            {
               "discount": {
                  "couponCode": "string",
                  "discount": {
                     "expirationDate": "DateTime",
                     "id": "int",
                     "itemIds": "string",
                     "name": "string"
                  },
                  "excluded": "bool",
                  "impact": "decimal"
               },
               "discountQuantity": "int",
               "impactPerUnit": "decimal",
               "methodCode": "string"
            }
         ],
         "shippingTaxTotal": "decimal",
         "shippingTotal": "decimal",
         "subtotal": "decimal",
         "taxableTotal": "decimal",
         "total": "decimal",
         "unitPrice": {
            "extendedAmount": "decimal",
            "listAmount": "decimal",
            "overrideAmount": "decimal",
            "saleAmount": "decimal"
         }
      }
   ],
   "itemTaxTotal": "decimal",
   "lastValidationDate": "DateTime",
   "orderDiscounts": [
      {
         "couponCode": "string",
         "discount": {
            "expirationDate": "DateTime",
            "id": "int",
            "itemIds": "string",
            "name": "string"
         },
         "excluded": "bool",
         "impact": "decimal"
      }
   ],
   "shippingSubTotal": "decimal",
   "shippingTaxTotal": "decimal",
   "shippingTotal": "decimal",
   "siteId": "int",
   "subtotal": "decimal",
   "taxTotal": "decimal",
   "tenantId": "int",
   "total": "decimal",
   "userId": "string",
   "visitId": "string",
   "webSessionId": "string"
}

For information about the properties in the response, refer to the REST API Help.

Exec

exec.setData

Sets custom key/value data on the current cart.

ParametersTypeDescription
keystringKey of the data to set on the cart.
valueobjectValue of the data to set.

Example:

context.exec.setData("customField", value);

Response:

{
   "auditInfo": {
      "createBy": "string",
      "createDate": "DateTime",
      "updateBy": "string",
      "updateDate": "DateTime"
   },
   "changeMessages": [
      {
         "amount": "decimal",
         "appId": "string",
         "appKey": "string",
         "appName": "string",
         "correlationId": "string",
         "createDate": "DateTime",
         "id": "string",
         "identifier": "string",
         "message": "string",
         "metadata": "object",
         "newValue": "string",
         "oldValue": "string",
         "subject": "string",
         "subjectType": "string",
         "success": "bool",
         "userFirstName": "string",
         "userId": "string",
         "userLastName": "string",
         "userScopeType": "string",
         "verb": "string"
      }
   ],
   "channelCode": "string",
   "couponCodes": "string",
   "currencyCode": "string",
   "customerInteractionType": "string",
   "data": "string",
   "discountedSubtotal": "decimal",
   "discountedTotal": "decimal",
   "discountTotal": "decimal",
   "expirationDate": "DateTime",
   "extendedProperties": [
      {
         "key": "string",
         "value": "string"
      }
   ],
   "feeTotal": "decimal",
   "fulfillmentInfo": {
      "auditInfo": {
         "createBy": "string",
         "createDate": "DateTime",
         "updateBy": "string",
         "updateDate": "DateTime"
      },
      "data": "string",
      "fulfillmentContact": {
         "address": {
            "address1": "string",
            "address2": "string",
            "address3": "string",
            "address4": "string",
            "addressType": "string",
            "cityOrTown": "string",
            "countryCode": "string",
            "isValidated": "bool",
            "postalOrZipCode": "string",
            "stateOrProvince": "string"
         },
         "companyOrOrganization": "string",
         "email": "string",
         "firstName": "string",
         "id": "int",
         "lastNameOrSurname": "string",
         "middleNameOrInitial": "string",
         "phoneNumbers": {
            "home": "string",
            "mobile": "string",
            "work": "string"
         }
      },
      "isDestinationCommercial": "bool",
      "shippingMethodCode": "string",
      "shippingMethodName": "string"
   },
   "handlingTaxTotal": "decimal",
   "id": "string",
   "invalidCoupons": [
      {
         "couponCode": "string",
         "createDate": "DateTime",
         "discountId": "int",
         "reason": "string",
         "reasonCode": "int"
      }
   ],
   "items": [
      {
         "auditInfo": {
            "createBy": "string",
            "createDate": "DateTime",
            "updateBy": "string",
            "updateDate": "DateTime"
         },
         "data": "string",
         "discountedTotal": "decimal",
         "discountTotal": "decimal",
         "extendedTotal": "decimal",
         "feeTotal": "decimal",
         "fulfillmentLocationCode": "string",
         "fulfillmentMethod": "string",
         "handlingAmount": "decimal",
         "id": "string",
         "isRecurring": "bool",
         "isTaxable": "bool",
         "itemTaxTotal": "decimal",
         "lineId": "int",
         "localeCode": "string",
         "product": {
            "allocationExpiration": "DateTime",
            "allocationId": "int",
            "bundledProducts": [
               {
                  "allocationExpiration": "DateTime",
                  "allocationId": "int",
                  "creditValue": "decimal",
                  "description": "string",
                  "fulfillmentStatus": "string",
                  "goodsType": "string",
                  "isPackagedStandAlone": "bool",
                  "measurements": {
                     "height": {
                        "unit": "string",
                        "value": "decimal"
                     },
                     "length": {
                        "unit": "string",
                        "value": "decimal"
                     },
                     "weight": {
                        "unit": "string",
                        "value": "decimal"
                     },
                     "width": {
                        "unit": "string",
                        "value": "decimal"
                     }
                  },
                  "name": "string",
                  "optionAttributeFQN": "string",
                  "optionValue": "object",
                  "productCode": "string",
                  "productReservationId": "int",
                  "quantity": "int"
               }
            ],
            "categories": [
               {
                  "id": "int",
                  "parent": "self"
               }
            ],
            "description": "string",
            "discountsRestricted": "bool",
            "discountsRestrictedEndDate": "DateTime",
            "discountsRestrictedStartDate": "DateTime",
            "fulfillmentStatus": "string",
            "fulfillmentTypesSupported": "string",
            "goodsType": "string",
            "imageAlternateText": "string",
            "imageUrl": "string",
            "isPackagedStandAlone": "bool",
            "isRecurring": "bool",
            "isTaxable": "bool",
            "measurements": {
               "height": {
                  "unit": "string",
                  "value": "decimal"
               },
               "length": {
                  "unit": "string",
                  "value": "decimal"
               },
               "weight": {
                  "unit": "string",
                  "value": "decimal"
               },
               "width": {
                  "unit": "string",
                  "value": "decimal"
               }
            },
            "mfgPartNumber": "string",
            "name": "string",
            "options": [
               {
                  "attributeFQN": "string",
                  "dataType": "string",
                  "name": "string",
                  "shopperEnteredValue": "object",
                  "stringValue": "string",
                  "value": "object"
               }
            ],
            "price": {
               "creditValue": "decimal",
               "msrp": "decimal",
               "price": "decimal",
               "salePrice": "decimal",
               "tenantOverridePrice": "decimal"
            },
            "productCode": "string",
            "productReservationId": "int",
            "productType": "string",
            "productUsage": "string",
            "properties": [
               {
                  "attributeFQN": "string",
                  "dataType": "string",
                  "isMultiValue": "bool",
                  "name": "string",
                  "values": [
                     {
                        "stringValue": "string",
                        "value": "object"
                     }
                  ]
               }
            ],
            "upc": "string",
            "variationProductCode": "string"
         },
         "productDiscount": {
            "appliesToSalePrice": "bool",
            "couponCode": "string",
            "discount": {
               "expirationDate": "DateTime",
               "id": "int",
               "itemIds": "string",
               "name": "string"
            },
            "discountQuantity": "int",
            "excluded": "bool",
            "impact": "decimal",
            "impactPerUnit": "decimal",
            "productQuantity": "int"
         },
         "productDiscounts": [
            {
               "appliesToSalePrice": "bool",
               "couponCode": "string",
               "discount": {
                  "expirationDate": "DateTime",
                  "id": "int",
                  "itemIds": "string",
                  "name": "string"
               },
               "discountQuantity": "int",
               "excluded": "bool",
               "impact": "decimal",
               "impactPerUnit": "decimal",
               "productQuantity": "int"
            }
         ],
         "quantity": "int",
         "shippingDiscounts": [
            {
               "discount": {
                  "couponCode": "string",
                  "discount": {
                     "expirationDate": "DateTime",
                     "id": "int",
                     "itemIds": "string",
                     "name": "string"
                  },
                  "excluded": "bool",
                  "impact": "decimal"
               },
               "discountQuantity": "int",
               "impactPerUnit": "decimal",
               "methodCode": "string"
            }
         ],
         "shippingTaxTotal": "decimal",
         "shippingTotal": "decimal",
         "subtotal": "decimal",
         "taxableTotal": "decimal",
         "total": "decimal",
         "unitPrice": {
            "extendedAmount": "decimal",
            "listAmount": "decimal",
            "overrideAmount": "decimal",
            "saleAmount": "decimal"
         }
      }
   ],
   "itemTaxTotal": "decimal",
   "lastValidationDate": "DateTime",
   "orderDiscounts": [
      {
         "couponCode": "string",
         "discount": {
            "expirationDate": "DateTime",
            "id": "int",
            "itemIds": "string",
            "name": "string"
         },
         "excluded": "bool",
         "impact": "decimal"
      }
   ],
   "shippingSubTotal": "decimal",
   "shippingTaxTotal": "decimal",
   "shippingTotal": "decimal",
   "siteId": "int",
   "subtotal": "decimal",
   "taxTotal": "decimal",
   "tenantId": "int",
   "total": "decimal",
   "userId": "string",
   "visitId": "string",
   "webSessionId": "string"
}

For information about the properties in the response, refer to the REST API Help.

exec.removeData

Removes custom key/value data from the specified cart.

ParametersTypeDescription
keystringKey of the data to remove from the cart.

Example:

context.exec.removeData("customField");

Response:

{
   "auditInfo": {
      "createBy": "string",
      "createDate": "DateTime",
      "updateBy": "string",
      "updateDate": "DateTime"
   },
   "changeMessages": [
      {
         "amount": "decimal",
         "appId": "string",
         "appKey": "string",
         "appName": "string",
         "correlationId": "string",
         "createDate": "DateTime",
         "id": "string",
         "identifier": "string",
         "message": "string",
         "metadata": "object",
         "newValue": "string",
         "oldValue": "string",
         "subject": "string",
         "subjectType": "string",
         "success": "bool",
         "userFirstName": "string",
         "userId": "string",
         "userLastName": "string",
         "userScopeType": "string",
         "verb": "string"
      }
   ],
   "channelCode": "string",
   "couponCodes": "string",
   "currencyCode": "string",
   "customerInteractionType": "string",
   "data": "string",
   "discountedSubtotal": "decimal",
   "discountedTotal": "decimal",
   "discountTotal": "decimal",
   "expirationDate": "DateTime",
   "extendedProperties": [
      {
         "key": "string",
         "value": "string"
      }
   ],
   "feeTotal": "decimal",
   "fulfillmentInfo": {
      "auditInfo": {
         "createBy": "string",
         "createDate": "DateTime",
         "updateBy": "string",
         "updateDate": "DateTime"
      },
      "data": "string",
      "fulfillmentContact": {
         "address": {
            "address1": "string",
            "address2": "string",
            "address3": "string",
            "address4": "string",
            "addressType": "string",
            "cityOrTown": "string",
            "countryCode": "string",
            "isValidated": "bool",
            "postalOrZipCode": "string",
            "stateOrProvince": "string"
         },
         "companyOrOrganization": "string",
         "email": "string",
         "firstName": "string",
         "id": "int",
         "lastNameOrSurname": "string",
         "middleNameOrInitial": "string",
         "phoneNumbers": {
            "home": "string",
            "mobile": "string",
            "work": "string"
         }
      },
      "isDestinationCommercial": "bool",
      "shippingMethodCode": "string",
      "shippingMethodName": "string"
   },
   "handlingTaxTotal": "decimal",
   "id": "string",
   "invalidCoupons": [
      {
         "couponCode": "string",
         "createDate": "DateTime",
         "discountId": "int",
         "reason": "string",
         "reasonCode": "int"
      }
   ],
   "items": [
      {
         "auditInfo": {
            "createBy": "string",
            "createDate": "DateTime",
            "updateBy": "string",
            "updateDate": "DateTime"
         },
         "data": "string",
         "discountedTotal": "decimal",
         "discountTotal": "decimal",
         "extendedTotal": "decimal",
         "feeTotal": "decimal",
         "fulfillmentLocationCode": "string",
         "fulfillmentMethod": "string",
         "handlingAmount": "decimal",
         "id": "string",
         "isRecurring": "bool",
         "isTaxable": "bool",
         "itemTaxTotal": "decimal",
         "lineId": "int",
         "localeCode": "string",
         "product": {
            "allocationExpiration": "DateTime",
            "allocationId": "int",
            "bundledProducts": [
               {
                  "allocationExpiration": "DateTime",
                  "allocationId": "int",
                  "creditValue": "decimal",
                  "description": "string",
                  "fulfillmentStatus": "string",
                  "goodsType": "string",
                  "isPackagedStandAlone": "bool",
                  "measurements": {
                     "height": {
                        "unit": "string",
                        "value": "decimal"
                     },
                     "length": {
                        "unit": "string",
                        "value": "decimal"
                     },
                     "weight": {
                        "unit": "string",
                        "value": "decimal"
                     },
                     "width": {
                        "unit": "string",
                        "value": "decimal"
                     }
                  },
                  "name": "string",
                  "optionAttributeFQN": "string",
                  "optionValue": "object",
                  "productCode": "string",
                  "productReservationId": "int",
                  "quantity": "int"
               }
            ],
            "categories": [
               {
                  "id": "int",
                  "parent": "self"
               }
            ],
            "description": "string",
            "discountsRestricted": "bool",
            "discountsRestrictedEndDate": "DateTime",
            "discountsRestrictedStartDate": "DateTime",
            "fulfillmentStatus": "string",
            "fulfillmentTypesSupported": "string",
            "goodsType": "string",
            "imageAlternateText": "string",
            "imageUrl": "string",
            "isPackagedStandAlone": "bool",
            "isRecurring": "bool",
            "isTaxable": "bool",
            "measurements": {
               "height": {
                  "unit": "string",
                  "value": "decimal"
               },
               "length": {
                  "unit": "string",
                  "value": "decimal"
               },
               "weight": {
                  "unit": "string",
                  "value": "decimal"
               },
               "width": {
                  "unit": "string",
                  "value": "decimal"
               }
            },
            "mfgPartNumber": "string",
            "name": "string",
            "options": [
               {
                  "attributeFQN": "string",
                  "dataType": "string",
                  "name": "string",
                  "shopperEnteredValue": "object",
                  "stringValue": "string",
                  "value": "object"
               }
            ],
            "price": {
               "creditValue": "decimal",
               "msrp": "decimal",
               "price": "decimal",
               "salePrice": "decimal",
               "tenantOverridePrice": "decimal"
            },
            "productCode": "string",
            "productReservationId": "int",
            "productType": "string",
            "productUsage": "string",
            "properties": [
               {
                  "attributeFQN": "string",
                  "dataType": "string",
                  "isMultiValue": "bool",
                  "name": "string",
                  "values": [
                     {
                        "stringValue": "string",
                        "value": "object"
                     }
                  ]
               }
            ],
            "upc": "string",
            "variationProductCode": "string"
         },
         "productDiscount": {
            "appliesToSalePrice": "bool",
            "couponCode": "string",
            "discount": {
               "expirationDate": "DateTime",
               "id": "int",
               "itemIds": "string",
               "name": "string"
            },
            "discountQuantity": "int",
            "excluded": "bool",
            "impact": "decimal",
            "impactPerUnit": "decimal",
            "productQuantity": "int"
         },
         "productDiscounts": [
            {
               "appliesToSalePrice": "bool",
               "couponCode": "string",
               "discount": {
                  "expirationDate": "DateTime",
                  "id": "int",
                  "itemIds": "string",
                  "name": "string"
               },
               "discountQuantity": "int",
               "excluded": "bool",
               "impact": "decimal",
               "impactPerUnit": "decimal",
               "productQuantity": "int"
            }
         ],
         "quantity": "int",
         "shippingDiscounts": [
            {
               "discount": {
                  "couponCode": "string",
                  "discount": {
                     "expirationDate": "DateTime",
                     "id": "int",
                     "itemIds": "string",
                     "name": "string"
                  },
                  "excluded": "bool",
                  "impact": "decimal"
               },
               "discountQuantity": "int",
               "impactPerUnit": "decimal",
               "methodCode": "string"
            }
         ],
         "shippingTaxTotal": "decimal",
         "shippingTotal": "decimal",
         "subtotal": "decimal",
         "taxableTotal": "decimal",
         "total": "decimal",
         "unitPrice": {
            "extendedAmount": "decimal",
            "listAmount": "decimal",
            "overrideAmount": "decimal",
            "saleAmount": "decimal"
         }
      }
   ],
   "itemTaxTotal": "decimal",
   "lastValidationDate": "DateTime",
   "orderDiscounts": [
      {
         "couponCode": "string",
         "discount": {
            "expirationDate": "DateTime",
            "id": "int",
            "itemIds": "string",
            "name": "string"
         },
         "excluded": "bool",
         "impact": "decimal"
      }
   ],
   "shippingSubTotal": "decimal",
   "shippingTaxTotal": "decimal",
   "shippingTotal": "decimal",
   "siteId": "int",
   "subtotal": "decimal",
   "taxTotal": "decimal",
   "tenantId": "int",
   "total": "decimal",
   "userId": "string",
   "visitId": "string",
   "webSessionId": "string"
}

For information about the properties in the response, refer to the REST API Help.

exec.setItemData

Sets custom key/value data on a cart item.

ParametersTypeDescription
keystringKey of the data to set on the cart item.
valueobjectValue of the data to set.
itemIdstringId of the cart item to which the data is applied.

Example:

context.exec.setItemData("customField", value, "123");

Response:

{
   "auditInfo": {
      "createBy": "string",
      "createDate": "DateTime",
      "updateBy": "string",
      "updateDate": "DateTime"
   },
   "data": "string",
   "discountedTotal": "decimal",
   "discountTotal": "decimal",
   "extendedTotal": "decimal",
   "feeTotal": "decimal",
   "fulfillmentLocationCode": "string",
   "fulfillmentMethod": "string",
   "handlingAmount": "decimal",
   "id": "string",
   "isRecurring": "bool",
   "isTaxable": "bool",
   "itemTaxTotal": "decimal",
   "lineId": "int",
   "localeCode": "string",
   "product": {
      "allocationExpiration": "DateTime",
      "allocationId": "int",
      "bundledProducts": [
         {
            "allocationExpiration": "DateTime",
            "allocationId": "int",
            "creditValue": "decimal",
            "description": "string",
            "fulfillmentStatus": "string",
            "goodsType": "string",
            "isPackagedStandAlone": "bool",
            "measurements": {
               "height": {
                  "unit": "string",
                  "value": "decimal"
               },
               "length": {
                  "unit": "string",
                  "value": "decimal"
               },
               "weight": {
                  "unit": "string",
                  "value": "decimal"
               },
               "width": {
                  "unit": "string",
                  "value": "decimal"
               }
            },
            "name": "string",
            "optionAttributeFQN": "string",
            "optionValue": "object",
            "productCode": "string",
            "productReservationId": "int",
            "quantity": "int"
         }
      ],
      "categories": [
         {
            "id": "int",
            "parent": "self"
         }
      ],
      "description": "string",
      "discountsRestricted": "bool",
      "discountsRestrictedEndDate": "DateTime",
      "discountsRestrictedStartDate": "DateTime",
      "fulfillmentStatus": "string",
      "fulfillmentTypesSupported": "string",
      "goodsType": "string",
      "imageAlternateText": "string",
      "imageUrl": "string",
      "isPackagedStandAlone": "bool",
      "isRecurring": "bool",
      "isTaxable": "bool",
      "measurements": {
         "height": {
            "unit": "string",
            "value": "decimal"
         },
         "length": {
            "unit": "string",
            "value": "decimal"
         },
         "weight": {
            "unit": "string",
            "value": "decimal"
         },
         "width": {
            "unit": "string",
            "value": "decimal"
         }
      },
      "mfgPartNumber": "string",
      "name": "string",
      "options": [
         {
            "attributeFQN": "string",
            "dataType": "string",
            "name": "string",
            "shopperEnteredValue": "object",
            "stringValue": "string",
            "value": "object"
         }
      ],
      "price": {
         "creditValue": "decimal",
         "msrp": "decimal",
         "price": "decimal",
         "salePrice": "decimal",
         "tenantOverridePrice": "decimal"
      },
      "productCode": "string",
      "productReservationId": "int",
      "productType": "string",
      "productUsage": "string",
      "properties": [
         {
            "attributeFQN": "string",
            "dataType": "string",
            "isMultiValue": "bool",
            "name": "string",
            "values": [
               {
                  "stringValue": "string",
                  "value": "object"
               }
            ]
         }
      ],
      "upc": "string",
      "variationProductCode": "string"
   },
   "productDiscount": {
      "appliesToSalePrice": "bool",
      "couponCode": "string",
      "discount": {
         "expirationDate": "DateTime",
         "id": "int",
         "itemIds": "string",
         "name": "string"
      },
      "discountQuantity": "int",
      "excluded": "bool",
      "impact": "decimal",
      "impactPerUnit": "decimal",
      "productQuantity": "int"
   },
   "productDiscounts": [
      {
         "appliesToSalePrice": "bool",
         "couponCode": "string",
         "discount": {
            "expirationDate": "DateTime",
            "id": "int",
            "itemIds": "string",
            "name": "string"
         },
         "discountQuantity": "int",
         "excluded": "bool",
         "impact": "decimal",
         "impactPerUnit": "decimal",
         "productQuantity": "int"
      }
   ],
   "quantity": "int",
   "shippingDiscounts": [
      {
         "discount": {
            "couponCode": "string",
            "discount": {
               "expirationDate": "DateTime",
               "id": "int",
               "itemIds": "string",
               "name": "string"
            },
            "excluded": "bool",
            "impact": "decimal"
         },
         "discountQuantity": "int",
         "impactPerUnit": "decimal",
         "methodCode": "string"
      }
   ],
   "shippingTaxTotal": "decimal",
   "shippingTotal": "decimal",
   "subtotal": "decimal",
   "taxableTotal": "decimal",
   "total": "decimal",
   "unitPrice": {
      "extendedAmount": "decimal",
      "listAmount": "decimal",
      "overrideAmount": "decimal",
      "saleAmount": "decimal"
   }
}

For information about the properties in the response, refer to the REST API Help.

exec.removeItemData

Removes custom key/value data from a cart item.

ParametersTypeDescription
keystringKey of the data to remove from the cart item.
itemIdstringId of the item from which to remove data if applied to a line item that is not the current line item. Current line item only applies when called from a cart item action.

Example:

context.exec.removeItemData("customField", "123");

Response:

{
   "auditInfo": {
      "createBy": "string",
      "createDate": "DateTime",
      "updateBy": "string",
      "updateDate": "DateTime"
   },
   "data": "string",
   "discountedTotal": "decimal",
   "discountTotal": "decimal",
   "extendedTotal": "decimal",
   "feeTotal": "decimal",
   "fulfillmentLocationCode": "string",
   "fulfillmentMethod": "string",
   "handlingAmount": "decimal",
   "id": "string",
   "isRecurring": "bool",
   "isTaxable": "bool",
   "itemTaxTotal": "decimal",
   "lineId": "int",
   "localeCode": "string",
   "product": {
      "allocationExpiration": "DateTime",
      "allocationId": "int",
      "bundledProducts": [
         {
            "allocationExpiration": "DateTime",
            "allocationId": "int",
            "creditValue": "decimal",
            "description": "string",
            "fulfillmentStatus": "string",
            "goodsType": "string",
            "isPackagedStandAlone": "bool",
            "measurements": {
               "height": {
                  "unit": "string",
                  "value": "decimal"
               },
               "length": {
                  "unit": "string",
                  "value": "decimal"
               },
               "weight": {
                  "unit": "string",
                  "value": "decimal"
               },
               "width": {
                  "unit": "string",
                  "value": "decimal"
               }
            },
            "name": "string",
            "optionAttributeFQN": "string",
            "optionValue": "object",
            "productCode": "string",
            "productReservationId": "int",
            "quantity": "int"
         }
      ],
      "categories": [
         {
            "id": "int",
            "parent": "self"
         }
      ],
      "description": "string",
      "discountsRestricted": "bool",
      "discountsRestrictedEndDate": "DateTime",
      "discountsRestrictedStartDate": "DateTime",
      "fulfillmentStatus": "string",
      "fulfillmentTypesSupported": "string",
      "goodsType": "string",
      "imageAlternateText": "string",
      "imageUrl": "string",
      "isPackagedStandAlone": "bool",
      "isRecurring": "bool",
      "isTaxable": "bool",
      "measurements": {
         "height": {
            "unit": "string",
            "value": "decimal"
         },
         "length": {
            "unit": "string",
            "value": "decimal"
         },
         "weight": {
            "unit": "string",
            "value": "decimal"
         },
         "width": {
            "unit": "string",
            "value": "decimal"
         }
      },
      "mfgPartNumber": "string",
      "name": "string",
      "options": [
         {
            "attributeFQN": "string",
            "dataType": "string",
            "name": "string",
            "shopperEnteredValue": "object",
            "stringValue": "string",
            "value": "object"
         }
      ],
      "price": {
         "creditValue": "decimal",
         "msrp": "decimal",
         "price": "decimal",
         "salePrice": "decimal",
         "tenantOverridePrice": "decimal"
      },
      "productCode": "string",
      "productReservationId": "int",
      "productType": "string",
      "productUsage": "string",
      "properties": [
         {
            "attributeFQN": "string",
            "dataType": "string",
            "isMultiValue": "bool",
            "name": "string",
            "values": [
               {
                  "stringValue": "string",
                  "value": "object"
               }
            ]
         }
      ],
      "upc": "string",
      "variationProductCode": "string"
   },
   "productDiscount": {
      "appliesToSalePrice": "bool",
      "couponCode": "string",
      "discount": {
         "expirationDate": "DateTime",
         "id": "int",
         "itemIds": "string",
         "name": "string"
      },
      "discountQuantity": "int",
      "excluded": "bool",
      "impact": "decimal",
      "impactPerUnit": "decimal",
      "productQuantity": "int"
   },
   "productDiscounts": [
      {
         "appliesToSalePrice": "bool",
         "couponCode": "string",
         "discount": {
            "expirationDate": "DateTime",
            "id": "int",
            "itemIds": "string",
            "name": "string"
         },
         "discountQuantity": "int",
         "excluded": "bool",
         "impact": "decimal",
         "impactPerUnit": "decimal",
         "productQuantity": "int"
      }
   ],
   "quantity": "int",
   "shippingDiscounts": [
      {
         "discount": {
            "couponCode": "string",
            "discount": {
               "expirationDate": "DateTime",
               "id": "int",
               "itemIds": "string",
               "name": "string"
            },
            "excluded": "bool",
            "impact": "decimal"
         },
         "discountQuantity": "int",
         "impactPerUnit": "decimal",
         "methodCode": "string"
      }
   ],
   "shippingTaxTotal": "decimal",
   "shippingTotal": "decimal",
   "subtotal": "decimal",
   "taxableTotal": "decimal",
   "total": "decimal",
   "unitPrice": {
      "extendedAmount": "decimal",
      "listAmount": "decimal",
      "overrideAmount": "decimal",
      "saleAmount": "decimal"
   }
}

For information about the properties in the response, refer to the REST API Help.

exec.setItemAllocation

Sets soft allocation information on a cart item.

ParametersTypeDescription
allocationIdintId of the allocation to set on the cart item.
expirationdate/timeDate/time of the allocation expiration.
productCodestringCode of the product or product variation that is allocated.
itemIdstringId of the item to set the allocation on if applied to a line item that is not the current line item. Current line item only applies when called for a cart item action.

Example:

context.exec.setItemAllocation(5, dateVariable, "LUC-SAMPLE-PROD", "123");

Response:

{
   "auditInfo": {
      "createBy": "string",
      "createDate": "DateTime",
      "updateBy": "string",
      "updateDate": "DateTime"
   },
   "data": "string",
   "discountedTotal": "decimal",
   "discountTotal": "decimal",
   "extendedTotal": "decimal",
   "feeTotal": "decimal",
   "fulfillmentLocationCode": "string",
   "fulfillmentMethod": "string",
   "handlingAmount": "decimal",
   "id": "string",
   "isRecurring": "bool",
   "isTaxable": "bool",
   "itemTaxTotal": "decimal",
   "lineId": "int",
   "localeCode": "string",
   "product": {
      "allocationExpiration": "DateTime",
      "allocationId": "int",
      "bundledProducts": [
         {
            "allocationExpiration": "DateTime",
            "allocationId": "int",
            "creditValue": "decimal",
            "description": "string",
            "fulfillmentStatus": "string",
            "goodsType": "string",
            "isPackagedStandAlone": "bool",
            "measurements": {
               "height": {
                  "unit": "string",
                  "value": "decimal"
               },
               "length": {
                  "unit": "string",
                  "value": "decimal"
               },
               "weight": {
                  "unit": "string",
                  "value": "decimal"
               },
               "width": {
                  "unit": "string",
                  "value": "decimal"
               }
            },
            "name": "string",
            "optionAttributeFQN": "string",
            "optionValue": "object",
            "productCode": "string",
            "productReservationId": "int",
            "quantity": "int"
         }
      ],
      "categories": [
         {
            "id": "int",
            "parent": "self"
         }
      ],
      "description": "string",
      "discountsRestricted": "bool",
      "discountsRestrictedEndDate": "DateTime",
      "discountsRestrictedStartDate": "DateTime",
      "fulfillmentStatus": "string",
      "fulfillmentTypesSupported": "string",
      "goodsType": "string",
      "imageAlternateText": "string",
      "imageUrl": "string",
      "isPackagedStandAlone": "bool",
      "isRecurring": "bool",
      "isTaxable": "bool",
      "measurements": {
         "height": {
            "unit": "string",
            "value": "decimal"
         },
         "length": {
            "unit": "string",
            "value": "decimal"
         },
         "weight": {
            "unit": "string",
            "value": "decimal"
         },
         "width": {
            "unit": "string",
            "value": "decimal"
         }
      },
      "mfgPartNumber": "string",
      "name": "string",
      "options": [
         {
            "attributeFQN": "string",
            "dataType": "string",
            "name": "string",
            "shopperEnteredValue": "object",
            "stringValue": "string",
            "value": "object"
         }
      ],
      "price": {
         "creditValue": "decimal",
         "msrp": "decimal",
         "price": "decimal",
         "salePrice": "decimal",
         "tenantOverridePrice": "decimal"
      },
      "productCode": "string",
      "productReservationId": "int",
      "productType": "string",
      "productUsage": "string",
      "properties": [
         {
            "attributeFQN": "string",
            "dataType": "string",
            "isMultiValue": "bool",
            "name": "string",
            "values": [
               {
                  "stringValue": "string",
                  "value": "object"
               }
            ]
         }
      ],
      "upc": "string",
      "variationProductCode": "string"
   },
   "productDiscount": {
      "appliesToSalePrice": "bool",
      "couponCode": "string",
      "discount": {
         "expirationDate": "DateTime",
         "id": "int",
         "itemIds": "string",
         "name": "string"
      },
      "discountQuantity": "int",
      "excluded": "bool",
      "impact": "decimal",
      "impactPerUnit": "decimal",
      "productQuantity": "int"
   },
   "productDiscounts": [
      {
         "appliesToSalePrice": "bool",
         "couponCode": "string",
         "discount": {
            "expirationDate": "DateTime",
            "id": "int",
            "itemIds": "string",
            "name": "string"
         },
         "discountQuantity": "int",
         "excluded": "bool",
         "impact": "decimal",
         "impactPerUnit": "decimal",
         "productQuantity": "int"
      }
   ],
   "quantity": "int",
   "shippingDiscounts": [
      {
         "discount": {
            "couponCode": "string",
            "discount": {
               "expirationDate": "DateTime",
               "id": "int",
               "itemIds": "string",
               "name": "string"
            },
            "excluded": "bool",
            "impact": "decimal"
         },
         "discountQuantity": "int",
         "impactPerUnit": "decimal",
         "methodCode": "string"
      }
   ],
   "shippingTaxTotal": "decimal",
   "shippingTotal": "decimal",
   "subtotal": "decimal",
   "taxableTotal": "decimal",
   "total": "decimal",
   "unitPrice": {
      "extendedAmount": "decimal",
      "listAmount": "decimal",
      "overrideAmount": "decimal",
      "saleAmount": "decimal"
   }
}

For information about the properties in the response, refer to the REST API Help.

exec.removeItem

Removes an item from the cart.

ParametersTypeDescription
itemIdstringId of the item to remove.

Example:

context.exec.removeItem("123");

Response:

{
   "auditInfo": {
      "createBy": "string",
      "createDate": "DateTime",
      "updateBy": "string",
      "updateDate": "DateTime"
   },
   "changeMessages": [
      {
         "amount": "decimal",
         "appId": "string",
         "appKey": "string",
         "appName": "string",
         "correlationId": "string",
         "createDate": "DateTime",
         "id": "string",
         "identifier": "string",
         "message": "string",
         "metadata": "object",
         "newValue": "string",
         "oldValue": "string",
         "subject": "string",
         "subjectType": "string",
         "success": "bool",
         "userFirstName": "string",
         "userId": "string",
         "userLastName": "string",
         "userScopeType": "string",
         "verb": "string"
      }
   ],
   "channelCode": "string",
   "couponCodes": "string",
   "currencyCode": "string",
   "customerInteractionType": "string",
   "data": "string",
   "discountedSubtotal": "decimal",
   "discountedTotal": "decimal",
   "discountTotal": "decimal",
   "expirationDate": "DateTime",
   "extendedProperties": [
      {
         "key": "string",
         "value": "string"
      }
   ],
   "feeTotal": "decimal",
   "fulfillmentInfo": {
      "auditInfo": {
         "createBy": "string",
         "createDate": "DateTime",
         "updateBy": "string",
         "updateDate": "DateTime"
      },
      "data": "string",
      "fulfillmentContact": {
         "address": {
            "address1": "string",
            "address2": "string",
            "address3": "string",
            "address4": "string",
            "addressType": "string",
            "cityOrTown": "string",
            "countryCode": "string",
            "isValidated": "bool",
            "postalOrZipCode": "string",
            "stateOrProvince": "string"
         },
         "companyOrOrganization": "string",
         "email": "string",
         "firstName": "string",
         "id": "int",
         "lastNameOrSurname": "string",
         "middleNameOrInitial": "string",
         "phoneNumbers": {
            "home": "string",
            "mobile": "string",
            "work": "string"
         }
      },
      "isDestinationCommercial": "bool",
      "shippingMethodCode": "string",
      "shippingMethodName": "string"
   },
   "handlingTaxTotal": "decimal",
   "id": "string",
   "invalidCoupons": [
      {
         "couponCode": "string",
         "createDate": "DateTime",
         "discountId": "int",
         "reason": "string",
         "reasonCode": "int"
      }
   ],
   "items": [
      {
         "auditInfo": {
            "createBy": "string",
            "createDate": "DateTime",
            "updateBy": "string",
            "updateDate": "DateTime"
         },
         "data": "string",
         "discountedTotal": "decimal",
         "discountTotal": "decimal",
         "extendedTotal": "decimal",
         "feeTotal": "decimal",
         "fulfillmentLocationCode": "string",
         "fulfillmentMethod": "string",
         "handlingAmount": "decimal",
         "id": "string",
         "isRecurring": "bool",
         "isTaxable": "bool",
         "itemTaxTotal": "decimal",
         "lineId": "int",
         "localeCode": "string",
         "product": {
            "allocationExpiration": "DateTime",
            "allocationId": "int",
            "bundledProducts": [
               {
                  "allocationExpiration": "DateTime",
                  "allocationId": "int",
                  "creditValue": "decimal",
                  "description": "string",
                  "fulfillmentStatus": "string",
                  "goodsType": "string",
                  "isPackagedStandAlone": "bool",
                  "measurements": {
                     "height": {
                        "unit": "string",
                        "value": "decimal"
                     },
                     "length": {
                        "unit": "string",
                        "value": "decimal"
                     },
                     "weight": {
                        "unit": "string",
                        "value": "decimal"
                     },
                     "width": {
                        "unit": "string",
                        "value": "decimal"
                     }
                  },
                  "name": "string",
                  "optionAttributeFQN": "string",
                  "optionValue": "object",
                  "productCode": "string",
                  "productReservationId": "int",
                  "quantity": "int"
               }
            ],
            "categories": [
               {
                  "id": "int",
                  "parent": "self"
               }
            ],
            "description": "string",
            "discountsRestricted": "bool",
            "discountsRestrictedEndDate": "DateTime",
            "discountsRestrictedStartDate": "DateTime",
            "fulfillmentStatus": "string",
            "fulfillmentTypesSupported": "string",
            "goodsType": "string",
            "imageAlternateText": "string",
            "imageUrl": "string",
            "isPackagedStandAlone": "bool",
            "isRecurring": "bool",
            "isTaxable": "bool",
            "measurements": {
               "height": {
                  "unit": "string",
                  "value": "decimal"
               },
               "length": {
                  "unit": "string",
                  "value": "decimal"
               },
               "weight": {
                  "unit": "string",
                  "value": "decimal"
               },
               "width": {
                  "unit": "string",
                  "value": "decimal"
               }
            },
            "mfgPartNumber": "string",
            "name": "string",
            "options": [
               {
                  "attributeFQN": "string",
                  "dataType": "string",
                  "name": "string",
                  "shopperEnteredValue": "object",
                  "stringValue": "string",
                  "value": "object"
               }
            ],
            "price": {
               "creditValue": "decimal",
               "msrp": "decimal",
               "price": "decimal",
               "salePrice": "decimal",
               "tenantOverridePrice": "decimal"
            },
            "productCode": "string",
            "productReservationId": "int",
            "productType": "string",
            "productUsage": "string",
            "properties": [
               {
                  "attributeFQN": "string",
                  "dataType": "string",
                  "isMultiValue": "bool",
                  "name": "string",
                  "values": [
                     {
                        "stringValue": "string",
                        "value": "object"
                     }
                  ]
               }
            ],
            "upc": "string",
            "variationProductCode": "string"
         },
         "productDiscount": {
            "appliesToSalePrice": "bool",
            "couponCode": "string",
            "discount": {
               "expirationDate": "DateTime",
               "id": "int",
               "itemIds": "string",
               "name": "string"
            },
            "discountQuantity": "int",
            "excluded": "bool",
            "impact": "decimal",
            "impactPerUnit": "decimal",
            "productQuantity": "int"
         },
         "productDiscounts": [
            {
               "appliesToSalePrice": "bool",
               "couponCode": "string",
               "discount": {
                  "expirationDate": "DateTime",
                  "id": "int",
                  "itemIds": "string",
                  "name": "string"
               },
               "discountQuantity": "int",
               "excluded": "bool",
               "impact": "decimal",
               "impactPerUnit": "decimal",
               "productQuantity": "int"
            }
         ],
         "quantity": "int",
         "shippingDiscounts": [
            {
               "discount": {
                  "couponCode": "string",
                  "discount": {
                     "expirationDate": "DateTime",
                     "id": "int",
                     "itemIds": "string",
                     "name": "string"
                  },
                  "excluded": "bool",
                  "impact": "decimal"
               },
               "discountQuantity": "int",
               "impactPerUnit": "decimal",
               "methodCode": "string"
            }
         ],
         "shippingTaxTotal": "decimal",
         "shippingTotal": "decimal",
         "subtotal": "decimal",
         "taxableTotal": "decimal",
         "total": "decimal",
         "unitPrice": {
            "extendedAmount": "decimal",
            "listAmount": "decimal",
            "overrideAmount": "decimal",
            "saleAmount": "decimal"
         }
      }
   ],
   "itemTaxTotal": "decimal",
   "lastValidationDate": "DateTime",
   "orderDiscounts": [
      {
         "couponCode": "string",
         "discount": {
            "expirationDate": "DateTime",
            "id": "int",
            "itemIds": "string",
            "name": "string"
         },
         "excluded": "bool",
         "impact": "decimal"
      }
   ],
   "shippingSubTotal": "decimal",
   "shippingTaxTotal": "decimal",
   "shippingTotal": "decimal",
   "siteId": "int",
   "subtotal": "decimal",
   "taxTotal": "decimal",
   "tenantId": "int",
   "total": "decimal",
   "userId": "string",
   "visitId": "string",
   "webSessionId": "string"
}

For information about the properties in the response, refer to the REST API Help.

Context Objects Available to All Actions

apiContext

Accesses Kibo eCommerce tenant information.

PropertiesTypeDescription
baseUrlstringThe base URL for the site.
basePciUrlstringThe base PCI URL for the site.
tenantPodstringThe name of the tenant pod in which the tenant resides.
appClaimsstringThe application claims token.
appKeystringThe application key.
tenantIdintegerUnique identifier for the tenant.
siteIdintegerUnique identifier for the site. This ID is used at all levels of a store, catalog, and tenant to associate objects to a site.
masterCatalogIdintegerUnique identifier for the master catalog.
catalogIdintegerThe unique identifier for the product catalog. Catalogs are part of a master catalog.
currencyCodestringThe default three-letter ISO currency code for monetary amounts.
previewDatedate/timeThe date and time that the content is being viewed. This might be a future date if the content is previewed with an active date range set in the future.
localeCodestringThe locale code per the country code provided. This code determines the localized content to use and display.
correlationIdstringThe unique identifier of the API request associated with the event action, which might contain multiple actions.
isAuthorizedAsAdminBooleanIndicates whether the Dev Account user is authorized as an admin.
userClaimsstringThe user claims token.

Example:

context.apiContext.baseUrl;

configuration

Receives a JSON response that contains information about the configuration data set in the Action Management JSON editor.

PropertiesTypeDescription
VariesobjectCustom fields and values that you can set in the Action Management JSON Editor.

Example:

context.configuration.customData;