---
title: Target buyers by country instead of market ID
description: >-
  Learn how to update your app from deprecated single-market endpoints to
  country-based targeting, so your app stays resilient when merchants
  reorganize, activate, deactivate, or delete markets.
source_url:
  html: 'https://shopify.dev/docs/apps/build/markets/target-buyers-by-country'
  md: 'https://shopify.dev/docs/apps/build/markets/target-buyers-by-country.md'
---

# Target buyers by country instead of market ID

**Migration guidance paused:**

We've received partner feedback raising concerns with the migration approach described in this guide. **Please hold off on migrating using these steps.** We're working on a revised solution and will follow up with updated guidance shortly.

If your app uses any of the deprecated single-market endpoints listed below, this guide explains why they're deprecated and what can go wrong.

***

## Deprecated single-market endpoints

The deprecated single-market endpoints are market objects with single market identifiers such as `id`, `name`, `handle`, and `regions`. These endpoints only surface country-based markets:

* **Liquid**: [`Localization.market`](https://shopify.dev/docs/api/liquid/objects/localization#localization-market), [`Country.market`](https://shopify.dev/docs/api/liquid/objects/country#country-market).
* **Storefront API**: [`Localization.market`](https://shopify.dev/docs/api/storefront/latest/objects/Localization#field-Localization.fields.market), [`Country.market`](https://shopify.dev/docs/api/storefront/latest/objects/Country#field-Country.fields.market).
* **Shopify Functions input**: [`Localization { market }`](https://shopify.dev/docs/api/functions/latest/delivery-customization#Input.fields.localization.market), [`deliveryAddress { market }`](https://shopify.dev/docs/api/functions/latest/delivery-customization#Input.fields.cart.deliveryGroups.deliveryAddress.market).
* **Checkout UI extensions**: [`shopify.localization.market`](https://shopify.dev/docs/api/checkout-ui-extensions/latest/target-apis/platform-apis/localization-api#docsstandardlocalizationapi-propertydetail-localization), [`useLocalizationMarket`](https://shopify.dev/docs/api/checkout-ui-extensions/2025-07/target-apis/platform-apis/localization-api#useLocalizationMarket).
* **GraphQL Admin API**: [`Customer.market`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Customer#field-Customer.fields.market), [`CompanyLocation.market`](https://shopify.dev/docs/api/admin-graphql/latest/objects/CompanyLocation#field-CompanyLocation.fields.market), [`MarketWebPresence.market`](https://shopify.dev/docs/api/admin-graphql/latest/objects/MarketWebPresence#field-MarketWebPresence.fields.market).

***

## Why single-market endpoints are deprecated

Before [market inheritance](https://shopify.dev/docs/apps/build/markets/market-inheritance) was introduced, a buyer belonged to exactly one market, so apps could safely use `market.id` or `market.handle` to decide what experience to show (for example, "if the market is North America, show this banner").

Now, merchants can create child markets (for example, a Canada market under North America). A Canadian buyer matches both markets. The deprecated single-market endpoints only return the most specific one (Canada), not the parent (North America).

If an app was configured to target the "North America" market by ID, Canadian buyers stop matching because the API now returns "Canada" instead. And it happens every time a merchant creates a new child market, forcing merchants to reconfigure the app each time.

**TL;DR:** Market IDs are no longer stable identifiers for targeting buyers.

***
