← Blog

·

Stripe + WhatsApp: payments and subscriptions with the official WhatsApp Business API

Updated on November 10, 2026

To connect Stripe to WhatsApp through the official WhatsApp Business API, you send a Payment Link with the customer or order ID in the client_reference_id parameter, listen to Stripe webhooks (checkout.session.completed for one-time payments; invoice.paid, invoice.payment_failed and invoice.upcoming for subscriptions) and, for each event, send a message or a utility template through the WhatsApp API. Stripe handles the payment and the recurring billing; WhatsApp delivers the notice where your customer actually reads it.

What Stripe does and what’s on you

Stripe doesn’t send WhatsApp messages. It sends emails (receipts, invoice reminders, failed card notices, depending on your account settings) and webhook events. The WhatsApp integration is a service of yours that listens to those events and calls the WhatsApp API.

SituationStripe eventWhatsApp message
Customer paid via Payment Linkcheckout.session.completedOrder confirmation or access granted
Delayed payment confirmed latercheckout.session.async_payment_succeededLate confirmation
Renewal coming upinvoice.upcoming“You’ll be charged in X days” notice
Renewal paidinvoice.paidShort receipt
Card declined on renewalinvoice.payment_failedRequest to update the card
Authentication required (3DS)invoice.payment_action_requiredLink to complete the payment
Trial endingcustomer.subscription.trial_will_endEnd-of-trial notice
Subscription endedcustomer.subscription.deletedCancellation confirmation

invoice.upcoming is sent a few days before renewal, based on the number set under Upcoming renewal events in the Dashboard, and isn’t sent when the subscription uses collection_method=send_invoice. trial_will_end arrives 3 days before the trial ends. All of this is in Using webhooks with subscriptions.

Payment Links with a customer reference

Payment Links are Stripe-hosted payment pages, created in the Dashboard or through the API, for one-time products or subscriptions. The key to the WhatsApp integration is knowing, when the payment arrives, who it belongs to.

According to the URL parameters page, you append client_reference_id to the link:

https://buy.stripe.com/abc123?client_reference_id=wa_14155550123_ord_8841

The value accepts letters, numbers, hyphens and underscores, up to 200 characters, and comes back in the checkout.session.completed event. Invalid values are silently dropped and the link keeps working. Stripe’s docs warn against putting sensitive data in this field, since the link may circulate. So prefer an internal ID (order or customer) that your database maps to the wa_id, rather than the phone number itself.

Another option is collecting the phone number on the page: a Payment Link can require a phone number, set up in customize checkout. The phone appears in the session’s customer details. Stripe recommends only collecting phone numbers when you need them for the transaction, and the opt-in to receive WhatsApp notices should be clear on the page.

Payments that confirm later

If you’ve enabled payment methods like bank debits or vouchers, confirmation can take 2 to 14 days, according to After a payment link payment. In that case, checkout.session.completed arrives before the money: check payment_status on the session and only confirm the order when it’s paid, or wait for checkout.session.async_payment_succeeded.

Want to try it while you read? Create a Vectalk account and send your first message through the official API. Create free account →

The webhook: signatures, speed and duplicates

Stripe’s webhooks documentation sets rules that apply to any integration:

  • Verify the signature. Every event carries the Stripe-Signature header. Use the official library with the raw request body and the endpoint secret (starts with whsec_). If your framework alters the body (parsing JSON before verification), the signature check fails.
  • Return 2xx fast. Respond 200 before any slow logic, such as calling the WhatsApp API.
  • Expect duplicates. The same event can arrive more than once. Store the IDs of processed events.
  • No guaranteed order. invoice.paid may arrive before customer.subscription.created. Don’t depend on sequence.
  • Retries. In live mode, Stripe retries delivery for up to three days with exponential backoff.

Node.js example

The example receives events, verifies the signature and sends the right template. The mapping from Stripe customer to wa_id lives in your database (waIdForCustomer, orderByReference and alreadyProcessed are functions you implement).

import express from "express";
import Stripe from "stripe";

const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
const app = express();

async function template(to, name, params, button) {
  const components = [{ type: "body", parameters: params.map((text) => ({ type: "text", text })) }];
  if (button) components.push({ type: "button", sub_type: "url", index: "0", parameters: [{ type: "text", text: button }] });
  const r = await fetch("https://apis.vectalk.com.br/api/messages", {
    method: "POST",
    headers: { Authorization: `Bearer ${process.env.VECTALK_TOKEN}`, "Content-Type": "application/json" },
    body: JSON.stringify({ messaging_product: "whatsapp", to, type: "template",
      template: { name, language: { code: "en_US" }, components } }),
  });
  return r.json();
}

const money = (cents, cur) => (cents / 100).toLocaleString("en-US", { style: "currency", currency: cur.toUpperCase() });

