How to prefill address region in cart permalink?

Topic summary

A developer successfully resolved an issue with prefilling address region data in a cart permalink URL.

Initial Problem:

  • Could prefill address line 1 and city, but not the region dropdown
  • Attempted multiple parameter variations (zone, region, province, country) without success
  • Included a screenshot showing the region dropdown HTML structure with options like “Hong Kong Island” (HK), “Kowloon” (KL), and “New Territories” (NT)

Solution Found:
Both parameters must be set simultaneously:

  • checkout[shipping_address][province]=HK (or ‘KL’ or ‘NT’)
  • checkout[shipping_address][country]=Hong+Kong

Implementation Note:
Square brackets in the URL parameters need to be URI-encoded (%5B and %5D) for proper functionality.

The issue is now resolved with a working permalink format provided.

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

I’m working on permalink to prefill address info for customer. I am able to prefill address line 1 and city, but can’t find a way to pre-fill region.

The region dropdown input has name=“zone” so I suppose the follow would work, but it doesn’t.

/cart/{variant_id}:{quantity}?checkout[shipping_address][zone]=HK

I have also tried the following but without luck

checkout[zone]=HK

checkout[shipping_address][region]=HK

checkout[shipping_address][province]=HK

checkout[shipping_address][country]=HK

The Region dropdown HTML:

<select name="zone" id="Select4" required="" autocomplete="shipping address-level1" class="_b6uH _1fragemm6 yA4Q8 vYo81 RGaKd">

  <option data-alternate-values="["Hong Kong Island","Hong Kong Province","Hong Kong","香港","香港島"]" value="HK">Hong Kong Island</option>

  <option data-alternate-values="["Kowloon","九龍"]" value="KL">Kowloon</option>

  <option data-alternate-values="["New Territories","新界"]" value="NT">New Territories</option>

</select>

Turns out it works by setting both:

checkout[shipping_address][province]=HK (or ‘KL’ or ‘NT’)

checkout[shipping_address][country]=Hong+Kong

Putting it together:

/cart/{variant_id}:{quantity}?&checkout%5Bshipping_address%5D%5Bcountry%5D=Hong+Kong&checkout%5Bshipping_address%5D%5Bprovince%5D=HK

Also note the square brackets needs to be uri encoded.