Remove products

Remove products or product from a Save for later List

swat.SaveForLater.remove

Removes a product or products from a Save for Later List.

Definition

swat.SaveForLater.remove(lid, products, onSuccess, onError)

Example

// array of products you wish to remove from  save for later.
let products = [{
	du: "https://demo.swym.it/products/1200-mm-48-inch-high-speed-ceiling-fan-white-1",
	empi: 7096396546246,
	epi: 41255080132806,
}];

let lid = "7f69f914-d413-48dc-b449-77e9c3ff08e8"; // List ID.

// Success callback.
let onSuccess = function(response) {
	console.log("Successfully Removed the products From Save for Later List", response);
}

// Error Callback. 
let onError = function(error) {
	// Error is an xhrObject
	console.log("There was an Error, while Removing products to the Save For Later List", error);
}

// Call the Add function.
swat.SaveForLater.remove(lid,products, onSuccess, onError);

API Parameters

ArgumentTypeDescription
lidobjectList id of save for later list.
productsarrayarray of Products you wish to remove. (Max 10 per request)
onSuccessfunctionCalled when the products are successfully removed.
onErrorfunctionCalled when there is an error while removing products to the Save for later List.

Success Response

{
    "itemsdeleted": [
        {
            "di": "fb283019-487b-4447-99e6-133178f6477e",
            "bt": "Swym Marketing",
            "clbls": [],
            "uid": "8kPqqX6/sOYTTOc0WqrpkhmWttqouvi3wygUngPfiHU=",
            "dt": "1200 mm (48 inch) High Speed Ceiling Fan (White)",
            "cts": 1679668563837,
            "empi": 7096396546246,
            "cby": "[email protected]",
            "lid": "7f69f914-d413-48dc-b449-77e9c3ff08e8",
            "du": "https://demo.swym.it/products/1200-mm-48-inch-high-speed-ceiling-fan-white-1",
            "pid": "/IV7e7cGxT1978LieU1jRdMt6XhYfo=",
            "epi": 41255080132806,
            "cprops": {},
            "id": "da0563a8-e9f8-4bb8-8563-a8e9f80bb832",
            "uts": 1679668563837,
            "iu": "https://cdn.shopify.com/s/files/1/0534/3635/0662/products/1200mm_48inch_HighSpeedCeilingFan_White_620x620.jpg?v=1637592908",
            "qty": 1,
            "uby": "[email protected]",
            "pr": 800,
            "vi": null
        }
    ],
    "itemsfailed": []
}

Product

Each product contains the below information to remove it from Save for Later lists:

Property NameData TypeRequiredDescription
epiint/stringYesVariant id of the product to be added
empiint/stringYesProduct id of the product to be added
dustringYesCanonical uri of the product to be added