Loading
Developers

A clean REST API for WhatsApp

Send templates and replies, manage contacts and templates, start bot flows and receive signed webhooks. JSON in, JSON out, Bearer authentication.

Send your first template

Create an API key in Settings, then call POST /v1/messages. Phone numbers use E.164 format.

curl -X POST https://www.klickkonnect.com/app/api/v1/messages \
  -H "Authorization: Bearer $KLICKKONNECT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+9477XXXXXXX",
    "type": "template",
    "template": {
      "name": "order_confirmation",
      "language": "en",
      "variables": ["Nimali", "NS-20431", "LKR 12,450"]
    }
  }'

Endpoints

POST/v1/messages
Send text, media, buttons, or a template (type field)
GET/v1/messages/{id}
Get a message and its delivery status
GET/v1/templates
List templates with category, language and status
GET/v1/contacts
List contacts, filter by tag or opt-in
POST/v1/contacts
Create or update a contact by phone number
DELETE/v1/contacts/{phone}
Delete a contact and its data
POST/v1/broadcasts
Create a broadcast to a segment
POST/v1/flows/{id}/start
Start a bot flow for a contact
GET/v1/conversations
List inbox conversations
GET/v1/conversations/{id}/messages
Messages in a conversation

Base URL https://www.klickkonnect.com/app/api. Rate limit 600 requests per minute per key. Errors return a code and a readable message.

Webhooks

Signed events for everything that happens

Events: message.received, message.sent, message.status (sent, delivered, read, failed), template.status, conversation.assigned, contact.opted_out. Respond with 200 within 5 seconds; failed deliveries retry with backoff for 24 hours.

POST https://your-site.com/hooks/klickkonnect
X-Klickkonnect-Signature: sha256=5f2b...c91e
X-Klickkonnect-Event: message.received

{
  "event": "message.received",
  "id": "evt_01J9ZK4Q",
  "created_at": "2026-10-06T19:22:41Z",
  "data": {
    "message_id": "msg_7Hc2",
    "from": "+9477XXXXXXX",
    "contact_name": "Nimali Perera",
    "type": "text",
    "text": "Can it come after 6 pm?",
    "conversation_id": "conv_88a1"
  }
}
// Verify the signature (Node / Express)
import crypto from "crypto";

app.post("/hooks/klickkonnect", express.raw({ type: "application/json" }), (req, res) => {
  const expected = "sha256=" + crypto
    .createHmac("sha256", process.env.KLICKKONNECT_WEBHOOK_SECRET)
    .update(req.body)
    .digest("hex");
  const given = req.get("X-Klickkonnect-Signature") || "";
  if (given.length !== expected.length ||
      !crypto.timingSafeEqual(Buffer.from(given), Buffer.from(expected))) {
    return res.sendStatus(401);
  }
  const event = JSON.parse(req.body);
  // handle event.event ...
  res.sendStatus(200);
});
Your own website or shop

Connect a hand-built site in one function

If your shop is custom PHP, Node or any other code, post each order and cart event to your store webhook. Klickkonnect then sends the WhatsApp messages: order confirmed, paid, shipped with a tracking link, out for delivery, delivered, cancelled, refunded, cash on delivery confirmation and abandoned cart reminders. You switch each message on in the app under Commerce, Order messages.

Set up once in the app

  1. Open Commerce, Store, Setup, add a store and choose Custom.
  2. Copy the webhook address https://www.klickkonnect.com/app/ecom.php?s=STORE_TOKEN (the token has 32 characters).
  3. Save a webhook secret and the default country code (for example 94 for Sri Lanka), so local numbers such as 0771234567 work.
  4. Press Create default templates under Order messages and wait for Meta to approve them.
  5. Call the webhook from your code at each step of an order (code on the right).

Request rules

MethodPOST with a JSON body
EventHeader X-Klickkonnect-Event, or an event field in the body
SecretHeader X-Klickkonnect-Secret, or a signature in X-Klickkonnect-Signature: sha256=HEX (HMAC-SHA256 of the raw body)
Always sendid (the same on every event for one order or cart) and phone. Without a phone number no message can be sent.
Other fieldsnumber, name, total, currency, payment_method (cod for cash on delivery), items (name, quantity, price), tracking_url, cart_url
Answers200 saved, 401 wrong secret, 404 wrong token, 403 workspace suspended

