· 4 min · TextMeFlow Team

WhatsApp Payment Confirmations via Mollie Webhooks

Mollie is the payment provider of most Belgian and Dutch webshops, and it sends a webhook to your server for every status change of a payment. Most shops let that signal end at an order status in the database or an internal Slack notification. Forwarding that same signal straight to WhatsApp puts a payment confirmation — or a clear notice about a failed payment — on the customer's screen within seconds, in the channel they already have open.

Why straight from the webhook

You don't need a separate "WhatsApp for Mollie" app or plugin. The Mollie webhook only gives you a payment ID; you fetch the rest with one API call to Mollie itself. A small receiver that passes that result on to TextMeFlow's messages API costs nothing extra on top of your existing message quota, and you stay in control of the text, the triggers and which statuses actually deserve a message.

Step 1: set the webhook URL at Mollie

When you create a payment (via the Payments API or a plugin such as WooCommerce/Mollie), you pass a webhookUrl. Mollie then sends a POST to that URL whenever the payment's status changes — not just on success, but on every change (open, paid, failed, expired, canceled).

curl -X POST https://api.mollie.com/v2/payments \
  -H "Authorization: Bearer live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": {"currency": "EUR", "value": "49.00"},
    "description": "Order #4821",
    "redirectUrl": "https://jouwshop.be/bedankt",
    "webhookUrl": "https://jouwshop.be/webhooks/mollie",
    "metadata": {"customer_phone": "+32470123456"}
  }'

Put the customer's phone number in metadata at the moment you create the payment. Mollie's webhook payload itself doesn't contain a phone number — if you don't pass it here, you'll have nothing to send to when the confirmation is due.

Step 2: receive the webhook and fetch the status

Mollie's webhook body only contains an id — no amount, no status, no customer data. That's not a shortcoming but the whole point: you always fetch the payment from Mollie yourself, so you never rely on something that could have been tampered with in the POST call itself.

app.post('/webhooks/mollie', express.urlencoded({ extended: false }), async (req, res) => {
  const paymentId = req.body.id;
  res.status(200).send('ok'); // acknowledge immediately, process afterwards

  const payment = await mollieClient.payments.get(paymentId);
  const phone = payment.metadata?.customer_phone;
  if (!phone) return;

  if (payment.status === 'paid') {
    await sendPaymentConfirmation(phone, payment);
  } else if (payment.status === 'failed' || payment.status === 'expired') {
    await sendPaymentFailed(phone, payment);
  }
});

Always acknowledge the webhook call with a 200 right away, and do the actual processing — the call to Mollie, the WhatsApp send — afterwards. Mollie only gives you a few seconds and otherwise retries aggressively, which without deduplication leads to duplicate messages.

Step 3: send the WhatsApp confirmation

curl -X POST https://api.textmeflow.eu/v1/messages \
  -H "Authorization: Bearer $TEXTMEFLOW_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+32470123456",
    "text": "Hi Sarah, we received your payment of EUR 49.00 for order #4821. Thanks for your purchase!"
  }'

For a failed or expired payment, keep the tone practical rather than alarming: "your payment didn't go through, click here to pay again" works better than a message that reads like a warning. Need to attach an invoice or payment confirmation as a PDF? The same endpoint accepts attachments up to 100 MB, so it can go in the same call.

Step 4: stay within the anti-spam rules

A payment confirmation is transactional — one personalised message triggered by that customer's own action — and therefore falls outside the broadcast-like triggers of TextMeFlow's anti-spam risk score. Two things still matter, specifically for a Mollie integration:

  1. Deduplicate on payment ID. Mollie can deliver the same webhook several times (after a slow response or a temporary network error). Keep a short cache of processed ids so you never send the same confirmation twice.
  2. Respect STOP. A customer who previously unsubscribed from WhatsApp stays unsubscribed, even if they now make a payment — TextMeFlow refuses messages to unsubscribed numbers, regardless of the trigger.

More than just the confirmation

This pattern isn't limited to the first payment. The same webhook statuses can also be used for a reminder after a failed first payment on a subscription, or a thank-you message on a refund. Because you go straight from Mollie to the messages API, without a third-party layer in between, your customer data stays within the systems you already use — and within TextMeFlow's own EU hosting in Paris.

Start free with TextMeFlow — 50 messages per month, valid for life, enough to test this integration before you move to a paid plan.

Want to send WhatsApp messages via API yourself?

Free forever up to 50 messages/month. Scan a QR and send your first message within 5 minutes.

Free forever