Get the POS location ID as a part of the POS link

Topic summary

A developer needs to retrieve the POS location ID and include it in a target URL when handling POS links.

Current Limitation:

  • Shopify’s POS system doesn’t automatically append location IDs to POS links
  • The location ID must be retrieved and added manually

Proposed Solutions:

  1. API Retrieval: Use Shopify Admin API endpoint (GET /admin/api/2024-01/locations.json) to fetch all location IDs
  2. Dynamic Extraction: Utilize Shopify App Bridge for embedded POS apps or extract from order objects in transactions
  3. Manual URL Construction: Append the retrieved location ID as a query parameter (e.g., ?location_id=XXXXXXXXXX)

Requirements:

  • Request read_locations permission for API credentials
  • Consider using Shopify POS UI Extensions for dynamic location ID retrieval

The discussion remains open for further clarification or implementation examples.

Summarized with AI on November 1. AI used: claude-sonnet-4-5-20250929.

Hey,

We have a POS link handler, and we want to get the POS location ID as a part of the target URL, is this functionality possible?

1 Like

Hi @urigrise

I’ve read your question carefully, and I see that you’re trying to extract the POS location ID as part of the target URL when handling a POS link. I’ll break it down and provide the best approach to achieve this.

Understanding the Issue

Shopify’s POS system assigns a unique Location ID to each physical store or sales point. If you need to retrieve this ID dynamically within a URL, the main challenge is whether Shopify’s system exposes this information within the POS app’s link structure.

Possible Solution

Yes, you can retrieve the Location ID dynamically, but Shopify’s API doesn’t automatically append it to POS links. Instead, you’ll need to:

1-Use Shopify’s API to get the location ID:

If you’re working with the Shopify Admin API, use this endpoint:

GET /admin/api/2024-01/locations.json

  • This will return all your locations with their respective IDs.

2-Extract the Location ID dynamically from the Shopify POS environment:- If your POS app is embedded, you can use Shopify.App Bridge to fetch the current location.

  • Alternatively, you can detect the location ID from transactions by checking the order object inside Shopify POS.

3-Manually append the Location ID to your link:

If you’re generating a URL dynamically, you can structure it like this:

https://your-pos-app.com/?location_id=XXXXXXXXXX

  • Replace XXXXXXXXXX with the actual Location ID retrieved from the API.

Key Considerations- If you’re using Shopify POS embedded apps, make sure to request read_locations permission when setting up your API credentials.

  • If you’re linking from a button within Shopify POS, consider Shopify POS UI Extensions to fetch the location ID dynamically.

Let me know if you need further clarification or examples!
Best regards,
Daisy.