Create metafield
POST/openapi/2026-07/metafields/:owner_resource/:owner_id
Create a metafield for the specified resource.
Request
Path Parameters
shop: Shopproduct: Productproduct_image: Product imageproduct_variant: Product variantorder: Orderpage: Custom pagecustomer: Customercollection: Collectionblog: Blogarticle: Articleapp: App
Resource type the metafield is attached to:
The ID of the resource the metafield 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)
The ID of the associated metafield definition
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"
The value of the metafield; its data type is determined by the type field. For example, { "mediaContentType": "IMAGE", "image": { "path": "6181b00da510ae8cf04673695cecf4c8.jpg", "alt": "", "width": 750, "height": 750, "aspect_ratio": 1, "src": "https://cdn.shoplazza.com/6181b00da510ae8cf04673695cecf4c8.jpg", "size": 775566 } }
Field type of the metafield:
A brief description of the metafield
{
"definition_id": "string",
"namespace": "string",
"key": "string",
"type": "string",
"description": "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 object
The created metafield
The unique identifier for the metafield
The ID of the store that owns the metafield
Resource type the metafield is attached to:
The ID of the resource the metafield is attached to. For example, the product ID
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"
Field type of the metafield:
The value of the metafield; its data type is determined by the type field. For example, "red"
A brief description of the metafield. For example, "The color of the product"
The ID of the associated metafield definition. For example, "123456"
The time when the metafield was created, in ISO-8601 format
The time when the metafield was last updated, in ISO-8601 format
{
"code": "string",
"message": "string",
"data": {
"metafield": {
"id": "string",
"store_id": 0,
"owner_resource": "string",
"owner_id": "string",
"namespace": "string",
"key": "string",
"type": "string",
"description": "string",
"definition_id": 0,
"created_at": "string",
"updated_at": "string"
}
}
}