// express.raw: signature verification needs the raw body
app.post("/webhooks/stripe", express.raw({ type: "application/json" }), async (req, res) => {
  let event;
  try {
    event = stripe.webhooks.constructEvent(req.body, req.get("Stripe-Signature"), process.env.STRIPE_WEBHOOK_SECRET);
  } catch {
    return res.sendStatus(400);
  }
  res.sendStatus(200);

  if (await alreadyProcessed(event.id)) return;
  const obj = event.data.object;

  switch (event.type) {
    case "checkout.session.completed": {
      if (obj.payment_status !== "paid") break; // delayed payment: wait for async_payment_succeeded
      const order = await orderByReference(obj.client_reference_id);
      await template(order.waId, "order_paid", [order.name, order.id]);
      break;
    }
    case "invoice.paid": {
      const to = await waIdForCustomer(obj.customer);
      await template(to, "subscription_renewed", [obj.customer_name || "", money(obj.amount_paid, obj.currency)]);
      break;
    }
    case "invoice.payment_failed": {
      const to = await waIdForCustomer(obj.customer);
      if (!obj.hosted_invoice_url) break;
      const u = new URL(obj.hosted_invoice_url);
      const suffix = u.pathname.slice(1) + u.search; // in the template, the button URL is u.origin + "/{{1}}"
      await template(to, "payment_failed", [obj.customer_name || "", money(obj.amount_due, obj.currency)], suffix);
      break;
    }
  }
});

app.listen(4242);

The payment_failed template’s button points to the Stripe-hosted invoice page (hosted_invoice_url), where the customer can pay with another card. Since a URL button variable only fills in the end of the address, register the fixed base (the invoice domain) in the template and pass the rest, path and query string, as the variable, as the example does; or use a short URL on your own domain that redirects to the invoice. Check the hosted_invoice_url format in your account before creating the template. Dynamic buttons are covered in how to send a WhatsApp template message through the API.

To test without a real card, use stripe listen --forward-to localhost:4242/webhooks/stripe and stripe trigger checkout.session.completed in the Stripe CLI. For the WhatsApp side, see how to test the WhatsApp webhook locally.

Templates: utility, not marketing

Every notice above is about a purchase or subscription the customer made. Without offers, they’re utility. Meta’s template categorization gives an example almost identical to a renewal notice (“your monthly payment for {{service}} will be billed on {{date}}”) as an account alert, and warns that an expiration notice asking the user to renew at a discount is marketing.

TemplateSuggested text
order_paidHi {{1}}. We’ve received payment for order {{2}}. You’ll get the next updates right here.
subscription_renewedHi {{1}}. Your subscription renewal has been paid: {{2}}. The receipt was sent to your email.
payment_failedHi {{1}}. We couldn’t charge {{2}} for your subscription. Tap the button to update your payment method.

If you sell in several countries, create the same template in other languages under the same name; the guide to WhatsApp templates in multiple languages shows how, and lets you pick en_US, pt_BR or es per customer.

What the WhatsApp side costs

Meta charges per delivered message, with rates based on the recipient’s country and the template category. Using Brazil as an example, since October 1, 2026: utility R$ 0.0350 and marketing R$ 0.3217 (Brazilian reais). Utility is charged even inside the customer service window, and each number’s allowance of 1,000 service messages per month doesn’t cover utility. For customers in the US, Europe or elsewhere, rates differ: check WhatsApp API pricing by country and Meta’s pricing page. Stripe fees are separate.

How to do this with Vectalk

Vectalk is a proxy for Meta’s official Cloud API: your service sends the same template JSON as Meta to https://apis.vectalk.com.br/api/messages and receives customer replies on the same webhooks. Templates are created in the dashboard or through the API, and the logs show every send. Billing is prepaid credit, deducted for each delivered message; you don’t add a card at Meta.

Vectalk has no built-in inbox, AI or bulk sending: the notices go out from your backend or an orchestrator like n8n. The fundamentals are in the official WhatsApp API guide, endpoints at docs.vectalk.com.br and sign-up at apps.vectalk.com.br/register.

For the generic sell-by-link flow (Mercado Pago, Asaas and others), see WhatsApp payment links.

Frequently asked questions

Does Stripe have a native WhatsApp integration?

Stripe sends emails and webhook events. WhatsApp messages are sent by a service of yours that listens to those events and calls the WhatsApp Business API, or by an automation tool connected to both sides.

How do I know which WhatsApp customer paid the Payment Link?

Append client_reference_id to the link with an internal ID mapped to the customer’s wa_id. That value comes back in checkout.session.completed.

Which event should I use for renewal reminders?

invoice.upcoming, sent a few days before, based on the number configured in the Dashboard. To confirm a paid renewal, use invoice.paid.

Is a renewal reminder a utility template?

If it only states the date and amount of a charge for something the customer already subscribed to, it’s utility. If it offers a discount or an upgrade to renew, Meta treats it as marketing.


Official sources consulted on November 10, 2026: Payment Links (Stripe), Payment Links URL parameters (Stripe), After a payment link payment (Stripe), Using webhooks with subscriptions (Stripe), Receive Stripe events in your webhook endpoint (Stripe), Template categorization (Meta), WhatsApp platform pricing (Meta), Vectalk documentation.

Put your business on the official WhatsApp

Create your account, connect your number to the official API (you can keep the app with coexistence) and start serving customers and sending messages.