Sage 50 has a built in import utility, that basically takes a CSV formatted header plus the data, and can dump it into an invoice.
If you want to see the format, one easy way is to open the sample test file, set up a customer as using Sage 50 and having…