SevenSpikes / api-plugin-for-nopcommerce

API plugin for nopCommerce
MIT License
285 stars 214 forks source link

create shoppingCartItem error #90

Open bzxnvpr opened 7 years ago

bzxnvpr commented 7 years ago

Dear Sir,

I was trying to create shoppingCartItem for product with Attribute.

string Json = "shopping_carts: { customer_id: \"1\", product_id: \"46\", quantity: \"10\", shopping_cart_type: \"ShoppingCart\", product_attributes: [{ id: \"15\", value: \"hihihi\" }]}";

I get ERROR 422.

Could you please advise the mini json format ? Many thanks!

ahmedMabdo commented 7 years ago

hi, Root name should be "shopping_cart_item" you may try this string Json = { "shopping_cart_item": { "id": "0", "quantity": 10, "shopping_cart_type": "ShoppingCart", "product_id": 46, "product": null, "customer_id": 1, "customer": null, "ProductItemAttributeDto": [] } }