question

yogeshm avatar image
yogeshm asked chetan-purohit commented

how to add quantity in order using restapi

i have added line items using rest api.please guide how to add unit qty in line . i have tryed { "unitQty": 5 }

OrdersLineItems
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

q-factor avatar image
q-factor answered chetan-purohit commented

unitQty property is for line items that are priced per unit quantity. For fixed priced items you have to have separate line item input for individual line items.

1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

chetan-purohit avatar image chetan-purohit commented ·

You can't add quantity of any item in order. I would like to explain it by example:

Suppose you are adding `Pizza` with 4 quantity in an order, then you can not add quantity with only single line item as 4. You have to add 4 lineItems of  `Pizza` in that order by update call of that order. For 'Per Unit' price items you can go with the way `q_facter` has specified.
0 Likes 0 ·
chetan-purohit avatar image
chetan-purohit answered

You can do that by using following POST API:

/v3/merchants/{mId}/item_stocks/{itemId}

The payload should be:

{
   "quantity":100
}

Please note one thing that for updating item quantity through API Track Stock option should be checked in Inventory -> Setup tab in merchants clover account. Please let me know if any extra help needed.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community