Black Friday: 79% off every plugin Shop the sale →

REST API

All routes live under /wp-json/smartcouponx/v1/ and require a user with the manage_woocommerce capability (use an application password or cookie authentication with a REST nonce).

RouteMethodParametersReturns
/couponsGETper_page (10), page (1), trigger_type, user_idSmartCouponX coupons with id, code, amount, type, usage, expiry, is_valid, trigger type, user and order IDs
/couponsPOSTcode (optional, generated when empty), description, type (percent, fixed_cart, fixed_product), amount, individual_use, usage_limit, usage_limit_per_user, expiry_dateThe created coupon
/coupons/{id}GET–One coupon
/coupons/{id}PUT/PATCHSame fields as POSTThe updated coupon
/coupons/{id}DELETEforce (false = trash)Deletion result
/analyticsGETstart_date, end_date (Y-m-d), event_typeThe same statistics as the SCX Analytics page
/referralsGETuser_id, per_page (50), page (1)Referral records
/triggersGET–The configured trigger settings

Example:

curl -u admin:APPLICATION_PASSWORD \
  "https://your-store.com/wp-json/smartcouponx/v1/coupons?trigger_type=referral&per_page=20"
Was this article helpful?