Log in
Model

CouponGenerationSpec

Magento\SalesRule\Model\Data\CouponGenerationSpec

What it does

This data model class defines the specifications for generating coupon codes in Magento 2's Sales Rule system.

Developers use this class when programmatically creating bulk coupon codes, specifying parameters like quantity, format, length, prefix, suffix, and delimiter patterns.

It's typically used with the coupon generation service to create multiple unique promotional codes at once.

Public Methods

  • getRuleId()
  • setRuleId()
  • getFormat()
  • setFormat()
  • getQuantity()
  • setQuantity()
  • getLength()
  • setLength()
  • getPrefix()
  • setPrefix()
  • getSuffix()
  • setSuffix()
  • getDelimiterAtEvery()
  • setDelimiterAtEvery()
  • getDelimiter()
  • setDelimiter()
  • getExtensionAttributes()
  • setExtensionAttributes()