Create Sales Invoices from C#

Hi,
My client has a requirement that, sales Invoices are verified in an external system. Those data should be imported into NAV 13 converting each of them into sales invoices. I am planning to use C# to post directly into “sales Header” and “Sales Line”. Is it ok to do so, or are there any alternatives