Is it possible to programmatically enable/disable checkout validation rules like some apps do?

Hi Shopify dev community,

I’m building a checkout validation function for my Shopify app. I’ve created a metafield that my function reads to decide whether to enforce validation (on/off) for a shop.

The problem is that, currently, after deploying the function, I have to manually add and activate the corresponding checkout rule in Shopify Admin for each shop. I want to avoid this manual step.

I noticed that the app Simple Address Validator seems to automatically turn on and off the checkout validation rules from the app itself. I’m curious how this is possible.

My questions:

  1. Is there any official Shopify Admin API or GraphQL mutation that allows apps to programmatically enable or disable checkout validation rules for a shop?

  2. If not, how might apps like Simple Address Validator achieve this behavior? Are they using hidden/private APIs, or is it done through some kind of workaround?

Any guidance or insights would be greatly appreciated.

Thank you!