iToverDose/Software· 4 JUNE 2026 · 08:01

How a startup cut WhatsApp marketing costs by 60% with a custom cloud app

By replacing a third-party provider with a custom WhatsApp Cloud API integration, a dessert chain’s CTO reduced marketing costs by 60% while maintaining high delivery reliability. Here’s how the system was built and what you can learn.

DEV Community2 min read0 Comments

A dessert chain startup running thousands of WhatsApp marketing messages each month faced an unexpected cost trap. After switching from a third-party CPaaS provider to a custom cloud app built on the WhatsApp Cloud API, the team slashed marketing expenses by 60%—without compromising delivery rates.

The transformation began when the startup’s CTO noticed a hidden inefficiency in their existing setup. While WhatsApp charges only for delivered messages, most third-party integrations bill per sent message, regardless of whether it reaches the recipient. At scale, this discrepancy added up quickly, especially with a 50% delivery failure rate.

The hidden cost of third-party WhatsApp integrations

Traditional WhatsApp marketing services often operate on a "pay-per-send" model, charging businesses for every message dispatched—even if it never reaches the user. For a startup sending 2,000 messages monthly with a 50% delivery success rate, this approach meant paying for 1,000 failed attempts.

In contrast, the WhatsApp Cloud API follows a "pay-per-delivery" model, charging only when a message lands in the user’s inbox. By migrating to a custom solution, the team reduced their cost per message from ₹0.95 (sent) to ₹0.86 (delivered), cutting total monthly expenses from ₹1,900 to just ₹860—a saving of over ₹1,000 without changing their user base or message volume.

Building a scalable system with Supabase, Next.js, and QStash

The new system was designed to handle high-volume messaging efficiently while avoiding the pitfalls of traditional serverless deployments. The architecture relied on three core components:

  • Supabase for real-time user data and message tracking
  • Next.js for the frontend and API layer, deployed on Vercel
  • QStash for asynchronous message batching and queue management

The biggest challenge emerged when broadcasting messages to thousands of users. Vercel’s serverless functions impose a 5-minute execution limit, which made it impossible to send all messages in a single batch. Instead, the team used QStash, a serverless message broker, to split the workload into smaller batches.

Instead of sending one massive request, the system offloads the heavy lifting to QStash, which then triggers multiple smaller requests to the Vercel deployment. Each batch handles about 20 numbers, ensuring no messages are lost due to timeouts or container shutdowns.

Reliable webhook handling with Next.js 15’s after() API

WhatsApp’s real-time status updates are critical for tracking delivery success and user responses. The initial setup used a "fire-and-forget" approach, where the webhook handler would process updates asynchronously. However, Vercel containers sometimes terminated before processing completed, leading to missed updates and unreliable reporting.

To solve this, the team adopted Next.js 15’s `after()` API, which allows background tasks to continue running even after the HTTP response is sent. This change eliminated container timeouts and improved webhook reliability, ensuring every delivery status update was captured accurately.

Beyond cost savings: What other startups should consider

For teams scaling WhatsApp marketing campaigns, a custom cloud-based approach offers more than just cost efficiency. It provides greater control over message delivery, real-time analytics, and the flexibility to adapt to WhatsApp’s evolving policies without relying on third-party constraints.

The key takeaway? Always audit your messaging costs at scale. Third-party integrations can simplify setup, but they may introduce hidden inefficiencies that become costly as your user base grows. A custom solution, while requiring more upfront development, can deliver long-term savings and operational clarity.

AI summary

Üçüncü taraf sağlayıcılara bağımlı kalmadan WhatsApp pazarlama maliyetlerini nasıl düşürebileceğinizi öğrenin. Özel bulut API’si, QStash ve Next.js 15 özellikleriyle tasarruf edin.

Comments

00
LEAVE A COMMENT
ID #6Y01NU

0 / 1200 CHARACTERS

Human check

9 + 2 = ?

Will appear after editor review

Moderation · Spam protection active

No approved comments yet. Be first.