Add To Cart And Wishlist
Request Parameters:
We can add product to cart as well as wishlist.
Below url and parameter use for add to cart product.
URL:../Plugins/XcellenceIt.Plugin.Misc.NopRestApi/RemoteService/WebService.svc/DetailAddProductToCart
Parameter:
{
"apiSecretKey": "h101d110c117x115g115u108k108m113",
"storeId": "1",
"currencyId": "1",
"customerId": "45",
"productId": "31",
"shoppingCartTypeId": "1",
"quantity": "1",
"attributeControlIds": ["product_attribute_16_5_4_13", "product_attribute_16_6_5_15",
"product_attribute_16_3_6_18", "product_attribute_16_4_7_20",
"product_attribute_16_8_8_22,23,24", "product_attribute_16_4_7_20" ],
"rentalStartDate": "06/15/2015",
"rentalEndDate": "06/17/2015"
}
Note:
1)attributeControlIds:product_attribute_ProductId_ProductAttributeId_ProductAttributeMapId_AttributeValueId
2)For Shopping cart and wishlist we have to use shoppingCartTypeId 1 and 2 respectively.
3)For nopCommerce 3.40, rentalStartDate and rentalEndDate not supported.
4)If you are a guest customer pass CustomerId=0,then in response you will get your Guest CustomerId
Response:
{
"DetailAddProductToCartResult":
{
"Id": 0,
"Message": "The product has been added to your shopping cart",
"AttributeControlType": null,
"CustomerId": 1,
"Messages": null,
"Success": true,
"UpdateTopCartSectionHtml": "(1)",
"UpdateTopWishlistSectionHtml": null
}
}
Request Parameters:
Below url and parameter use for Add to wish list product
URL:../Plugins/XcellenceIt.Plugin.Misc.NopRestApi/RemoteService/WebService.svc/CatalogAddProductToCart
Parameter:
{
"apiSecretKey": "h101d110c117x115g115u108k108m113",
"storeId": "1",
"currencyId": "1",
"customerId": "1",
"productId": "17",
"shoppingCartTypeId": "2",
"quantity": "5"
}
Note: For add to wish list you need to pass “shoppingCartTypeId:2”.
Response :
{
"CatalogAddProductToCartResult":
{
"Id": 0,
"Message": "The product has been added to your wishlist",
"AttributeControlType": null,
"CustomerId": 1,
"Messages": null,
"Success": true,
"UpdateTopCartSectionHtml": null,
"UpdateTopWishlistSectionHtml": "(5)"
}
}