Title: Making coupons via code
Last modified: August 26, 2026

---

# Making coupons via code

 *  [Rasetsukoku](https://wordpress.org/support/users/rasetsukoku/)
 * (@rasetsukoku)
 * [3 weeks, 1 day ago](https://wordpress.org/support/topic/making-coupons-via-code/)
 * Will devs ever consider being able to make coupons via code like
 *     ```wp-block-code
       $coupon = new WC_Coupon();
       ```
   
 * The Pro version bundle discounts has been the lifeblood of my store, and I would
   love to be able to handle making coupons automatically in PHP vs having to do
   everything in the GUI.
 * I checked the [developer docs](https://docs.flycart.org/en/articles/7907342-developer-documentation)
   which are only gets and not sets so I am on my knees to be able to make coupon
   rules via code.

Viewing 1 replies (of 1 total)

 *  Plugin Support [akshayathangaraj](https://wordpress.org/support/users/akshayathangaraj/)
 * (@akshayathangaraj)
 * [1 week, 1 day ago](https://wordpress.org/support/topic/making-coupons-via-code/#post-19016588)
 * Hi,
 * Thank you for sharing your requirement and the details.
 * Could you please create a support ticket with our team so we can review this 
   request in detail and check it with our developers?
 * You can submit the ticket here: [https://www.flycart.org/support](https://www.flycart.org/support)
 * Please include your use case and the code-based coupon functionality you’re looking
   for.
 * Regards,
 * Flycart support team.

Viewing 1 replies (of 1 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fmaking-coupons-via-code%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/woo-discount-rules/assets/icon-256x256.png?rev=1977982)
 * [Discount Rules for WooCommerce](https://wordpress.org/plugins/woo-discount-rules/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-discount-rules/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-discount-rules/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-discount-rules/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-discount-rules/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-discount-rules/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [akshayathangaraj](https://wordpress.org/support/users/akshayathangaraj/)
 * Last activity: [1 week, 1 day ago](https://wordpress.org/support/topic/making-coupons-via-code/#post-19016588)
 * Status: not a support question