Shopify is not accepting admin: MERCHANT_READ_WRITE access

Topic summary

Developers are encountering errors when creating metafield definitions in Shopify API version 2025-01 due to conflicting access control requirements.

The Problem:

  • Using MERCHANT_READ_WRITE returns an error stating only public_read_write is permitted
  • Using PUBLIC_READ_WRITE throws an error because it’s not a valid value in the MetafieldAdminAccessInput enum (only MERCHANT_READ and MERCHANT_READ_WRITE are accepted)

Documentation Conflict:
The API schema documentation lists different valid values than the permissions guide, which recommends PUBLIC_READ_WRITE for merchant-owned metafields—a value that doesn’t exist in the actual enum.

Solution Found:
Omit the access.admin field entirely when creating metafields. Since it’s optional, leaving it unspecified allows successful metafield creation without triggering validation errors.

Summarized with AI on October 25. AI used: claude-sonnet-4-5-20250929.

In Shopify API version 2025-01, the metafield definition creation is failing when using either admin: MERCHANT_READ_WRITE or admin: PUBLIC_READ_WRITE for access control.

On MERCHANT_READ_WRITE response without throwing error:

{
  "metafieldDefinitionCreate": {
    "createdDefinition": null,
    "userErrors": [
      {
        "field": ["definition"],
        "message": "Setting this access control is not permitted. It must be one of [\"public_read_write\"].",
        "code": "INVALID"
      }
    ]
  }
}

On PUBLIC_READ_WRITE response with throwing error:

{
  "shop": "***.myshopify.com",
  "error": {
    "response": {
      "errors": [
        {
          "message": "Variable $definition of type MetafieldDefinitionInput! was provided invalid value for access.admin (Expected \"PUBLIC_READ_WRITE\" to be one of: MERCHANT_READ, MERCHANT_READ_WRITE)",
          "locations": [
            {
              "line": 2,
              "column": 36
            }
          ],
          "extensions": {
            "value": {
              "name": "extension-name",
              "namespace": "namespace",
              "key": "key",
              "type": "json",
              "ownerType": "SHOP",
              "access": {
                "admin": "PUBLIC_READ_WRITE",
                "storefront": "PUBLIC_READ"
              }
            },
            "problems": [
              {
                "path": ["access", "admin"],
                "explanation": "Expected \"PUBLIC_READ_WRITE\" to be one of: MERCHANT_READ, MERCHANT_READ_WRITE"
              }
            ]
          }
        }
      ]
    }
  }
}
4 Likes

Hi, I’m currently facing the same issue. The Shopify documentation doesn’t seem to be helpful. The mutation requires MetafieldAdminAccessInput, but the Admin permissions section of a different doc says merchant-owned metafields and metaobjects need to specify PUBLIC_READ_WRITE, which does not exist in the MetafieldAdminAccessInput schema.

Did you find a solution for this already?

Hello,

I got the same issue while attempting to create a public metafield using our application.

I found the solution which is to not specify the access.admin field. It’s an optional field so I figured out it was worth trying and the metafield is successfully created.

Hope it helps,
Clément