WhatsApp Order Notifications for Shopify Using Webhooks
Shopify already fires a webhook for every order event you care about — created, paid, fulfilled, shipped. Most stores wire those into email or SMS and stop there. WhatsApp has far higher open rates than either, and if you're willing to write a small webhook receiver instead of installing a black-box app, you get full control over message timing, content and cost. Here's how to connect Shopify to TextMeFlow directly.
Why skip the app store
A generic "WhatsApp for Shopify" app usually charges per message on top of your WhatsApp API bill and locks you into its own templates. Wiring Shopify's native webhooks straight to the TextMeFlow API costs nothing extra beyond your plan's message quota, and you own the message copy, the trigger logic and the data. If you already send transactional WhatsApp elsewhere in your stack, this keeps everything on one account and one pricing plan instead of paying twice.
Step 1: Register the Shopify webhook
In your Shopify admin, go to Settings → Notifications → Webhooks (or use the Admin API) and subscribe to the events you want to act on:
orders/paid→ order confirmationfulfillments/create→ shipping notification with tracking link
Point each webhook at an endpoint you control, for example https://yourapp.com/webhooks/shopify. Shopify signs every payload with an HMAC header (X-Shopify-Hmac-Sha256) — verify it before trusting the body, the same way you should verify TextMeFlow's own webhook signatures on the way back.
Step 2: Receive the webhook and extract the phone number
A minimal Node receiver:
app.post('/webhooks/shopify', express.raw({ type: 'application/json' }), (req, res) => {
const digest = crypto
.createHmac('sha256', process.env.SHOPIFY_WEBHOOK_SECRET)
.update(req.body)
.digest('base64');
if (digest !== req.headers['x-shopify-hmac-sha256']) {
return res.status(401).send('invalid signature');
}
const order = JSON.parse(req.body);
const phone = order.customer?.default_address?.phone || order.phone;
if (!phone) return res.status(200).send('no phone, skipped');
sendOrderConfirmation(phone, order);
res.status(200).send('ok');
});
Not every Shopify order carries a usable phone number — checkout phone collection has to be enabled in your store settings, and you'll still get orders without one. Skip those gracefully rather than letting a missing field break the webhook response; Shopify retries failed webhooks and a 5xx pile-up on your side will eventually get the subscription disabled.
Step 3: Send through the TextMeFlow API
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, your order #1042 is confirmed — 2 items, total €68.50. We will message you again once it ships."
}'
For the shipping step, use the fulfillments/create payload's tracking_url field to build a second message once the order status flips. Two clean, separate messages read better on WhatsApp than one bloated confirmation trying to cover both events.
Step 4: Keep it inside the anti-spam rules
Order and shipping notifications are transactional, not marketing, so they don't trip the broadcast-style triggers in TextMeFlow's risk scoring — you're sending one personalized message per customer, not identical content to a list. Two things still matter for a Shopify integration specifically:
- Respect STOP. If a customer has opted out via WhatsApp, don't re-add them through checkout order data — TextMeFlow rejects sends to opted-out recipients, and it costs you risk-score points to try.
- Validate the number format. Shopify stores phone numbers in whatever format the customer typed them; normalize to E.164 (
+<countrycode><number>) before calling the API, or the send fails validation.
What this gets you over email
WhatsApp delivery and read receipts arrive back on TextMeFlow's own webhook, so you can log exactly when a customer saw their shipping update — something email opens can't reliably tell you. If you're running the storefront with per-order media (an invoice PDF, a photo of the packed item), the same messages endpoint supports attachments up to 100 MB, so a single call can carry both the text and the invoice.
This same webhook-to-API pattern works for any platform that can fire an outbound webhook on order events — WooCommerce, Lightspeed, a custom cart — Shopify is just the most common starting point. If you're migrating an existing TextMeBot-based order-notification flow, the migration checklist covers the URL and payload differences.
Start free on TextMeFlow — 50 messages a month, no time limit, enough to test a full order-notification flow before you commit to a plan.
Zelf WhatsApp-berichten versturen via API?
Gratis voor altijd tot 50 berichten/maand. QR scannen en binnen 5 minuten verstuur je je eerste bericht.
Gratis voor altijd