set_order_metafield
Create or update an order's metafield with specified key, value, and optional namespace and type, using upsert.
Instructions
Create or update an order metafield using metafieldsSet (upsert).
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": {
"order_id": "<order_id>",
"key": "<key>",
"value": "<value>"
},
"name": "set_order_metafield"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order_id | Yes | The numeric Shopify order ID (or GID). | |
| namespace | No | Metafield namespace. | |
| key | Yes | Metafield key. | |
| value | Yes | Metafield value. | |
| type | No | Metafield type (required when creating new). |