create_promo_code
Create a redeemable discount code for customers to enter at checkout. Attach the code to an existing promo rule.
Instructions
Create a redeemable code under an existing promo rule.
Customers type the code string at checkout to apply the rule's discount. Code matching
is case-insensitive on the Mailchimp side. Use list_promo_codes to discover existing codes
before creating duplicates.
Returns 400 if promo_rule_id does not exist; returns 409 if promo_code_id already exists.
Args: store_id: E-commerce store ID. promo_rule_id: Rule ID to attach the code to. Obtain from list_promo_rules. promo_code_id: Client-supplied unique ID for the code. code: The actual code string customers type at checkout (e.g. 'SUMMER20'). redemption_url: URL where the code can be applied (your checkout page). enabled: Whether the code is active. Default true.
Returns: JSON with id, code, redemption_url, usage_count (0 at creation), enabled, created_at.
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": {
"store_id": "<store_id>",
"promo_rule_id": "<promo_rule_id>",
"promo_code_id": "<promo_code_id>",
"code": "<code>",
"redemption_url": "<redemption_url>"
},
"name": "create_promo_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| account | No | ||
| enabled | No | ||
| store_id | Yes | ||
| promo_code_id | Yes | ||
| promo_rule_id | Yes | ||
| redemption_url | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |