question

jolly avatar image
jolly asked Sukhbir Singh commented

Create Order from customer app ?

Hello,

I am developing clover app in that i want to create order from my app so it is possible to create open order from my app or give me any link or suggestion if it is possible ?

Orders
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

Lee Tickett avatar image
Lee Tickett answered Sukhbir Singh commented

Yes. We do this using the SDK, but it is also possible using the API; https://docs.clover.com/build/working...

Here are a few lines showing how we do it using the SDK;

Order mOrder; 
mOrder = orderConnector.createOrder(new Order());
orderConnector.updateOrder(mOrder);
orderId = mOrder.getId(); 
LineItem lineItem = new LineItem();
lineItem.setName("Test");
lineItem.setPrice(Long.valueOf(100));
lineItem.setIsRevenue(true);
orderConnector.addCustomLineItem(mOrder.getId(), lineItem, true);
lineItem = new LineItem();
lineItem.setName("Test Line 2");
lineItem.setPrice(Long.valueOf(200));
lineItem.setIsRevenue(true);
orderConnector.addCustomLineItem(mOrder.getId(), lineItem, true);
orderConnector.updateOrder(mOrder);
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.

jolly avatar image jolly commented ·

ok thank u,it's working one more thing if multiple LineItem want in one order id then it is possible ?

0 Likes 0 ·
Lee Tickett avatar image Lee Tickett commented ·

Yes. I've updated the answer to show 2 items being added. Don't forget to accept this answer :)

0 Likes 0 ·
Sukhbir Singh avatar image Sukhbir Singh commented ·

It is possible to include tax and tip on Order?

0 Likes 0 ·

Welcome to the
Clover Developer Community