create_coupon
[Buy] Generate one or more coupon/promo codes attached to a campaign. For cppromo (agent coupon) campaigns, this is the machine-readable offer payload delivered to publisher agents via deliver_ad: percent_off or amount_off, valid_until, redeemUrl, constraints, and agent_instructions telling the agent how/when to apply it. Also usable for end-user redemption on legacy cpa/cpl/cpi offers.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | percent = percent_off (value 0-100); fixed = amount_off in credits. Default fixed. | |
| count | No | How many codes to generate (default 1). | |
| value | No | percent_off (0-100) or amount_off credits, per type. | |
| prefix | No | ||
| expiresAt | No | ISO 8601 expiry (valid_until), optional. | |
| redeemUrl | No | Where the agent/user redeems the offer, if not auto-applied. | |
| campaignId | Yes | ||
| maxRedemptions | No | Per-code redemption limit (default 1). | |
| constraintsJson | No | Machine-readable eligibility rules, e.g. { allowedSkus, region, minOrderCredits }. | |
| minSpendCredits | No | Minimum spend in credits for the offer to apply. | |
| agentInstructions | No | Plain-language instructions telling the agent how/when to apply this offer. |