I am using the Java SDK, and one of my placeOrder calls failed with NetworkException. But, strangely, I find that the call has actually succeeded at the kite end, and created an order with the exchange. I had handled NetworkException in my code, with retry, and that resulted in duplicate order getting placed.
It would be good if you can accept an id in your place order calls, and if client retries an order that has succeeded at your end, respond back with the your orderId, instead of creating another order with the exchange. That would help to handle these kinds of NetworkException scenarios.
I would suggest checking orderbook before you retry placing order.
1) It that would get the entire orderbook, and
2) would also consume another API call within the 5 order calls per second limit.