Event Webhooks

Low-code automation: your system POSTs an event → Paygham fills a template → WhatsApp is sent to the customer.

  1. In the admin, open Event Webhooks and create a webhook (Pro plan).
  2. Copy the webhook URL and secret.
  3. Map the customer phone and write a message template.
  4. Activate, then POST events from your app.

Example request

POST https://api.payghams.com/incoming-webhooks/YOUR_WEBHOOK_ID
Content-Type: application/json
Authorization: Bearer YOUR_SECRET
Idempotency-Key: invoice-42

{
  "event_id": "invoice-42",
  "customer": { "name": "Amina", "phone": "+12025550123" },
  "invoice": { "number": "INV-42", "amount": 123.4 }
}

Template

Hello {{customer_name}}, your invoice {{invoice_number}} for {{amount}} is ready.
  • accepted: true means stored — check Recent events for delivery status.
  • Use a new Idempotency-Key for each unique event.
  • Pro includes Webhook registration (outgoing) and Event Webhooks (incoming → WhatsApp).