Log inStart Free Trial
Meta Tech Provider

Answer WhatsApp customers with live data: prices, stock and availability from your system

To answer WhatsApp questions about prices, stock or availability with current figures, pass the customer's message to your own system the moment it arrives, look the value up there, and return the reply text. An automation's webhook step does this: it POSTs the message and the customer's number, and a JSON answer with a reply field, returned within 20 seconds, goes out as the WhatsApp reply.

easyCoexistence connects the WhatsApp Business number you keep in the app to Meta's Cloud API through Coexistence and runs automations on it.

20 s

How long the Call my webhook step waits for your system's answer before the step fails.

10

Recent messages of the chat sent with the request, oldest first, so a follow-up question keeps its context.

4,096

Characters of a reply sent as one WhatsApp text; longer text is cut.

https only

Webhook URLs must be public HTTPS; http and private addresses are refused, and redirects are not followed.

24 hours

Window after the customer's last message in which Meta accepts free-form replies; a fresh question opens it.

How does a live-data reply work?

One automation picks the message, usually a keyword automation for price or stock words. Its Call my webhook step POSTs the message, the customer's number and the recent chat to your URL, signed with the automation's own secret. Your code reads the value, then answers HTTP 200 with a JSON body such as {"reply": "Sourdough loaf: US$ 6.50, 14 left today."}. easyCoexistence checks the 24-hour window and sends that text from your number.

Before your system is called, the run has passed the built-in guards: Meta's repeated deliveries never start a second run, and a chat you answered from the phone is left alone for 4 hours by default. The reply also appears in the app's chat thread, so whoever holds the phone sees what the customer was told.

1Customer asks"Do you have the blue one in size M?"
2Has keywordstock, available, price, preço, precio...
3Call my webhookSigned POST with the text and the customer's number
4Your systemReads stock now, answers {"reply": "..."}
5Reply sentWithin 20 seconds, also visible in the app

Why not keep prices and stock in a fixed reply or the AI's Instructions?

A fixed reply is written once, and the Reply with AI step writes from two sources only: its Instructions and the recent chat. Neither changes when a product sells out or a slot is booked. The AI step is also told, under your instructions, never to invent prices, stock, dates or policies it cannot see, so a question about today's stock gets a polite hand-off instead of a number.

Figures that move during the day belong in the system that already holds them: the store, the spreadsheet, the booking calendar or the ERP. The Call my webhook step lets that system answer the customer directly, with the value it has at that second, from the WhatsApp Business number the team keeps using in the app.

Which questions should go to your system?

The ones whose answer changes faster than you would edit a text. Route them with a Has keyword trigger in Contains mode, up to 30 words, in each language you serve. Keyword automations are checked before First message, After hours and the catch-all, and only one automation answers a message, so an AI assistant on the catch-all keeps the other questions. Contains matches inside words, so prefer whole terms over short fragments:

  • Prices: price, how much, price list, preço, quanto custa, precio, cuánto cuesta.
  • Stock: stock, available, in store, estoque, disponível, disponible.
  • Free slots: appointment, slot, table for, horário, vaga, una cita, mesa para.
  • Delivery fee or area by postcode: delivery fee, frete, taxa de entrega, envío, código postal.
  • Today's status: open today, holiday, aberto hoje, feriado, abierto hoy.

What does your system receive and return?

A JSON POST with the header X-EC-Event set to automation.step. The fields a lookup needs are message.text, where the product name or code appears, and contact.wa_id, the customer's number in international digits without the plus sign, useful for prices per customer group or a saved cart. history holds up to 10 recent messages, so "and in red?" can be read against the previous question. A test from Try it sends dry_run true with an empty history.

Answer HTTP 200 with a top-level string named reply. An empty or missing reply sends nothing and the run moves on to any later step. A status outside 2xx, a redirect or silence past 20 seconds fails the step. The n8n agent page shows the complete body.

Request (trimmed) and the answer your system returns
POST https://shop.example/whatsapp/live
X-EC-Event: automation.step
X-EC-Signature: t=1762869731,v1=5f0c...

{
  "event": "automation.step",
  "dry_run": false,
  "contact": { "id": "5511987654321", "wa_id": "5511987654321", "name": "Ana Souza" },
  "message": { "id": "wamid.HBgN...", "type": "text", "text": "Is the linen shirt in size M available?", "at": "2026-11-11T14:02:11.000Z" },
  "history": [ ...up to 10 recent messages, oldest first... ]
}

HTTP 200, within 20 seconds:
{ "reply": "Linen shirt, size M: 3 left, US$ 42. Want me to hold one for you until 6 pm?" }

How do you build the endpoint in Node.js?

Read the body as raw text, verify X-EC-Signature against it, then parse. The header is t=<unix seconds>,v1=<hex>, where v1 is an HMAC-SHA256 of t, a dot and the body, keyed with the whole whsec_ Signing secret of the automation. Reject a t more than 5 minutes from your clock and compare in constant time.

Then do one fast lookup: a database query, a cached call to your store's API, or a read from a price list kept in memory. Race it against a timer, so that a slow database still produces a friendly line before the 20-second limit instead of a failed run. When nothing matches, ask for the product's name or code rather than guessing.

Express endpoint for a Call my webhook step: live price and stock
import express from "express";
import crypto from "node:crypto";

const SECRET = process.env.EC_SIGNING_SECRET; // the automation's Signing secret, from its editor page

