Get Assigned Sources of Stock in Multi-source Inventory (MSI) Magento 2.

Retrieves Assigned Sources links that are assigned to specific stocks in Multi-Source Inventory Magento 2.

You can check assigned sources for the stock from admin panel, Stores -> Inventory -> Stock

Edit any stocks from the grid, Go to Sources Tab, You can see a list of assigned sources for a given stock.

You can get all the assigned source using programmatically by GetStockSourceLinksInterface class.

Full Interface Path:
Magento\InventoryApi\Api\GetStockSourceLinksInterface

Code snippet to fetch a list of assigned source for stock,

Call function to fetch assigned source result,

Output:

You can fetch a list of assigned sources for a stock as a resultant array. I have given result for Default Stock of Native Magento.

If Stock has multiple assigned sources, Output will display multiple source results.