Get Source data by source_code using Multi Source Inventory (MSI) Magento 2.

Using Source code, you can get details of the Manage source in the Magento 2 MSI module.

Default Source is the out-of-the-box source in the MSI module.

You can fetch lit of information from the source_code in MSI using SourceRepositoryInterface of Inventory-API module.

Example of retrieving the default source data by source_code equals ‘default’.

You can call a function to fetch information of Source,

Using the Source code of Inventory, you can get the details information of Source in MSI.

You need to use get(‘source_code’) method of $this->sourceRepository Object to fetch specific source details.