Custom Coupon Creation and Review/Rating Integration via API or SQL Queries

I’ve noticed that there aren’t any available APIs for the following functionalities:

  1. Creating Custom Coupons
  2. Capturing Reviews/Ratings

While I am aware of add-ons that address some of those needs, I’d like to explore alternative solutions. Specifically:

  • Is it possible to create a way to generate custom coupons via the API?
  • Can I implement a mechanism to capture reviews/ratings programmatically?

Additionally, I am curious if SQL queries can be utilized directly over the CS-Cart database to achieve these functionalities. If so:

  • What would be the recommended approach for safely executing SQL queries within the CS-Cart ecosystem?
  • Are there any best practices or documentation that should be followed for such customizations?

I appreciate any insights, guidance, or examples from the community and CS-Cart experts.

Hi!

Unfortunately, not out of the box.

Yes, of course :slight_smile:

I’d recommend using the standard CS-Cart functions for this. It will be too difficult to make changes via SQL queries in the current promotions architecture. Check the fn_update_promotion function (app/functions/fn.promotions.php) for the details.

Please check this article:
https://docs.cs-cart.com/latest/developer_guide/addons/api_extending.html