The Challenges of Managing Promo Codes: A Syntax.fm Case Study
Tags: api, marketing
Published: 2023-08-14 10:04:15

---
title: The Challenges of Managing Promo Codes: A Syntax.fm Case Study
published: true
date: 2023-08-14 09:54:26 UTC
tags: api, marketing
canonical_url: 
---

Developers keep asking me why you need a promo engine when you can implement it yourself in a flash. From now on, I’ll show them this — the last episode of the Syntax podcast, where [@wesbos](https://twitter.com/wesbos) and[@stolinski](https://twitter.com/stolinski) talk about the tech stack for Syntax x [@getsentry](https://twitter.com/getsentry) giveaway campaign.

**The last episode of the Syntax podcast:**

[The Syntax Giveaway Site - Codes, Bots, Tech Stack and More!](https://dev.to/syntax/the-syntax-giveaway-site-codes-bots-tech-stack-and-more)

![Syntax web development podcast](https://cdn-images-1.medium.com/max/752/0*G6hNRiOiUTC8Sic8)

Truth be told, I stumbled upon this episode by accident. Everyday, I inject myself with dopamine by watching “Voucherify” being mentioned all over the internet (thanks [Brand24](https://www.linkedin.com/company/brand24-s-a/)). Not everyday, however, a 350k-followers-strong developer mentions your brand in his podcast.

When it happens, you drop everything you’ve been doing and listen to the whole episode. I did so and the content wasn’t disappointing!

Wes and Scott discuss their recent [giveaway campaign](https://swag.syntax.fm/):

![Syntax and Sentry giveaway campaign](https://cdn-images-1.medium.com/max/815/0*NJum2KeBYrYtMbOo)

They joined Sentry (a top platform btw, we’re using it in Voucherify) and decided to celebrate in the best possible way: by giving people some SWAG.

To get the SWAG, you had to find a promo code sprinkled around the internet to have it redeemed later on a website.

Syntax x Sentry Giveaways is one of these little, short-lived projects where you want to play with a new tech stack and Get Something Done in 2 hours tops. After all, it’s just 700 random codes representing: 600 t-shirts, 50 skate decks and 50 yeti ramblers.

But, even so, it highlights all the challenges with managing promo codes in a nutshell:

- generating unique, hard-to-guess coupon codes — codes should be long enough to be brute-force-proof (to achieve this, Scott used our [free code generator](https://www.voucherify.io/generator), hence the mention)
- managing the code’s state (active, locked, used) and owner — no two users should get the same code (What if Wes and Scott want to publish a bulk of 10 codes at the same time? What if they wanted to release the locked codes 30 minutes before the show? How to make sure a single user gets only one code?)
- supporting multiple promo code types (“premium” / “standard”) — some codes should carry a different deal than others
- fraud protection — the system should be prepared for users who want to exploit it. (Wes claims some agents recruited their home-grown botnets to get the priceless SWAG 🤯. This caused a massive traffic spike (~1.6m requests), so Wes had to react in real-time by rolling out an in-memory cache to filter out malicious requests.)

In the end, a 2-hour-tops project turned into a few days of work for seasoned developers, a series of hotfixes to production, and significant traffic in the cloud.

![Challenges with managing promo codes](https://cdn-images-1.medium.com/max/1024/0*rTULyXhi5zLmipUt)

I recommend listening to the whole [podcast](https://dev.to/syntax/the-syntax-giveaway-site-codes-bots-tech-stack-and-more) to get the full picture and some tasty insights on the tech stack Wes and Scott have chosen for the project ([Vercel](https://www.linkedin.com/company/vercel/), Svetle, [Prisma](https://www.linkedin.com/company/prisma-io/), [PlanetScale](https://www.linkedin.com/company/planetscale/), [Sentry (sentry.io)](https://www.linkedin.com/company/getsentry/).

Compared to a regular ecommerce campaign, it’s just a tiny, one-off marketing campaign. If Syntax.fm would like to scale it in future, the number of challenges would increase proportionally. At least, this is what we’ve seen when working with customers over the years.

At Voucherify, we’ve been building an API-first promotion engine to help devs overcome these issues with just a few lines of codes (or 2 hours tops 🙃). We also wanted to give teams an admin panel to control promo codes without committing to prod for every business change. Finally, Voucherify is ready for scale and fraud — we handle millions of code validations a day, we can rate-limit requests from a given IP address, you can stop a campaign when you hit your targets, and many more.