Admin Marketing: Promotions
Bulk-generate coupons for a cart rule
Generates coupon_qty random codes of the given format and length, optionally with prefix/suffix. Inherits usage_limit/usage_per_customer/expired_at from the parent cart rule.
post/marketing/cart-rules/{cartRuleId}/coupons/generate
Request
- Base URLhttp://localhost:8000/api/admin
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
cartRuleIdinteger required
Parent cart rule ID
Request body
Example request
{
"length": 10,
"format": "alphanumeric",
"prefix": "SAVE-",
"suffix": "-2026",
"coupon_qty": 5
}Response
Coupons generated.
Changes
No recorded changes to this operation across all 8 revisions of this API.