Get Invoice data by invoice id Magento 2.

You can get full details of Invoice related data using invoice id in Magento 2.

Using Magento\Sales\Api\InvoiceRepositoryInterface class you can get details of invoice related data in Magento 2.

Get Invoice related data using below code snippet in Magento 2 by Invoice id,

Pass Invoice id to fetch invoice records from a database table.
echo $invoice = $this->getInvoiceData();