Tracking is stored as a link, not a bare number. Point tracking_url at your own tracking page or your courier's public tracking page.

Events

order.createdCustomer places an order. Sends the confirmation, or the COD Confirm / Cancel buttons when payment_method is cod.
order.updatedOrder details changed. Blank phone or name never erases saved values.
order.paidPayment received later (bank transfer, COD collected).
order.shippedCourier collected the parcel. Send tracking_url to include a tracking link.
order.out_for_deliveryCourier is delivering today.
order.deliveredParcel delivered.
order.cancelledOrder cancelled.
order.refundedRefund issued.
cart.abandonedCustomer entered a phone number at checkout and left. Up to three reminders are scheduled.
cart.completedCustomer finished checkout. Stops any remaining reminders.
POST https://www.klickkonnect.com/app/ecom.php?s=STORE_TOKEN
Content-Type: application/json
X-Klickkonnect-Event: order.created
X-Klickkonnect-Secret: YOUR_WEBHOOK_SECRET

{
  "id": "1024",
  "number": "TR-1024",
  "name": "Nimali Perera",
  "phone": "0771234567",
  "total": 18500,
  "currency": "LKR",
  "payment_method": "cod",
  "items": [
    { "name": "Silk saree, ruby", "quantity": 1, "price": 18000 },
    { "name": "Blouse stitching", "quantity": 1, "price": 500 }
  ]
}
<?php
const KK_HOOK = "https://www.klickkonnect.com/app/ecom.php?s=TOKEN";
const KK_SECRET = "PASTE_WEBHOOK_SECRET";

function kk_event(string $event, array $data): bool {
    $body = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
    $ch = curl_init(KK_HOOK);
    curl_setopt_array($ch, [
        CURLOPT_POST => true, CURLOPT_POSTFIELDS => $body,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_CONNECTTIMEOUT => 3, CURLOPT_TIMEOUT => 4,
        CURLOPT_HTTPHEADER => [
            "Content-Type: application/json",
            "X-Klickkonnect-Event: " . $event,
            "X-Klickkonnect-Signature: sha256="
                . hash_hmac("sha256", $body, KK_SECRET),
        ],
    ]);
    $res = curl_exec($ch);
    $code = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    if ($code !== 200) error_log("Klickkonnect $event failed: HTTP $code $res");
    return $code === 200;
}

// When the order is saved:
kk_event("order.created", [
    "id" => "1024", "number" => "TR-1024", "name" => "Nimali Perera",
    "phone" => "0771234567", "total" => 18500, "currency" => "LKR",
    "payment_method" => "cod",
    "items" => [["name" => "Silk saree", "quantity" => 1, "price" => 18500]],
]);

// When the courier has collected the parcel:
kk_event("order.shipped", [
    "id" => "1024", "phone" => "0771234567",
    "tracking_url" => "https://your-shop.com/track?no=TR301026001",
]);

Sending messages yourself from code uses the REST API above, which is included from the Pro plan. A checklist with test steps is in the Help Center guide.

Free tool

WhatsApp chat button and link generator

Works on any website today, with or without a Klickkonnect account. Paste the snippet before the closing body tag.

Any CSS colour, for example #25D366
<!-- WhatsApp chat button -->
<a href="https://wa.me/97450000000?text=Hi!%20I'd%20like%20to%20know%20more." target="_blank" rel="noopener"
   aria-label="Chat with us"
   style="position:fixed;right:20px;bottom:20px;z-index:9999;display:flex;align-items:center;gap:8px;padding:12px 18px 12px 14px;border-radius:999px;background:#25D366;color:#fff;font:600 15px/1 system-ui,sans-serif;text-decoration:none;box-shadow:0 4px 14px rgba(0,0,0,.2)">
  <svg width="22" height="22" viewBox="0 0 24 24" fill="#fff" aria-hidden="true"><path d="M12 2a10 10 0 00-8.6 15.1L2 22l5-1.3A10 10 0 1012 2z"/></svg>
  Chat with us
</a>

Build on WhatsApp with a real API

Pro and Enterprise plans include the REST API, webhooks and a sandbox number.