# About Webhooks

## Overview

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.

## How Webhooks Work in Peach

1. **Event Occurrence**: An event (e.g., loan approval, payment processing) takes place within Peach's system.
2. **Notification**: Peach sends an HTTP POST request to your specified endpoint with event details.
3. **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.
4. **Response**: Your server returns a 2xx status code to acknowledge receipt.


## Security Considerations

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-HMAC` request header


## Setting Up Webhooks

1. Determine the events you want to monitor.
2. Configure a publicly accessible HTTPS endpoint on your server to receive webhooks.
3. Use Peach's API to create a webhook subscription, specifying the event types and your endpoint URL.
4. Implement signature verification on your server to validate incoming webhooks.
5. Process the webhook payload and update your system accordingly.


For detailed implementation instructions, refer to our "Creating a Webhook Subscription" and "Managing Subscriptions" guides.

## See also

- **[Create a Subscription](/developer-tools/webhooks/create-subscription)** — Set up your first webhook subscription via the API.
- **[Webhook Events](/developer-tools/webhooks/webhook-events)** — Reference for the event types Peach can send.
- **[Testing Webhooks](/developer-tools/webhooks/testing-webhooks)** — How to verify your handler before pointing it at production traffic.