How to deduct product quantity using inventory after it is getting ordered in commercetools?

141 Views Asked by At

[Issue we are facing in ordering a product]

changing inventory mode to Track only, tax mode to Platform

2

There are 2 best solutions below

2
Matheus On

The cart must have inventoryMode set to TrackOnly or ReserveOnOrder. You can find more details in the documentation below.

https://docs.commercetools.com/api/projects/carts#cart https://docs.commercetools.com/api/projects/carts#inventorymode

0
sunilsingh On

-For this inventory must be added.

-You can call inventory api and reduce the quantity which ever quantity has been ordered using line_item_id.

-It will be reflect in inventory section.

-Always check quantity on checkout page while placing an order for every product for that you can create one function which will give you product data with available quantity and you can check that with availability value.