Version: 202201
Update Metafield
PATCH/openapi/2022-01/:resource/:resource_id/metafields/:id
Request
Path Parameters
resource stringrequired
The type of resource that the metafield is attached to. Available resources: shop, product, product_image, product_variant, order, page, customer, collection, blog, article.
resource_id stringrequired
The unique ID of the resource that the metafield is attached to.
id stringrequired
Metafield's ID
- application/json
- Body
- Example
Body
valuestringrequired
The data to store in the metafield.
typestringrequired
The type of data that the metafield stores in the value field.
descriptionstring
A description of the information that the metafield contains.
{
"value": "string",
"type": "string",
"description": "string"
}
Responses
- 200
- 400
- 404
200
- application/json
- Schema
- Example
- Result
Schema
metafield object
idstring
Example:
374050809094090794store_idinteger
Default value:
0Example:
633130created_atstring
Example:
2024-04-28T06:50:19Zupdated_atstring
Example:
2024-04-28T09:33:12.018134337Zowner_resourcestring
Example:
productowner_idstring
Example:
a1a88be0-a1d4-47e4-a2f2-ba6e131cf447namespacestring
Example:
shirtkeystring
Example:
weighttypestring
Example:
weightvaluestring
Example:
30descriptionstring
Example:
definition_idstring
Example:
0{
"metafield": {
"id": "374050809094090794",
"store_id": 633130,
"created_at": "2024-04-28T06:50:19Z",
"updated_at": "2024-04-28T09:33:12.018134337Z",
"owner_resource": "product",
"owner_id": "a1a88be0-a1d4-47e4-a2f2-ba6e131cf447",
"namespace": "shirt",
"key": "weight",
"type": "weight",
"value": "30",
"description": "",
"definition_id": "0"
}
}
{
"metafield": {
"id": "374050809094090794",
"store_id": 633130,
"created_at": "2024-04-28T06:50:19Z",
"updated_at": "2024-04-28T09:33:12.018134337Z",
"owner_resource": "product",
"owner_id": "a1a88be0-a1d4-47e4-a2f2-ba6e131cf447",
"namespace": "shirt",
"key": "weight",
"type": "weight",
"value": "30",
"description": "",
"definition_id": "0"
}
}
400
- text/plain
No schema
404
- text/plain
No schema