Hi,
I am trying to create an order with the line items by using the following code:
Order order = new Order();
List<LineItem> list_item = new ArrayList<>();
LineItem lineWavit = new LineItem();
lineWavit.setName(AppConstants.WAV);
lineWavit.setPrice(transactionReview.getChargeAmount());
list_item.add(lineWavit);
LineItem lineTax = new LineItem();
lineTax.setName(AppConstants.TAX);
lineTax.setPrice(transactionReview.getTaxAmount());
list_item.add(lineTax);
order.setLineItems(list_item);
orderConnector.createOrder(order);
But we are getting the following exception every time:
W/System.err: com.clover.sdk.v1.ClientException: status code: 400 cannot update one or more of these fields: Order{json='{"lineItems":{"elements":[{"name":"WAV","price":48},{"name":"Tax","price":90}]}}', bundle=null, changeLog=null}
W/System.err: at com.clover.sdk.v1.ServiceConnector.throwOnFailure(ServiceConnector.java:327)
W/System.err: at com.clover.sdk.v1.ServiceConnector.execute(ServiceConnector.java:260)
W/System.err: at com.clover.sdk.v3.order.OrderV31Connector.createOrder(OrderV31Connector.java:233)
Please suggest.
Note: I have tried to create the order without a line item, Order creates successfully but when we try orderConnector.addCustomLineItem() same issue arrives.