How can I update promotion codes?


#1

Hey,

I need to update the promotion codes for a promotion quite regularly. If a code gets used it needs to be removed. I don’t want to create individual promotions for every code. I tried GETting all codes for a promotion, modifying them and POSTing them to Moltin again but I got a 422 “Duplicate Code” response. PUT is not available.

Is it possible to implement a PUT feature? Or do you have a temporary workaround? Individual promotion codes are really important to my client and the launch is planned ASAP.

Thank you!

Warm regards,
Oscar


#2

Hey Oscar! This is a good point. Will circulate with the team and get back to you.

All the best,
Matt


#3

For the time being I found a workaround.

I can POST an empty “codes” array to /promotions/{id}/codes and then POST the updated one to /promotions/{id}/codes. This won’t result in a 422 “Duplicate Code” error.

I hope I could help anyone!

Warm regards,
Oscar :+1:t2:


#4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.