Metafield
Private Metafield API endpoints
Retrieves a paginated list of shop's metadata.
Query parameters
pageoptionalintegerPage number for pagination
per_pageoptionalintegerEntities per page
idsoptionalinteger[]Filter by metadata by IDs. Values must be unique.
slugsoptionalstring[]Filter by metadata by slugs. Values must be unique.
presetoptionalbooleanFilter by metadata preset
variantoptionalbooleanFilter by metadata variant type
sort[field]optionalstringField to sort by. Required whenever any sort key is sent.
Possible values: id, name.
sort[direction]optionalstringSort direction; defaults to asc.
Possible values: asc, desc.
Defaults to "asc".
Returnsobject
Successful response
Request body
nameRequiredstringMetadata name. Must not slugify to a value ending in subbly-variant; that suffix is reserved.
descriptionoptionalstring | nullFreeโform description
multipleoptionalbooleanAllow multiple values. May only be true when data_type is one of single_line_string, integer, decimal, datetime, date, time, volume, weight, color, url. Otherwise the request is rejected.
data_typeRequiredstringData type for the metadata
Possible values: single_line_string, multi_line_text, rich_text, integer, decimal, datetime, date, time, volume, weight, boolean, color, rating, url, money, json.
access_levelRequiredstringWho can see/use this metadata
Possible values: storefront, private.
presetoptionalbooleanValues come from a preset list. May only be true when data_type is one of single_line_string, color, time, integer, rating, decimal, money, volume, weight, date, datetime. Otherwise the request is rejected.
unitoptionalstringUnit label. Required when data_type is volume or weight; prohibited (422) for every other data_type.
save_behavioroptionalstringSave behavior for the metadata. Defaults to subscription.
Possible values: customer, subscription.
editableoptionalbooleanWhether the metadata value is editable by the customer. Defaults to true.
valuesoptionalobject[] | nullList of allowed values (when preset is true)
ReturnsMetadata
Metadata created successfully
Partially updates the metadata and its values by metadata slug. Variant metafields cannot be updated; the request is rejected with 403.
Path parameters
metafield_slugRequiredstringThe unique slug of the metadata to update
Request body
Fields to update on the metadata
nameoptionalstringNew name of the metadata. Must not slugify to a value ending in subbly-variant; that suffix is reserved.
descriptionoptionalstring | nullDetailed description
access_leveloptionalstringAccess scope for the metadata
Possible values: storefront, private.
unitoptionalstringUnit of measurement. Required on every update request when the metafield's data_type is volume or weight (resend the current value if unchanged); prohibited for all other data types.
save_behavioroptionalstringSave behavior for the metadata.
Possible values: customer, subscription.
editableoptionalbooleanWhether the metadata value is editable by the customer.
valuesoptionalobject | nullOperations on preset values
ReturnsMetadata
Metadata updated successfully
Error responses
403anyThe metafield belongs to another shop, or is a variant metafield and therefore not updatable.