Klaviyo WhatsApp Integration: Send Messages from Flows
Klaviyo flows already know exactly when a customer abandoned their cart, placed an order, or went quiet for 60 days — that's the whole point of flow triggers. The messages themselves just go out as email or, on higher plans, Klaviyo SMS. Neither gets opened as fast as WhatsApp. If your store's customers are in a market where WhatsApp is the default channel, routing a flow step to WhatsApp instead of (or alongside) email is a small addition: one webhook action and a receiver that calls the TextMeFlow messages API.
This is a different integration from wiring Shopify or WooCommerce order webhooks directly — here Klaviyo is already doing the segmentation and timing (wait steps, flow filters, A/B splits), and you're just giving it a WhatsApp exit instead of only email/SMS.
Klaviyo's own WhatsApp channel or a webhook to your own number?
Klaviyo has been adding WhatsApp as a native channel, built on Meta's WhatsApp Business Platform. Whether it's available for your account depends on your plan and region — check Klaviyo's own documentation. If it is, it's worth knowing what each route means before you build anything:
| Klaviyo native WhatsApp | Klaviyo webhook → TextMeFlow | |
|---|---|---|
| Sending number | A number registered on the WhatsApp Business Platform | Your existing WhatsApp number, linked by scanning a QR code |
| Message content | Business-initiated messages use Meta-approved templates | The text your receiver builds; no template approval |
| Costs | Klaviyo pricing plus Meta's per-message fees | Your TextMeFlow plan; free for 50 messages a month |
| Setup | Meta business verification and template review | One webhook action and a small receiver |
| Best for | High-volume marketing broadcasts with official Meta tooling | Transactional and flow messages at shop scale, from the number customers already know |
The webhook route is not a way around WhatsApp's rules: you still need opt-in, and TextMeFlow applies rate limits and a risk check to every send so a linked number behaves like a person, not a bulk sender. For a shop sending abandoned-cart and order messages to customers who asked for them, that's rarely a constraint.
Step 1: Add a webhook action to the flow
In Klaviyo, open the flow (Abandoned Cart, Order Confirmation, Win-back, whatever triggers it) and add a Webhook action at the point where you want the WhatsApp message sent — usually replacing or running parallel to an email step. Klaviyo's webhook action lets you:
- Set the endpoint URL (your receiver)
- Choose
POSTandJSONbody - Map profile and event properties into the payload with Klaviyo's templating syntax
Build the payload with just what you need:
{
"phone": "{{ person|lookup:'phone_number' }}",
"first_name": "{{ person|lookup:'first_name' }}",
"cart_url": "{{ event|lookup:'$ecommerce.abandoned_checkout_url' }}",
"cart_total": "{{ event|lookup:'$value' }}"
}
The exact property names depend on which event triggers the flow — check the "Preview" panel in Klaviyo's webhook step to see the real values before going live.
Step 2: Secure the webhook
Klaviyo lets you add custom headers to the webhook action. Add a static bearer token:
Authorization: Bearer <a long random secret you generate yourself>
Your receiver checks that header on every request and rejects anything that doesn't match — this is the only thing stopping someone else from POSTing fake orders at your endpoint, since Klaviyo itself doesn't sign these payloads.
Step 3: Receiver that calls TextMeFlow
<?php
$auth = $_SERVER['HTTP_AUTHORIZATION'] ?? '';
if ($auth !== 'Bearer ' . getenv('KLAVIYO_WEBHOOK_SECRET')) {
http_response_code(401);
exit;
}
$data = json_decode(file_get_contents('php://input'), true);
$phone = trim((string) ($data['phone'] ?? ''));
// TextMeFlow accepts +32 470 12 34 56, 0032470123456 and 32470123456.
// A national number (0470 12 34 56) has no country code: skip it.
if ($phone === '' || preg_match('/^0(?!0)/', $phone)) {
http_response_code(200); // nothing to retry, just skip
exit;
}
$text = sprintf(
"Hi %s, you left something in your cart (%s). Finish your order: %s",
$data['first_name'] ?? 'there',
$data['cart_total'] ?? '',
$data['cart_url'] ?? ''
);
$ch = curl_init('https://api.textmeflow.eu/v1/messages');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('TEXTMEFLOW_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode(['to' => $phone, 'text' => $text]),
CURLOPT_RETURNTRANSFER => true,
]);
curl_exec($ch);
http_response_code(200);
Same shape in Node or Python — see the PHP, Python and Node examples if you want those directly.
Step 4: Phone number format is the main failure point
Klaviyo profiles store phone numbers however the checkout or signup form collected them — with spaces, dashes, a 00 prefix, or sometimes a leading 0 instead of a country code. TextMeFlow cleans up most of that itself: spaces, dashes, dots and brackets are stripped, 0032470… becomes +32470…, and a number that starts with its country code but no + (32470…) gets the + added. What it can't fix is a national number like 0470 12 34 56: without a country code there's no way to know which country it belongs to, so the API answers 422 with "error": "invalid_recipient". Don't try to guess a country code in your receiver — skip those profiles (the receiver above does) and fix the collection form, for example with a country picker on the phone field, instead of papering over it downstream.
Step 5: Don't duplicate what the flow already sends
If the flow still emails too, decide once per flow which channel is primary rather than sending both every time. A common pattern: WhatsApp first (fastest open), with the original email step moved later in the flow as a fallback only for profiles missing a valid phone number — use a flow filter on the phone property to branch.
Mind the opt-in and quiet hours
A Klaviyo profile consenting to email or SMS marketing is not automatically consent for WhatsApp — check what your opt-in form actually asked for before wiring flow messages at any volume (proof of opt-in covers what to keep on file). TextMeFlow also won't deliver outside your account's configured quiet hours by default — a win-back flow that fires at 2am gets queued and sent at a sane hour instead, which is one less thing to build into the flow logic yourself.
FAQ
Does Klaviyo have a webhook action in flows? Yes — that's what this whole setup uses (step 1). You add it like any other flow action, set a URL, headers and a JSON body built from profile and event properties.
Do I need Meta-approved templates for this? Not with TextMeFlow: messages go out from your own linked WhatsApp number, and the text is whatever your receiver builds. You do still need the customer's opt-in for WhatsApp.
Can customers reply to the WhatsApp message? Yes. Replies show up on your phone like any other chat, and you can also receive them at your own endpoint with an inbound webhook, for example to log them back on the Klaviyo profile.
What does it cost to test? Nothing: the free plan includes 50 messages a month with no time limit. Paid plans are on the pricing page.
Start free on TextMeFlow — 50 messages a month, no time limit, enough to wire one Klaviyo flow end to end and see real sends before deciding on 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