create_discount_code
Set a customer-facing discount code for a price rule. Assigns a code like 'SAVE10' to an existing price rule ID.
Instructions
Set the customer-facing code for a basic GraphQL code discount node.
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": {
"price_rule_id": "<price_rule_id>",
"code": "<code>"
},
"name": "create_discount_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| price_rule_id | Yes | The price rule ID this code belongs to. | |
| code | Yes | The discount code string that customers enter at checkout (e.g. 'SAVE10'). |