Interface
CouponManagementInterface
Magento\SalesRule\Api\CouponManagementInterface
What it does
This interface defines the contract for managing coupon codes in Magento 2 shopping cart price rules.
Developers use this to programmatically generate new coupon codes based on specifications, or delete existing coupons either by their IDs or code strings.
It's commonly used in custom modules that need to create promotional coupons or clean up expired/invalid coupon codes in bulk.
Public Methods
- generate()
- deleteByIds()
- deleteByCodes()