promotion.code.add
Add a coupon code to a promotion (N codes per promotion, each with its own usage ceiling).
- Scope:
promotion.write - System: no
- Reachable from:
POST /v1/commands/promotion.code.add(tenant credential) · MCP toolpromotion.code.add· SDKclient.call('promotion.code.add', …) - Events:
promotion.updated
Input (JSON Schema)
Section titled “Input (JSON Schema)”{ "properties": { "code": { "maxLength": 64, "minLength": 3, "pattern": "^[A-Za-z0-9._-]+$", "type": "string" }, "promotion_id": { "minLength": 1, "type": "string" }, "usage_limit": { "anyOf": [ { "exclusiveMinimum": 0, "maximum": 9007199254740991, "type": "integer" }, { "type": "null" } ] } }, "required": [ "promotion_id", "code" ], "type": "object"}Result (200)
Section titled “Result (200)”{ "additionalProperties": false, "properties": { "code_id": { "type": "string" } }, "required": [ "code_id" ], "type": "object"}Errors
Section titled “Errors”validation_failed (400) · unauthorized (401) · forbidden (403) · conflict (409) · internal (500)