Haha, I did something similar a while ago - I just invoked a click() on every "add coupon" button on their website, I didn't want to reverse engineer their APIs - way easier but also it requires a desktop browser with the page open.

I'm not sure if using this API is any different but a few months ago Safeway made a change that only lets you have 20(?) coupons at any time. After you add more it kicks off your oldest one. Which sounds like plenty but if you're adding every single coupon you're gonna get a ton that you have no desire for ($1 off diapers when you don't have a kid etc).

It worked for a while, though!

You can use Selenium to do the same thing in a headless browser, no need for a desktop browser with a page open.

https://www.seleniumhq.org/

In which case you want to probably use their headless Docker containers. https://github.com/SeleniumHQ/docker-selenium

You can also use Puppeteer for this purpose (using headless Chrome) https://github.com/GoogleChrome/puppeteer