API reference

WHMCS webhook (legacy)

POST /api/v1/whmcs-webhook — the legacy WHMCS event receiver. Use the new WHMCS addon instead.

POST/api/v1/whmcs-webhook

It receives event data from WHMCS and sends a WhatsApp notification to the client from the default connected number on your account.

Headers

Header Value
X-API-Key Your key (or Authorization: Bearer <key>)
Content-Type application/json

Request body

Field Type Required Description
action string Yes InvoiceCreated, InvoicePaid or TicketOpen
phone string Yes Client number (phonenumber is accepted as an alias)
client_name string No Client name
invoiceid string For invoice events Invoice number
amount string No Invoice amount
currency string No Currency
due_date string No Due date
invoice_url string No Invoice link
ticketid string For TicketOpen Ticket number
subject string No Ticket subject
ticket_url string No Ticket link
lang string No Message language: ar (default) or en (english, en_US … are accepted)

Text values are truncated to 500 characters.

Response

200 OK

JSON
{ "success": true, "sent": true, "message_id": "wamid.HBgM..." }

When there is nothing to send (no phone number, or an unsupported action) the response is 200 with "sent": false and a reason. A failed send is reported as an error (below), not as success.

Errors

Status Response
401 {"error": "Invalid API key"}
403 Recipient opted out / blocked, plan limit (code), or plan_no_api / permission_denied
422 {"success": false, "sent": false, "code": "outside_window", ...} — the client is outside the 24-hour window
429 {"error": "Too many requests", ...}
502 {"success": false, "sent": false, "code": "send_failed" | "no_instance", "error": "..."}

Examples

curl -X POST https://waabek.com/api/v1/whmcs-webhook \
  -H "X-API-Key: $WABEK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "InvoicePaid",
    "invoiceid": "1042",
    "phone": "966500000000",
    "client_name": "Sara Ahmed",
    "amount": "99.00",
    "currency": "USD"
  }'