Shop metafields hold custom data for the store as a whole, such as a brand story or a support banner. The store has one set of values, so these endpoints take no owner ID: the token's store is always the owner. Reads require read_storefront; writes require write_storefront. Translation requests also require read_translations or write_translations.
Discover the available definitions with GET /metafield-definitions?owner_type=store, then address values by namespace and key. The access rules match every other owner: app tokens read their own definitions, merchant-owned definitions, and other apps' shared definitions, and write only definitions their app owns. Store Admin tokens follow the definition's merchant_access. URL-encode : when an app namespace such as app:<slug> appears in a path.
Endpoints#
List shop metafields
List the store's shop-level custom-data values visible to the token.
Returns the store's shop-level values, paginated, for definitions the token can read. App tokens see values of their own definitions, merchant-owned definitions, and other apps' definitions shared with app_access: shared.
Query parameters
| Name | Type | Description |
|---|---|---|
page
|
integer |
Page number (default 1). |
limit
|
integer |
Page size; capped by the metafield list limit. |
Headers
| Name | Type | Description |
|---|---|---|
Authorization
required
|
string |
Bearer Store API token. |
Errors
-
400VALIDATION_LIST_INVALID_PAGEPage must be a positive integer.
-
400VALIDATION_LIST_INVALID_LIMITLimit must be a positive integer.
Set shop metafields
Create, update, or delete shop-level custom-data values.
Send namespace-and-key entries. A string value creates or replaces a value; null or an empty string deletes it. App tokens can write only definitions their app owns. The complete value change succeeds or fails together, and omitted entries are preserved. Each change sends the matching store_metafields/* webhook.
Headers
| Name | Type | Description |
|---|---|---|
Authorization
required
|
string |
Bearer Store API token. |
Body parameters
| Name | Type | Description |
|---|---|---|
metafields
required
|
array<object> |
Entries shaped as |
Errors
-
400STORE_API_INVALID_REQUEST_BODYThe body or entry shape is invalid. Each entry requires an explicit value, including null for deletion.
-
400METAFIELD_NO_WRITESProvide at least one metafield entry.
-
400METAFIELD_DUPLICATE_WRITEA namespace and key occur more than once.
-
400PRODUCT_METAFIELD_DEF_NOT_FOUNDThe namespace and key do not identify a definition this token can write. For an app token that is a definition its app owns; merchant-owned and other apps' definitions return this code too.
-
403METAFIELD_WRITE_MERCHANT_READ_ONLYA non-app token addressed an app-owned definition whose merchant_access is not read_write.
-
403STORE_API_SCOPE_REQUIREDBinding a nonempty file_reference or list.file_reference also requires read_files. Clearing a reference does not.
-
400METAFIELD_VALUE_TOO_LONGThe value exceeds its size limit: the definition's max_value_length, or the platform value size limit for the type.
-
400METAFIELD_VALUE_STRING_TOO_LONGA string value exceeds the definition's max_value_length or the platform string limit.
-
400METAFIELD_VALUE_TOO_SHORTA string value is shorter than the definition's min_length rule.
-
400METAFIELD_VALUE_PATTERN_MISMATCHA string value does not match the definition's pattern rule.
-
400METAFIELD_VALUE_INTEGER_INVALIDAn integer value is not a whole number in the 64-bit range.
-
400METAFIELD_VALUE_INTEGER_TOO_LONGAn integer value has more digits than the definition or the platform integer limit allows.
-
400METAFIELD_VALUE_DECIMAL_INVALIDA decimal value is not a finite decimal number.
-
400METAFIELD_VALUE_DECIMAL_TOO_LONGA decimal value, written out in full, is longer than the definition or the platform decimal limit allows.
-
400METAFIELD_VALUE_BELOW_MINAn integer or decimal value is below the definition's min rule.
-
400METAFIELD_VALUE_ABOVE_MAXAn integer or decimal value is above the definition's max rule.
-
400METAFIELD_VALUE_BOOLEAN_INVALIDA boolean value is not true or false.
-
400METAFIELD_VALUE_DATE_INVALIDA date value is not a calendar date in YYYY-MM-DD form.
-
400METAFIELD_VALUE_DATETIME_INVALIDA datetime value is not YYYY-MM-DDTHH:mm, YYYY-MM-DDTHH:mm:ss or an RFC 3339 timestamp.
-
400METAFIELD_VALUE_JSON_INVALIDA json value is not valid JSON.
-
400METAFIELD_VALUE_JSON_UNSAFE_LINKA json value contains a link whose scheme is not http, https, mailto or tel.
-
400METAFIELD_VALUE_URL_INVALIDA url value, or an item of a list.url value, is not an absolute URL with a host.
-
400METAFIELD_VALUE_URL_SCHEMEA url value, or an item of a list.url value, does not use http or https.
-
400METAFIELD_VALUE_URL_TOO_LONGA url value, or an item of a list.url value, exceeds the definition's max_value_length or the platform URL limit.
-
400METAFIELD_VALUE_NOT_IN_CHOICESA single_select value is not one of the definition's choice keys.
-
400METAFIELD_LIST_CHOICE_INVALIDAn item of a list.single_select value is not one of the definition's choice keys; the message names the item.
-
400METAFIELD_LIST_STRINGS_INVALIDA list.string or list.single_select value is not a JSON array of strings.
-
400METAFIELD_LIST_URLS_INVALIDA list.url value is not a JSON array of strings.
-
400METAFIELD_LIST_FILES_INVALIDA list.file_reference value is not a JSON array of strings.
-
400METAFIELD_LIST_IDS_INVALIDA list.product_reference or list.variant_reference value is not a JSON array of integers.
-
400METAFIELD_LIST_EMPTYA list value other than list.string is an empty array. Send null or an empty string to remove the value instead.
-
400METAFIELD_LIST_TOO_MANYA list value has more items than the definition's max_list_items or the platform list limit for the type.
-
400METAFIELD_LIST_ITEM_EMPTYAn item of a list.string value is empty or only whitespace; the message names the item.
-
400METAFIELD_LIST_ITEM_TOO_LONGAn item of a list.string value exceeds the definition's max_value_length or the platform string limit; the message names the item.
-
400METAFIELD_VALUE_FILE_UUID_INVALIDA file_reference value, or an item of a list.file_reference value, is not a file UUID.
-
400METAFIELD_VALUE_ID_INVALIDA product_reference or variant_reference value is not an integer ID.
-
400METAFIELD_VALUE_ID_POSITIVEA product_reference or variant_reference value is not a positive integer.
-
400METAFIELD_VALUE_ID_TOO_LONGA product_reference or variant_reference value exceeds the platform reference ID limit.
-
400METAFIELD_LIST_ITEMS_POSITIVEAn item of a list.product_reference or list.variant_reference value is not a positive integer.
-
400METAFIELD_REFERENCE_PRODUCT_MISSINGA product reference names a product that does not exist in this store.
-
400METAFIELD_REFERENCE_VARIANT_MISSINGA variant reference names a variant that does not exist in this store.
-
404NOT_FOUNDA file reference names a file that does not exist in this store.
-
400INVALID_INPUTA file reference names a file that is not an uploaded file.
Webhook events#
Subscribe to these events when your integration mirrors shop-level values. Each write sends one event per created, updated, or deleted value, after the change commits. Events follow definition access, like every other metafield event.
Store metafield value created
Fired when a store metafield value is created.
Payload fields
| Field | Type | Description |
|---|---|---|
store.name |
string |
Selectable in the Payload builder |
metafield.definition.id |
string |
Selectable in the Payload builder |
metafield.definition.owner_type |
string |
Selectable in the Payload builder |
metafield.definition.namespace |
string |
Selectable in the Payload builder |
metafield.definition.key |
string |
Selectable in the Payload builder |
metafield.definition.name |
string |
Selectable in the Payload builder |
metafield.definition.description |
string |
Selectable in the Payload builder |
metafield.definition.type |
string |
Selectable in the Payload builder |
metafield.definition.is_translatable |
boolean |
Selectable in the Payload builder |
metafield.definition.max_value_length |
integer |
Selectable in the Payload builder |
metafield.definition.max_list_items |
integer |
Selectable in the Payload builder |
metafield.definition.sort_order |
integer |
Selectable in the Payload builder |
metafield.definition.app_id |
string |
Selectable in the Payload builder |
metafield.definition.app_access |
string |
Selectable in the Payload builder |
metafield.definition.merchant_access |
string |
Selectable in the Payload builder |
metafield.definition.created_at |
string |
Selectable in the Payload builder |
metafield.definition.updated_at |
string |
Selectable in the Payload builder |
metafield.definition.usage_count |
integer |
Selectable in the Payload builder |
metafield.value |
string |
Selectable in the Payload builder |
metafield.display_value |
string |
Selectable in the Payload builder |
metafield.display_value_map |
object |
Selectable in the Payload builder |
metafield.created_at |
string |
Selectable in the Payload builder |
metafield.updated_at |
string |
Selectable in the Payload builder |
Store metafield value updated
Fired when a store metafield value changes.
Possible changed_fields values
The changed_fields array names exactly which of these changed in this event — use it to skip processing updates your integration doesn't care about.
value
Payload fields
| Field | Type | Description |
|---|---|---|
store.name |
string |
Selectable in the Payload builder |
previous.definition.id |
string |
Selectable in the Payload builder |
previous.definition.owner_type |
string |
Selectable in the Payload builder |
previous.definition.namespace |
string |
Selectable in the Payload builder |
previous.definition.key |
string |
Selectable in the Payload builder |
previous.definition.name |
string |
Selectable in the Payload builder |
previous.definition.description |
string |
Selectable in the Payload builder |
previous.definition.type |
string |
Selectable in the Payload builder |
previous.definition.is_translatable |
boolean |
Selectable in the Payload builder |
previous.definition.max_value_length |
integer |
Selectable in the Payload builder |
previous.definition.max_list_items |
integer |
Selectable in the Payload builder |
previous.definition.sort_order |
integer |
Selectable in the Payload builder |
previous.definition.app_id |
string |
Selectable in the Payload builder |
previous.definition.app_access |
string |
Selectable in the Payload builder |
previous.definition.merchant_access |
string |
Selectable in the Payload builder |
previous.definition.created_at |
string |
Selectable in the Payload builder |
previous.definition.updated_at |
string |
Selectable in the Payload builder |
previous.definition.usage_count |
integer |
Selectable in the Payload builder |
previous.value |
string |
Selectable in the Payload builder |
previous.display_value |
string |
Selectable in the Payload builder |
previous.display_value_map |
object |
Selectable in the Payload builder |
previous.created_at |
string |
Selectable in the Payload builder |
previous.updated_at |
string |
Selectable in the Payload builder |
current.definition.id |
string |
Selectable in the Payload builder |
current.definition.owner_type |
string |
Selectable in the Payload builder |
current.definition.namespace |
string |
Selectable in the Payload builder |
current.definition.key |
string |
Selectable in the Payload builder |
current.definition.name |
string |
Selectable in the Payload builder |
current.definition.description |
string |
Selectable in the Payload builder |
current.definition.type |
string |
Selectable in the Payload builder |
current.definition.is_translatable |
boolean |
Selectable in the Payload builder |
current.definition.max_value_length |
integer |
Selectable in the Payload builder |
current.definition.max_list_items |
integer |
Selectable in the Payload builder |
current.definition.sort_order |
integer |
Selectable in the Payload builder |
current.definition.app_id |
string |
Selectable in the Payload builder |
current.definition.app_access |
string |
Selectable in the Payload builder |
current.definition.merchant_access |
string |
Selectable in the Payload builder |
current.definition.created_at |
string |
Selectable in the Payload builder |
current.definition.updated_at |
string |
Selectable in the Payload builder |
current.definition.usage_count |
integer |
Selectable in the Payload builder |
current.value |
string |
Selectable in the Payload builder |
current.display_value |
string |
Selectable in the Payload builder |
current.display_value_map |
object |
Selectable in the Payload builder |
current.created_at |
string |
Selectable in the Payload builder |
current.updated_at |
string |
Selectable in the Payload builder |
changed_fields |
array |
Selectable in the Payload builder |
Store metafield value deleted
Fired when a store metafield value is deleted.
Payload fields
| Field | Type | Description |
|---|---|---|
store.name |
string |
Selectable in the Payload builder |
metafield.definition.id |
string |
Selectable in the Payload builder |
metafield.definition.owner_type |
string |
Selectable in the Payload builder |
metafield.definition.namespace |
string |
Selectable in the Payload builder |
metafield.definition.key |
string |
Selectable in the Payload builder |
metafield.definition.name |
string |
Selectable in the Payload builder |
metafield.definition.description |
string |
Selectable in the Payload builder |
metafield.definition.type |
string |
Selectable in the Payload builder |
metafield.definition.is_translatable |
boolean |
Selectable in the Payload builder |
metafield.definition.max_value_length |
integer |
Selectable in the Payload builder |
metafield.definition.max_list_items |
integer |
Selectable in the Payload builder |
metafield.definition.sort_order |
integer |
Selectable in the Payload builder |
metafield.definition.app_id |
string |
Selectable in the Payload builder |
metafield.definition.app_access |
string |
Selectable in the Payload builder |
metafield.definition.merchant_access |
string |
Selectable in the Payload builder |
metafield.definition.created_at |
string |
Selectable in the Payload builder |
metafield.definition.updated_at |
string |
Selectable in the Payload builder |
metafield.definition.usage_count |
integer |
Selectable in the Payload builder |
metafield.value |
string |
Selectable in the Payload builder |
metafield.display_value |
string |
Selectable in the Payload builder |
metafield.display_value_map |
object |
Selectable in the Payload builder |
metafield.created_at |
string |
Selectable in the Payload builder |
metafield.updated_at |
string |
Selectable in the Payload builder |