question

ashwinipatil avatar image
ashwinipatil asked Jeffrey Blattman edited

need to call Create a new line item clover api for each quantity even if same Item is placed with 2 or more quantities

We integrated the clover application. For clover merchant there is a below scenario
1> Customer placed order through browser
2> Item name Pizza added with quantity 2 in order cart (price for 1 quantity is $2.67)
3> Below Json request sent to clover api (Create a new line item). In request
passed 2 quntity.
-- Json request

{"quantitySold":2,"unitQty":2,"createdTime":"1529668621","exchanged":false,"refunded":false,"price":"534","isRevenue":false,"item":{"id":"1GFZ5HY0ANQCY"},"name":"Pizza","printed":false,"note":null,"userData":null,"modifications":null,"customers":null}

-- Clover api (Create a new line item) :
POST /v3/merchants/{mId}/orders/{orderId}/line_items

Once the clover order generated successfully and later response checked under orders (Get a single order) clover api showing 1 quantity price instead of 2 quantity under "lineItems".
Question is, need to call above (Create a new line item) clover api for each quantity even if same Item is placed with 2 or more quantities ?
OrdersLineItems
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.

ashwinipatil avatar image ashwinipatil commented ·

We are waiting for the reply. Please advise

0 Likes 0 ·

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered Jeffrey Blattman edited
Don't use unit quantities. Just add two fixed price line items. Sorry for the mysterious answer but the truth is that our documentation isn't in place to describe what's required to handle unit quantity line items.
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.

ashwinipatil avatar image ashwinipatil commented ·
Greetings Jeffrey. Thanks for the reply.
Can you please elaborate the your answer ?
We are allowing only Fixed price type items to be placed through our web application. Then call the required clover rest v3 apis'.
Currently we are calling 1 of the below clover rest v3 api for each quantity even if same item placed.
-- Clover api (Create a new line item) :
POST /v3/merchants/{mId}/orders/{orderId}/line_items
So is it correct ?
0 Likes 0 ·
ashwinipatil avatar image ashwinipatil commented ·
Please suggest
0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ ashwinipatil commented ·

II don't understand what you are saying. In your post you are using a unit quantity (,"unitQty":2). I'm assuming you are trying to charge for 2 pizzas by setting the unit quantity to 2 on a single line item. I'm saying don't do that. Just add two separate fixed price line items. Your comment seems to contrdict that you are using a unit quantity, but I'm looking at the JSON above.

0 Likes 0 ·

Welcome to the
Clover Developer Community