Forums/Community/Community Support

Answered

Issues with the new Coupons API

Yoann CHAUDET
asked this on August 12, 2011 10:57 am

Hi,

I am glade the new Coupons API got released but I am having a few issues with it:
  • As it has been mentioned by other messages on the forum, I cannot find a (good) way to retrieve the coupon code associated (if there is one) to a subscription. Returning the coupon_code as part of a subscription output parameters would be greatly appreciated.
  • If I try to create a coupon without providing a product family id and without having a product family in my site, I get a 500 status code. I know that I am not using the API right, but I would expect a 422 status code (like for the others API).
  • I can associate an archived coupon to a subscription with the add coupon to existing subscription API. After looking carefully it seams that the coupon discount is not applied (no "coupon" transaction is created, and the subscription's balance is correct). On the other hand, I can see that the coupon has been associated to the subscription in the admin site. Maybe this is normal, although in my opinion it shouldn't be possible. A little bit of validation on the API would be great.
  • If I try to associate a non existent coupon to an existing subscription (add coupon to existing subscription API again), I get the following response: [["subscription","Coupon is invalid."]] . I believe all other APIs would return something like that: {"errors":["Coupon is invalid."]}. Could you either document the new format or homogenize it?
  • Finally, the remove coupon from an existing subscription API is documented as using the POST verb. By doing so I always get a 404 status code. After some tests, I found out that the API is actually working with the DELETE verb. The documentation also states that in case of successful removal, the subscription is returned. On my side I just receive a "Coupon removed."  (with a 200 status code). Could you update the documentation so I know how to implement that?
Thanks in advance.

-- Yoann C.