question

Prasad avatar image
Prasad asked Prasad commented

How to Create or update the Line Item Unit Quantity ?

HI Guys ,

I am creating line items by using an sandbox endpoint as per the doc with pay load

End Point :- POST :- sandbox/v3/merchants/MID/orders/OID/line_items/LID

payload :-

  1. {
  2. "note": "I want this Item For Free ",
  3. "item": {
  4. "id": "LID"
  5. },
  6. "unitQty": 12 // as per doc "unitQty": "int",
  7. "unitQty": "12" // tried both none working
  8. }

O/P:-

  1. {
  2. "id": "id",
  3. "orderRef": {
  4. "id": "OID"
  5. },
  6. "item": {
  7. "id": "LID"
  8. },
  9. "name": "Gobi Sweet And Spicy",
  10. "alternateName": "",
  11. "price": 799,
  12. "note": "I want this Item For Free ",
  13. "printed": false,
  14. "createdTime": 1481276640000,
  15. "orderClientCreatedTime": 1481276640000,
  16. "exchanged": false,
  17. "refunded": false,
  18. "isRevenue": true
  19. }

But Not the "unitQty": 12 :-(

I cannot Understand what I am exactly Missing ? trying many things stringifying in the code parsing bla bla still not working

Could any help me with a suggestion or your experience on updating this Stuff Please .

Regards , Prasad.

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.

1 Answer

Bejoy Nair avatar image
Bejoy Nair answered Prasad commented

You can not add a quantity while adding the Line Items. You have to call V3 api each time separately. Suppose you want to add 2 quantities of same Line Item, then you need to call add item v3 api 2 times.

2 comments
10 |2000

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

Prasad avatar image Prasad commented ·

@kipsolabs yes that make sense . Could you pls take a look my updated query with new screens regarding Quantity . Please comment if any idea how it happened ?

0 Likes 0 ·
Prasad avatar image Prasad commented ·

but they defined it as one of the attribute possible to update as per the doc .. are we missing anything ?docs link

0 Likes 0 ·

Welcome to the
Clover Developer Community