Bug Report: Unable to Save Custom Metafield Configuration for Order Routing Location Rule via Shopify Admin UI

When attempting to save a custom metafield configuration for an Order Routing Location Rule using a Shopify Admin UI extension, the Shopify Admin UI returns an error stating that access to the namespace and key is not allowed, despite the metafield definition being present, correctly configured, and the app having all required scopes.

Context

  • We are building a solution that leverages the new Order Routing Location Rule feature.

  • We have requested and received early access to this feature.

  • Our use case requires storing configuration data for the rule using a custom metafield on the ORDER_ROUTING_LOCATION_RULE resource type.


Steps to Reproduce

  1. Create a metafield definition for the ORDER_ROUTING_LOCATION_RULE resource type in the app’s shopify.app.toml:
    [order_routing_location_rule.metafields.app.configuration]
    type = "json"
    name = "Location Rule Configuration"
    
    access.admin = "merchant_read_write"
    access.storefront = "none"
    
  2. Ensure the app requests the write_shipping scope (and all other relevant scopes) in shopify.app.toml:
    scopes = "...write_shipping"
    
  3. Deploy the app and install it on a fresh store to ensure all scopes and definitions are up to date.
  4. Verify the metafield definition exists using the Admin GraphQL API:
    query {
      metafieldDefinitions(
        first: 10
        ownerType: ORDER_ROUTING_LOCATION_RULE
      ) {
        edges {
          node {
            id
            name
            namespace
            key
            type { name }
            access { admin storefront }
            description
          }
        }
      }
    }
    
    • The definition is present and has the correct access and type.
  5. Attempt to save a configuration from the Shopify Admin UI extension, which calls:
    applyMetafieldsChange([
      {
        namespace: "$app",
        key: "configuration",
        type: "updateMetafield",
        value: JSON.stringify({ ... }),
        valueType: "json",
      },
    ]);
    
  6. Observe the error returned by the Shopify Admin UI:
    {
      "data": {
        "orderRoutingStrategyUpdate": {
          "strategy": null,
          "userErrors": [
            {
              "field": ["input", "metafields", "base"],
              "message": "Location rules metafields Access to this namespace and key on Metafields for this resource type is not allowed.",
              "__typename": "OrderRoutingStrategyUpdateUserError"
            },
            {
              "field": null,
              "message": "Error saving OrderRouting::Strategy id=...",
              "__typename": "OrderRoutingStrategyUpdateUserError"
            }
          ],
          "__typename": "OrderRoutingStrategyUpdatePayload"
        }
      }
    }
    

What Was Tried

  • Confirmed the metafield definition exists and is accessible via the API.
  • Confirmed the app has the write_shipping scope and all other required permissions.
  • Confirmed the extension uses the correct namespace ($app) and key (configuration).
  • Commented out the applyMetafieldsChange call in the extension and verified that the error only occurs when attempting to write the metafield.
  • Attempted a fresh app installation to ensure all permissions and definitions are synced.

Expected Behavior

  • The Shopify Admin UI should allow saving the custom new rule with custom metafield configuration for the order routing location rule, as long as the metafield definition exists and the app has the required scopes and access.

Actual Behavior

  • The Shopify Admin UI returns an error, blocking the save, even though all requirements are met.

Additional Notes

  • The metafield definition appears in the API with a namespace like app--<app_id>, which is expected for app-scoped metafields.
  • This issue prevents apps from providing a configurable UI for order routing location rules using custom metafields.