Support Coupon Code for Membership Application Non-Admin API
In the Non-Admin API, the "rpc/{accountId}/ApplyForRenewal" call, the API documentation shows that a "Coupon Code" can be submitted as part of the body of the request. The "rpc/{accountId}/applyForMembership" call does not show a "Coupon Code" in the documentation.
Is it supported? If yes, how should the request be formatted? If it is not supported, is there an alternate way to add a discount code to a membership invoice via API?
I have tried the following JSON body. It successfully creates a pending membership with the correct Level, but the discount code is ignored. (no error, it is just ignored). The code is valid and works if I apply for membership in the user interface.
{
"membershipLevelId": 1050822,
"Coupon Code":"CO100"
}
CouponCode is available as a parameter for Membership Application and Renewal.
-
Dave Reed commented
Update... this was fixed in the May 2024 release. The API for /ApplyForMembership now supports coupon codes.
-
Dave Reed commented
Good news and bad news... The most recent version of the Non-Admin API documentation now includes documented support for Coupon Code in the /ApplyForMembership API call. Yeah! Even though no one responded to this in the Forum, I stumbled across the update a week ago.
Bad news... it does not work. Everytime I submit the API request now, I get a 400 error with a message of "Discount code invalid". I'm using the same exact format as the original "idea". The same discount code does work if I use it with the /ApplyForRenewal API call.
I've double-checked the discount code, the contact, the membership level. I've run numerous tests with different variations. I believe this is still a BUG that needs to be resolved.