Webhooks enable real-time, event-driven communication between Peach's platform and your systems, allowing you to process data only when changes occur. By using webhooks, you can receive instant notifications about important events, reducing unnecessary API calls and server load.
For example, when a loan is created, a webhook can be triggered to send details about the new loan to your system. To start using webhooks, simply configure a webhook endpoint in your environment to receive and process these event notifications as they happen.
- Event Occurrence: An event (e.g., loan approval, payment processing) takes place within Peach's system.
- Notification: Peach sends an HTTP POST request to your specified endpoint with event details.
- Processing: Your server receives and processes the webhook payload. We only wait 30 seconds when sending the event, so ensure your server responds in less than 30 seconds.
- Response: Your server returns a 2xx status code to acknowledge receipt.
Peach implements message authentication using HMAC (Hash-based Message Authentication Code) to ensure the security and integrity of webhook deliveries.
When creating a webhook subscription, Peach automatically generates an hmacSecretKey. This key is returned in the API response within the webhookDirectDetails object:
For each webhook request, Peach:
- Generates a message signature using SHA-256 algorithm
- Includes this signature in the
X-PEACH-HMACrequest header
- Determine the events you want to monitor.
- Configure a publicly accessible HTTPS endpoint on your server to receive webhooks.
- Use Peach's API to create a webhook subscription, specifying the event types and your endpoint URL.
- Implement signature verification on your server to validate incoming webhooks.
- Process the webhook payload and update your system accordingly.
For detailed implementation instructions, refer to our "Creating a Webhook Subscription" and "Managing Subscriptions" guides.
- Create a Subscription — Set up your first webhook subscription via the API.
- Webhook Events — Reference for the event types Peach can send.
- Testing Webhooks — How to verify your handler before pointing it at production traffic.