Currently, in the Invoice API, the line_items array contains the purchase_rate field.
Unfortunately, this purchase_rate field is the Cost Price of the Item, not the FIFO cost journaled into COGS for that sale.
There seems to be no current way to get the FIFO cost for an Invoice, either by line or in total, from the API, even though this information is in the system. It's readily available in the UI for an Invoice in Books when looking at the journal entries for a given Invoice.
Having this information would be extremely valuable. Frankly, the Cost Price isn't terribly useful on Invoices.