{"id":19003987,"date":"2026-08-26T20:56:41","date_gmt":"2026-08-26T20:56:41","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/making-coupons-via-code\/"},"modified":"2026-08-26T20:56:41","modified_gmt":"2026-08-26T20:56:41","slug":"making-coupons-via-code","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/making-coupons-via-code\/","title":{"rendered":"Making coupons via code"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Will devs ever consider being able to make coupons via code like <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$coupon = new WC_Coupon();<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I checked the <a href=\"https:\/\/docs.flycart.org\/en\/articles\/7907342-developer-documentation\">developer docs<\/a> which are only gets and not sets so I am on my knees to be able to make coupon rules via code.<\/p>\n","protected":false},"template":"","class_list":["post-19003987","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19003987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19003987\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19003987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}