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 :-

  {
            "note": "I want this Item For Free ",
            "item": {
                  "id": "LID"
             },
          "unitQty": 12   // as per doc "unitQty": "int",
         "unitQty": "12" // tried both none working 
}

O/P:-

{
  "id": "id",
  "orderRef": {
    "id": "OID"
  },
  "item": {
    "id": "LID"
  },
  "name": "Gobi Sweet And Spicy",
  "alternateName": "",
  "price": 799,
  "note": "I want this Item For Free ",
  "printed": false,
  "createdTime": 1481276640000,
  "orderClientCreatedTime": 1481276640000,
  "exchanged": false,
  "refunded": false,
  "isRevenue": true
}

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.

3 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 ·
sam avatar image sam commented ·

@Prasad, the listed attributes are returned but not all of them are POST-able. We'll try to make this clearer on our next iteration of our documentation.

0 Likes 0 ·

Welcome to the
Clover Developer Community