developer
Selling on WhatsApp: Dynamic UPI Payment Links in WhatsApp Flows
Learn how to sell on WhatsApp with the WhatsApp Business Cloud API. Generate dynamic UPI payment links, trigger automated webhooks, and close orders 24/7.
With over 500 million active users in India, WhatsApp is no longer just a messaging app: it has evolved into the nation’s primary digital marketplace. Indian consumers routinely inquire about products, request catalog PDFs, and negotiate prices inside WhatsApp chats.
However, closing the sale inside WhatsApp often suffers from severe friction: merchants send manual bank account details or a static QR code image, then wait hours for the buyer to send a payment screenshot. By the time a human agent verifies the screenshot, the customer has moved on.
Here is the architectural guide for implementing an automated WhatsApp Commerce funnel that generates dynamic UPI payment links and confirms orders in real time.
The Explosion of WhatsApp Commerce in India
Conversational commerce converts significantly higher than traditional e-commerce websites because it meets the consumer where they spend their day:
The Friction-Heavy WhatsApp Chat:
Merchant: "Total is ₹1,850. Please transfer to 9876543210@paytm and send screenshot."
Customer: Transfers money, forgets to send screenshot...
Merchant: Discovers payment 24 hours later... (High friction & lost trust)
The Modern Automated WhatsApp Flow:
Customer: Clicks "Order Summer Linen Shirt (Size M)"
Bot: Generates Interactive Message with One-Tap UPI Deep Link
Customer: Taps button ──► Google Pay opens with ₹1,850 pre-filled ──► Approves PIN
Bot (3 seconds later): "✅ Payment Received! Bank UTR: 609415892014. Tracking link sent!"
Why In-App WhatsApp Pay Falls Short for Merchants
Meta introduced native in-app payments (WhatsApp Pay via UPI), but adoption remains constrained:
- Low Consumer Setup: Only a fraction of Indian users have completed bank KYC inside WhatsApp.
- Strict Network Routing: WhatsApp Pay limits transaction routing and does not provide customizable merchant webhook infrastructure.
- Interoperability Friction: If a customer prefers paying via CRED or PhonePe, native WhatsApp Pay cannot launch external intent flows cleanly.
Using interoperable Dynamic UPI intent links guarantees 100% coverage across all Indian smartphone users.
The Dynamic UPI Intent Architecture inside WhatsApp Flows
[WhatsApp Cloud API Webhook]
│ (User selects item in catalog)
▼
[Node.js Conversational Backend]
│
├─ 1. Call VyaparGateway: Create Dynamic Order (₹1,850)
│
▼
[Send Interactive WhatsApp Message via Meta Graph API]
├── Interactive Button: "⚡ Pay ₹1,850 via Any UPI App"
└── URL: `https://pay.vyapargateway.com/intent/ORD-9841`
│
▼ (Customer Taps Link ──► GPay/PhonePe opens)
[Bank Settlement hits Merchant Current Account in Real-Time]
│
▼
[VyaparGateway Webhook fires to Bot Backend]
│
▼
[Send WhatsApp Message: "Order Confirmed! Invoice attached 📄"]
Meta Cloud API & Webhook Implementation (Node.js)
Here is how to ingest WhatsApp incoming messages, generate a direct UPI payment link, and dispatch the interactive button:
import express from "express";
import axios from "axios";
const app = express();
app.use(express.json());
const META_TOKEN = process.env.META_ACCESS_TOKEN!;
const PHONE_NUMBER_ID = process.env.META_PHONE_NUMBER_ID!;
const VYAPAR_API_KEY = process.env.VYAPAR_API_KEY!;
// 1. Handle incoming WhatsApp chat message
app.post("/whatsapp/webhook", async (req, res) => {
const message = req.body.entry?.[0]?.changes?.[0]?.value?.messages?.[0];
if (message && message.type === "text" && message.text.body.toLowerCase().includes("buy")) {
const fromPhone = message.from; // Customer's phone number
// 2. Generate Dynamic UPI Order on VyaparGateway
const orderResponse = await axios.post(
"https://api.vyapargateway.com/v1/orders/create",
{
amount: 1850,
orderId: `WA_${fromPhone}_${Date.now()}`,
customerName: "WhatsApp Shopper",
customerPhone: fromPhone,
orderNote: "WhatsApp Catalog Order #1850"
},
{ headers: { Authorization: `Bearer ${VYAPAR_API_KEY}` } }
);
const paymentUrl = orderResponse.data.checkout_url;
// 3. Send Interactive CTA Button back to WhatsApp
await axios.post(
`https://graph.facebook.com/v21.0/${PHONE_NUMBER_ID}/messages`,
{
messaging_product: "whatsapp",
to: fromPhone,
type: "interactive",
interactive: {
type: "cta_url",
header: { type: "text", text: "🛒 Order Confirmation" },
body: {
text: "Your order for *Summer Linen Shirt (Size M)* is ready for checkout.\nTotal: *₹1,850.00*"
},
action: {
name: "cta_url",
parameters: {
display_text: "⚡ Pay ₹1,850 via UPI",
url: paymentUrl
}
}
}
},
{ headers: { Authorization: `Bearer ${META_TOKEN}` } }
);
}
res.sendStatus(200);
});
// 4. Ingest Bank Payment Confirmation Webhook from VyaparGateway
app.post("/vyapar/webhook", async (req, res) => {
const { status, orderId, utr, amount } = req.body;
if (status === "SUCCESS") {
// Extract customer phone number from orderId
const customerPhone = orderId.split("_")[1];
// Notify customer on WhatsApp instantly
await axios.post(
`https://graph.facebook.com/v21.0/${PHONE_NUMBER_ID}/messages`,
{
messaging_product: "whatsapp",
to: customerPhone,
type: "text",
text: {
body: `✅ *Payment Verified!*\n\nThank you for your order of ₹${amount}.\nBank Reference (UTR): \`${utr}\`\n\nOur warehouse team is preparing your parcel for dispatch.`
}
},
{ headers: { Authorization: `Bearer ${META_TOKEN}` } }
);
}
res.sendStatus(200);
});
Designing the High-Converting WhatsApp Catalog Funnel
To maximize conversion inside WhatsApp Business:
- Eliminate Screenshot Friction: Never ask customers to attach a screenshot of their transaction. Automated webhooks confirm the exact UTR in sub-seconds.
- Keep Amounts Exact: By hardcoding the order amount inside the dynamic UPI link, you prevent customers from typing the wrong bill amount.
- Enjoy 0% Commission: Because the payment bypasses traditional aggregator checkouts, your business retains 100% of sales revenue and receives instant bank settlements on every transaction.
Direct answers
Frequently asked questions
- Can businesses accept UPI payments directly inside WhatsApp chats?
- Yes. By utilizing the official WhatsApp Business Cloud API paired with dynamic UPI payment links from VyaparGateway, chatbots can send interactive messages with one-tap deep links that open Google Pay, PhonePe, or Paytm with the exact cart amount pre-filled.
- Why do Indian merchants prefer dynamic UPI links over WhatsApp Pay?
- WhatsApp Pay requires the customer to have their bank account linked specifically inside WhatsApp. Over 80% of Indian shoppers prefer paying through their primary apps (PhonePe, GPay, Paytm). Dynamic UPI intent links provide 100% interoperability across all UPI apps.
- How does the merchant verify that the customer paid inside the chat?
- When payment succeeds, VyaparGateway receives the direct bank webhook and immediately signals your WhatsApp bot backend, which instantly responds to the customer in the same chat with an official PDF receipt and order confirmation.
Build your payment flow
Explore the API and browser-only merchant tools.
Create UPI checkout orders, verify signed events, or test the free calculators and generators without exposing credentials.