function signed(req) {
  const m = /^t=(\d+),v1=([0-9a-f]{64})$/.exec(req.get("X-EC-Signature") || "");
  if (!m || Math.abs(Date.now() / 1000 - Number(m[1])) > 300) return false;
  const mac = crypto.createHmac("sha256", SECRET).update(m[1] + "." + req.body).digest();
  return crypto.timingSafeEqual(mac, Buffer.from(m[2], "hex"));
}

const app = express();
app.post("/whatsapp/live", express.text({ type: "application/json" }), async (req, res) => {
  if (!signed(req)) return res.status(401).end();
  const { message } = JSON.parse(req.body);

  // Answer before the 20-second limit whatever happens: a slow lookup gets a fallback at 15 s.
  const late = new Promise((r) => setTimeout(() => r("late"), 15000));
  const item = await Promise.race([findProduct(message.text), late]); // your SQL, API or cache

  if (item === "late") return res.json({ reply: "Let me check that for you. A person will reply here shortly." });
  if (!item) return res.json({ reply: "Which product do you mean? Send its name or code and I will look it up." });
  const stock = item.stock > 0 ? item.stock + " in stock" : "out of stock today";
  res.json({ reply: item.name + ": " + item.price + ", " + stock + "." });
});

app.listen(3000);

Can a model write the answer from the live data?

Yes, behind the webhook. Your endpoint, or an n8n workflow with an AI Agent node, fetches the figures first, through a query or a tool, and asks your model to phrase the answer with them: "Customer asked X. Current stock: Y. Reply in one or two sentences, in the customer's language." The reply field then carries the model's text. The Reply with AI step on its own has no tools and no browsing, so this is the route for answers that mix wording with data.

Keep the whole round trip, lookup plus model call, well under 20 seconds. Ask the model for a short answer, pick a fast model, and keep the timer fallback in place for the day the provider is slow.

What are the limits of a webhook reply?

The webhook reply is plain text sent once, which covers most price, stock and availability answers. Anything richer goes out through Meta's Cloud API, sent by your own system. The points to plan for:

  • Text only, up to 4,096 characters, no markdown. Images, buttons or templates: send them from your system with the send endpoint from get_api_credentials and return no reply.
  • One attempt, no retry. A timeout or error marks the run Failed and emails you, at most once per automation every 6 hours.
  • A reply step placed after the webhook also sends, so the customer would get two messages.
  • Free-form replies go out only within 24 hours of the customer's last message; a Wait step before the webhook can push past it.

How to set it up

  1. Expose the lookupPublish an HTTPS endpoint or an n8n workflow that verifies X-EC-Signature, reads message.text and contact.wa_id, and returns {"reply": "..."}.
  2. Create the automation, switched OffIn Automations, click New automation, pick Send to my system under Start from an example, change the trigger to Has keyword with your price or stock words, paste the URL into Webhook URL, set the switch to Off and click Save.
  3. Copy the Signing secretSelect the Call my webhook step of the saved automation and copy Signing secret into your endpoint's settings.
  4. Try a real questionClick Test, type a question such as "Is the linen shirt in size M available?" in Try it and press Run test. Your system really runs with dry_run true; the result shows the reply.
  5. Switch it OnWhen the reply reads right, set the switch to On and save. Send a question from another phone and open the run under Runs to see the timing.

Common mistakes

  • Pasting prices into the AI Instructions and forgetting them. The model quotes last month's figures with confidence; keep moving numbers in your system and let the webhook read them.
  • Running a slow report inside the request. Past 20 seconds the step fails and nothing is sent; query an index or a cache, and answer a fallback line at 15 seconds.
  • Adding a Reply with text step after the webhook as a safety net. It runs after a successful reply too, so customers get two messages; put fallback texts in your endpoint.
  • Using short keyword fragments such as "tem" or "cost". Contains matches inside words, so item, temperature or costume start the lookup; use whole terms and test them in Try it.
Doing this with EasyCoexistence

A Call my webhook step brings your own system into the chat: it sends the question, signed, and delivers the answer your system returns, with dedupe, the pause when you reply from the phone and the 24-hour check built in, at no extra charge per run. US$ 9 down to US$ 0.75 per number per month, falling as you add numbers, with the first 3 days free.

easyCoexistence is a multichannel API and MCP server that connects AI agents such as Claude and ChatGPT to WhatsApp, Instagram, TikTok, Facebook and more. On WhatsApp it uses Coexistence: the business keeps using its number in the WhatsApp Business app while the AI works through Meta's official API.

Frequently asked questions

Can a Google Sheet be the price list?

Yes. An n8n workflow can look the product up in the sheet with a Google Sheets node, then return the row's price and stock as the reply. Google limits reads per minute per user, so for busy numbers cache the sheet in the workflow or in your backend and refresh it every few minutes.

Does my system need to be online around the clock?

For this automation, yes: a request that fails or times out marks the run Failed, sends nothing and emails you. Point a second, lower-priority automation such as an AI assistant on the catch-all at the other questions, and keep the endpoint's own fallback line for slow moments.

Can ChatGPT or Claude set this automation up for me?

Yes. With the easyCoexistence connector, ask for a keyword automation on your number that calls your URL; the AI uses create_automation with a call_webhook step, then test_automation. The Signing secret is not returned through MCP, so copy it from the automation's page in the dashboard.

Do live-data replies cost extra?

Not from easyCoexistence: automations have no per-run charge and no run cap. Meta bills messages to the business's own WhatsApp Business Account, per message, by category and country, and easyCoexistence never marks them up. Your server or workflow tool costs what it costs today.

Keep reading

Ready to get started?

Set up WhatsApp Coexistence in minutes, not months. The app keeps working on the phone.

Start Free Trial

Verified on