Working with Webhooks
This guide explains how to register webhooks, handle incoming webhook events, and understand the custom headers and payloads provided by the Paylane API.1. Registering Webhooks
To receive webhook notifications, register your webhook endpoint via the API. You can subscribe to specific event types. Endpoint:POST /webhooks
Request Example:
cdd_state_changed
: Triggered when the state of a CDD changes to inconclusive or complete.monitoring_alert_fired
: Triggered when a monitoring alert is fired on failure.
2. Receiving Webhooks
When an event occurs, Paylane sends an HTTPS POST request to your registered endpoint.Custom Headers
Each webhook request includes custom headers to help you identify and verify the event:Header | Description |
---|---|
Content-Type | Always application/json |
User-Agent | Sender identifier (e.g., DiligentAI/1.0 ) |
X-Webhook-Id | Unique ID of your webhook |
X-Event-Id | Unique ID of this delivery event |
X-Customer-Id | Your customer ID |
X-Target-type | Entity type (CDD or MONITORING_ALERT ) |
X-Event-Name | Name of the triggered event (CDD_COMPLETED , MONITORING_ALERT_FIRED ) |
X-Signature | HMAC signature for authenticity |
Example Payloads
cdd_state_changed
payload
: Full CDD object (see CDD Object).
monitoring_alert_fired
payload
: Alert object with details about the triggered alert.
3. Webhook Flow Diagram
Below is a simple flow of how a webhook is triggered and received:- Paylane triggers the webhook when an event occurs.
- Your server receives a POST request with custom headers and event payload.
- Your server should process the event and return a 200 OK status to acknowledge receipt.