setMetafield
Attach a metafield to any Shopify resource by specifying the owner ID, namespace, key, and value. Supports custom field types.
Instructions
Set a metafield on a resource
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"ownerId": "<ownerId>",
"namespace": "<namespace>",
"key": "<key>",
"value": "<value>"
},
"name": "setMetafield"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ownerId | Yes | The ID of the resource to attach the metafield to | |
| namespace | Yes | ||
| key | Yes | ||
| value | Yes | ||
| type | No | single_line_text_field |