Developers
Signed webhooks for WhatsApp messaging events
Paygham webhooks notify your systems when messages succeed or fail and when WhatsApp connections change—so CRM/POS workflows can branch on real outcomes.
Outgoing callbacks and incoming Event Webhooks
Outgoing webhooks send Paygham message and connection events to your HTTPS endpoint. Incoming Event Webhooks work in the other direction: your application posts a JSON event to Paygham, which maps fields into a message template. They use different authentication contracts. Follow the public Event Webhooks guide for incoming requests.
Verify an outgoing callback
Outgoing callbacks include x-whatsaf-event, x-whatsaf-delivery and x-whatsaf-signature headers. The signature is sha256= followed by an HMAC-SHA256 hex digest of the exact request body, using your webhook secret. Verify the raw bytes with a constant-time comparison before trusting the JSON; reserializing parsed JSON changes the signed input.
Handle retries safely
Persist the delivery identifier and process each event idempotently. Return a 2xx response after durably accepting a valid event, and keep slow CRM work outside the request handler. Failed deliveries can be retried by the webhook queue; do not depend on a fixed retry schedule without checking the current API documentation.
Why webhooks matter
Sending is only half the job. Your business logic needs confirmation. Webhooks push signed events to your endpoint so you can update records, retry, or alert operators.
Example event types
Common events include message.sent, message.failed, whatsapp.connected, and whatsapp.disconnected. Verify signatures before trusting payloads.
Security practice
Treat webhook secrets like credentials. Validate signatures, use HTTPS endpoints, and ignore unsigned or replayed requests.
Frequently asked questions
Does Paygham support WhatsApp webhooks?
Yes. You can register webhook endpoints to receive signed messaging and connection events.
Related
Start automating WhatsApp with Paygham
Connect your number, send from dashboard or API, and keep consent honest.