Recipe: create a WooCommerce coupon
Use this recipe when the discount policy is already approved. Coupon creation is a catalog write and requires WooCommerce management access plus the WooCommerce MCP write gate.
Inspect existing coupons for an exact code collision. Prepare one coupon with
code [CODE], discount type [TYPE], amount [AMOUNT], description [DESCRIPTION],
usage restrictions [RESTRICTIONS], limits [LIMITS], and expiry [EXPIRY].
Show the exact normalized payload and call wc_create_coupon with dry_run true.
Do not create it until I confirm. After creation, read the coupon back and
report its ID, code, type, amount, expiry, and active restrictions.
Specify a valid WooCommerce discount type and unambiguous dates. Decide explicitly whether free shipping, individual use, product/category restrictions, email restrictions, minimum or maximum spend, and usage limits apply. Omitting a restriction is not the same as setting it to zero.
Safety checks
- Coupon codes should be treated case-insensitively for operational review.
- The amount’s meaning depends on the discount type.
- Expiry and store timezone must be understood before launch.
- Do not include customer email restrictions in screenshots or broad logs.
- Test the coupon in a representative cart before announcing it.
If the dry run or create call fails, inspect current coupons before retrying. A successful response followed by a network interruption may still mean the coupon exists.
Related guides: coupon tools, create coupon reference, and write confirmation.