I am having an error - "There are no warehouse shipment lines created",  in Dynamics NAV 2013 when trying to create a warehouse shipment from Sales Order. This order is added using a custom API in NAV.

But whenever I manually create an order in NAV and then post it for warehouse shipment, it successfully got created. Does anybody have an idea why is this happening?