So you actually tried the GraphQL example that I provided? It displays the id (i.e. - the location_id) and the name (i.e. - the display name, like in the Shopify web admin dropdown) in the results. I’ll paste the raw data for the GraphQL API response that I received when I tried it. You can install the Shopify GraphiQL App as an app on a production store, test store, development store, etc. and test out API requests. It’s pretty useful for learning how it works.
Specifically below, the
…
“location”: {
“id”: “gid://shopify/Location/203128”,
“name”: “Sawmill”,
…
is what you are looking for. In above, the 203128 is the location_id and Sawmill is the display name. Can’t be much plainer than that?
{
"data": {
"productVariant": {
"title": "Default Title",
"id": "gid://shopify/ProductVariant/31512998182964",
"product": {
"title": "\"Be Own Kind of Beautiful\" Cuff"
},
"inventoryItem": {
"id": "gid://shopify/InventoryItem/33055390433332",
"inventoryLevels": {
"edges": [
{
"node": {
"id": "gid://shopify/InventoryLevel/4232978?inventory_item_id=33055390433332",
"available": 2,
"location": {
"id": "gid://shopify/Location/203128",
"name": "Sawmill",
"address": {
"address1": "6280 Sawmill Road",
"address2": "",
"city": "Dublin",
"province": "Ohio",
"country": "United States",
"phone": ""
}
}
}
},
{
"node": {
"id": "gid://shopify/InventoryLevel/17069604926?inventory_item_id=33055390433332",
"available": 0,
"location": {
"id": "gid://shopify/Location/17431658558",
"name": "Easton",
"address": {
"address1": "3960 New Bond Street",
"address2": "",
"city": "Columbus",
"province": "Ohio",
"country": "United States",
"phone": ""
}
}
}
},
{
"node": {
"id": "gid://shopify/InventoryLevel/17069637694?inventory_item_id=33055390433332",
"available": 0,
"location": {
"id": "gid://shopify/Location/17431691326",
"name": "Weber",
"address": {
"address1": "1523 East 15th Street",
"address2": "",
"city": "Tulsa",
"province": "Oklahoma",
"country": "United States",
"phone": ""
}
}
}
}
]
}
}
}
},
"extensions": {
"cost": {
"requestedQueryCost": 35,
"actualQueryCost": 14,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 986,
"restoreRate": 50
}
}
}
}