Create metafield definition
POST/openapi/2025-06/metafield_definition/:owner_resource
Create a new metafield definition.
Request
Path Parameters
shop: Shopproduct: Productproduct_image: Product imageproduct_variant: Product variantorder: Orderpage: Custom pagecustomer: Customercollection: Collectionblog: Blogarticle: Articleapp: App
Resource type the metafield definition is attached to:
- application/json
- Body
- Example
Bodyrequired
date: Datedate_time: Date and timeweight: Weightvolume: Volumedimension: Dimensioninteger: Integernumber_decimal: Decimalfile_reference: File referencesingle_line_text_field: Single-line textmulti_line_text_field: Multi-line textjson: JSONcolor: Colorrating: Ratingurl: URLboolean: Boolean (true or false)string: String
A container for a group of metafields. Grouping metafields within a namespace prevents your metafields from conflicting with other metafields with the same key name. For example, "global"
The key of the metafield (unique within the namespace). For example, "color"
A brief description of the metafield definition
Field type of the metafield:
Name of the metafield definition
{
"namespace": "string",
"key": "string",
"description": "string",
"type": "string",
"name": "string"
}
Responses
- 200
OK
- application/json
- Schema
- Example
Schema
shop: Shopproduct: Productproduct_image: Product imageproduct_variant: Product variantorder: Orderpage: Custom pagecustomer: Customercollection: Collectionblog: Blogarticle: Articleapp: Appdate: Datedate_time: Date and timeweight: Weightvolume: Volumedimension: Dimensioninteger: Integernumber_decimal: Decimalfile_reference: File referencesingle_line_text_field: Single-line textmulti_line_text_field: Multi-line textjson: JSONcolor: Colorrating: Ratingurl: URLboolean: Boolean (true or false)string: String
error code
error message
data object
metafield_definition object
The created metafield definition
The unique identifier for the metafield definition
The key of the metafield (unique within the namespace). For example, "color"
Name of the metafield definition (displayed in the admin panel)
A container for a group of metafields. Grouping metafields within a namespace prevents your metafields from conflicting with other metafields with the same key name. For example, "global"
Resource type the metafield definition is attached to:
Field type of the metafield:
A brief description of the metafield definition
Creation timestamp, in ISO-8601 format
Last update timestamp, in ISO-8601 format
{
"code": "string",
"message": "string",
"data": {
"metafield_definition": {
"id": "string",
"key": "string",
"name": "string",
"namespace": "string",
"owner_resource": "string",
"type": "string",
"description": "string",
"create_at": "string",
"updated_at": "string"
}
}
}