question

globaliwebsite avatar image
globaliwebsite asked Jeffrey Blattman answered

Print added line item

Hello,

its connecting question with this thread

https://community.clover.com/questions/26451/line-item-not-creating-on-live-mode-using-rest-apu.html?childToView=26471#answer-26471




  string tokenUrl = String.Format("https://api.clover.com/v3/merchants/<MID>/orders/<OrderId>/line_items?access_token=<accesstoken>");

                var client = new RestClient(tokenUrl);

                    var request = new RestRequest(Method.POST);
                    request.AddHeader("content-type", "application/json");
                  
                    request.AddParameter("application/json", "{\"printed\":false,\"exchanged\":\"false\",\"refunded\":\"false\",\"refund\":{\"transactionInfo\":{\"isTokenBasedTx\":\"false\",\"emergencyFlag\":\"false\"}},\"isRevenue\":\"false\",\"name\":" + itemproductname + ",\"price\":" + price + ",\"unitQty\":" + qty + "}", ParameterType.RequestBody);
                  
                    IRestResponse response = client.Execute(request);

1. the above thread is solved and now line item is creating

2. in the above thread in end point there is field printed=false (this is by default)

3. does it mean when I create new line item and if status is false it will create auto print


Please advice

LineItems
10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered globaliwebsite commented

I am not sure what that flag indicates. However, it is not something you can set and expect action on (setting it to true, won't have any affect regarding automatically printing or not printing). If you want to print orders on the device automatically you will need to have an application on the Clover device.

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.

globaliwebsite avatar image globaliwebsite commented ·

hello,

Please guide me what kind of application I need on clover device?

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ globaliwebsite commented ·

You would need to build an Android app that would be installed on the device. The app will likely listen for a notification that you send from your server and then print the order - https://community.clover.com/questions/751/printing-online-orders-using-cloversdk-to-kitchen.html. Unfortunately, this is not a trivial task.

-1 Like -1 ·
globaliwebsite avatar image globaliwebsite David Marginian ♦♦ commented ·

do you have any reference point to start with.

0 Likes 0 ·
Jeffrey Blattman avatar image
Jeffrey Blattman answered

The printed flag is something that the device sets when it prints the line item (for the purposes of a kitchen receipt). It's used to add some workflow and authentication around re-printing kitchen items to avoid them being prepared multiple times, inadvertently.

Don't set it yourself. It's something that's really for internal use, but ended up in the public documentation.

10 |2000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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