Hey @Raymond_Zeng, thanks for getting back to me 
You can store a single markets => regions mapping on a app global metafield once per shop
In order to access an additional shop metafield, it would cost 3 input query points, which is not viable for any of our discounts (out the gate) - unless we can get an exception to the 30 query point rule?
Secondly, it relies on a webhook → update metafield process. It’s likely that there will be missed webhooks, delayed webhooks etc. This can lead to incorrect discounts being applied.
It’s not feasible to do the migration on the app’s behalf.
My suggestion here was not that Shopify update the configurations belonging to live functions, but rather market.handle should represent the inverse of the relationship you proposed above - kept up to date by Shopify. This means backwards compatibility for existing function configurations.
For apps on API version 2026-07+, I believe the discountAutomaticAppCreate mutation accepts markets in the context input to target discounts to specific markets.
That’s correct, and we offer that to merchants today. But there are also a few problems with this. Firstly, we still have existing functions that target market.handle - rather than targeting market at the top level. Secondly, we have plenty of configurations that target different market(s) (inclusions, exclusions), per discount proposal - so multiple per function - one top level market does not cover those existing configurations.
We can change ‘update’ discount configurations to target ‘countries’, but on multiple discount functions, we are already at the 30 input query limit, so we could never add both the market.handle AND localisation.country at the same time.
What we would likely have to do - is update every existing function configuration metafield to change market handle → list of associated country codes.
We can do this with an expand & contract approach to be as careful as possible. The truth is though, some likelihood/possibility of something going wrong exists.
I don’t think this is a responsible requirement/approach and it’s not fair to merchants (who may have incorrect/invalid discounts as a result), or the work + risk put on partners. If something goes wrong - 1* reviews galore!