The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

Can't Add Coupons via API (Stopped Working)

Occasional Contributor

Can't Add Coupons via API (Stopped Working)

I sent an email to manager Jim Mariano, but thought I would post here as well. 


For some reason, things stopped working in terms of us being able to add EventSpot coupons via the CTCT API. It was working and now it doesn't, and we didn't change anything on our end in terms of how we call the CTCT API.


Example coupon data [from our debug log file - serialized PHP array]:


2015-02-03 16:48:30 Debug: $coupon_data: a:6:{s:9:"code_type";s:8:"DISCOUNT";s:9:"code_name";s:6:"TNCUHW";s:14:"quantity_total";i:-1;s:9:"is_paused";b:0;s:14:"discount_scope";s:11:"ORDER_TOTAL";s:15:"discount_amount";i:50;}
This is the response we get back when trying to add a new coupon via the API:
2015-02-03 16:48:31 Debug: $cc->addCoupon exc: [{"error_key":"json.field.promocode_unpause_depleted_code","error_message":"#/paused: Cannot enable/activate a depleted promo code. Promo code RHONDA has quantity total 1 and quantity used 1"}]
But the coupon we are adding is "TNCUHW" not "RHONDA".
Honored Contributor

Re: Can't Add Coupons via API (Stopped Working)



Based on the info you've provided, there are a couple things that would help us a lot with looking into this:

  1. A sample of the PHP code being used to create the coupon data that is being sent to the addCoupon method
  2. It would also greatly help if you could email us some of the specific detials of this error. This would include account name and event name that you were working on when you ran into this. You can email that info to so that it does not need to be posted publically.

Let us know if there are any other unusual behaviors that you are seeing!



Elijah G.
API Support Engineer
Occasional Contributor

Re: Can't Add Coupons via API (Stopped Working)

Thank you so much Elijah! I will send a detailed email.

Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More