Shopify Storefront cart buyerIdentity and country/market context

domain: shopify.dev · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

Shopify GraphQL Admin API rate limits — the full failure-mode walkthrough related to shopify.dev, checked against official docs, with linked verified routes.

Steps

  1. After cart creation, call cartBuyerIdentityUpdate with the cart ID and a CartBuyerIdentityInput containing countryCode and optionally customerAccessToken or email.
  2. Setting countryCode triggers market resolution: Shopify selects the matching Market, applies localized pricing, and updates cart.cost to reflect market-specific prices.
  3. If the buyer is authenticated, include customerAccessToken so the cart is associated with the customer account, enabling B2B company resolution if applicable.
  4. Read cart.buyerIdentity.countryCode and cart.market back in the response to confirm the resolved market.
  5. Re-fetch cart.cost.totalAmount after updating buyer identity because prices and currency may change based on the resolved market.
  6. Consult current Shopify Markets docs for which markets are available and how to enable markets with country-specific domains or subfolders.

Known gotchas

Related routes

Shopify B2B: ordering on behalf of a company via Storefront buyer context
shopify.dev · 6 steps · unrated
Add buyer identity with a customer access token to a Shopify Storefront API cart and trigger B2B pricing resolution
shopify.dev · 6 steps · unrated
Fetch localized storefront prices and content for a specific country and language using the Shopify Storefront API @inContext directive with Shopify Markets
shopify.dev · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans