Skip to content

Set and clear an owner's metafields together

PUT/admin/v1/stores/{store_id}/metafields

    Set and clear an owner's metafields together, by namespace.key. Every value is checked against its definition before anything is saved. Requires the permission that edits the owner.

    Path parameters

    • store_idstringrequired

      The store's ID, like store_01k8qs5s…. Apps get it with the install, in the OAuth redirect and the token response.

    Headers

    • shop-api-versionYYYY-MM

      The version to answer in. Without it, your app’s pinned version, else the newest.

    Body

    • owner_typeenumrequired

      What a metafield belongs to.

      • product
      • variant
      • collection
      • customer
      • order
      • store
    • valuesobjectrequired
    • owner_idstring · or null

      Left out for the store.

    Returns

    200 The owner's metafields after the change.

    Errors

    • 403forbiddenMissing the owner's write permission.
    • 404not_foundNo such owner.
    • 422validation_failedA value does not fit its definition, refers to something the store does not have, or has no definition; see errors[].field (values.{namespace.key}).