Interface
CouponInterface
Magento\SalesRule\Api\Data\CouponInterface
What it does
This interface defines the contract for coupon data objects in Magento 2's sales rule system.
Developers use this to work with coupon codes, including managing coupon properties like usage limits, expiration dates, and tracking how many times a coupon has been used.
It's essential when creating, reading, or updating coupon data programmatically through Magento's API or service layer.
Public Methods
- getCouponId()
- setCouponId()
- getRuleId()
- setRuleId()
- getCode()
- setCode()
- getUsageLimit()
- setUsageLimit()
- getUsagePerCustomer()
- setUsagePerCustomer()
- getTimesUsed()
- setTimesUsed()
- getExpirationDate()
- setExpirationDate()
- getIsPrimary()
- setIsPrimary()
- getCreatedAt()
- setCreatedAt()
- getType()
- setType()
- getExtensionAttributes()
- setExtensionAttributes()