code: public void cancelOrder(KiteConnect kiteConnect) throws KiteException, IOException {
          // Order modify request will return order model which will contain only order_id.
          // Cancel order will return order model which will only have orderId.
          Order order2 = kiteConnect.cancelOrder("180116000727266", Constants.VARIETY_REGULAR);
          System.out.println(order2.orderId);
      }
docs: Cancel an order