Skip to content
New Describe an automation in plain words, and AI builds it for you.
Developers

Recipes: common setups

Ready-made patterns for order updates, website leads, CRM sync and no-code tools.

6 min read Developers

Order shipped message from your store

Order ships In your store
Your code POST /templates/31/send
Customer gets it With a tracking button
  1. Create the template

    Body: Hi {{1}}, your order {{2}} has shipped, plus a Track order button whose link ends in a variable. Get it approved.

    Campaigns Templates

  2. Note its id

    Call GET /templates.

  3. Call the API when the order ships

    From your store's "order shipped" event or hook.

  4. Watch for failures

    Subscribe to the message_failed webhook so a wrong number never goes unnoticed.

Node.js
// Called by your store when an order ships.
async function notifyShipped(order) {
  const res = await fetch('https://flowleb.com/api/v1/templates/31/send', {        // 31 = "order_shipped"
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.FLOWLEB_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      to: order.phone.replace(/\D/g, ''),                     // digits only
      body: [order.firstName, `#${order.number}`],            // {{1}}, {{2}}
      buttons: [{ index: 0, sub_type: 'url', value: String(order.number) }],
    }),
  });
  const json = await res.json();
  if (!res.ok) console.error('WhatsApp not sent', json.error);
  return json.data?.wamid;
}

Website form to WhatsApp follow-up

  1. Build a flow

    Welcome message, a question or two, a reminder the next day. Publish it.

    Automation Flows

  2. On form submit, create the contact

    POST /contacts with name and phone.

  3. Then start the flow

    POST /flows/{id}/enroll with the same phone.

The complete handler is in Start an automation from your app.

Customer replies into your CRM

  1. Add a webhook

    Events: message_received and message_failed.

    Developer Webhooks

  2. Verify the signature

    Use the handler from Webhooks.

  3. Write to your CRM

    Match on the phone number and add the message as an activity.

Node.js
// After verifying the signature (see Webhooks):
switch (event.event) {
  case 'message_received':
    await crm.addActivity({
      phone: event.data.from_number,
      note: `WhatsApp: ${event.data.body}`,
    });
    break;
  case 'message_failed':
    await crm.flag(event.data, 'WhatsApp message failed');
    break;
}

No-code: n8n, Zapier or Make

Any tool with an "HTTP request" or "Webhooks" step can use the API. Fill in the step like this:

Method
POST
URL
https://flowleb.com/api/v1/messages (or any other endpoint)
Header
Authorization = Bearer wsk_your_key
Body type
JSON
Body
{"to": "919876543210", "text": "Hi!"}, using the tool's fields for the values

To go the other way (Flowleb starts your workflow), copy the tool's "catch webhook" address into a Flowleb webhook. Flowleb also has a dedicated n8n page under Developer › n8n.

Still stuck? Ask the team, a person replies by email.