---
updatedAt: 2026-05-04T14:40:18.000Z
agentTools:
  projectIndex: https://docs.rainforestpay.com/llms.txt
---

# On-premises webhook integration

Webhook integration patterns for platforms with on-premises software

This guide is for Rainforest platforms running their software inside a private network, with no public inbound HTTPS endpoint available to receive webhooks. It covers three patterns for receiving Rainforest webhooks to an on-prem service.

Details about Rainforest event notifications through webhooks are available at the [Webhooks](https://docs.rainforestpay.com/docs/webhooks-and-notifications) overview, including the retry schedule, signing model, and event structure.

<br />

# Topology for on-prem platforms

***

On-prem instances differ from cloud deployed instances by the ability to expose an inbound HTTPS endpoint to receive webhooks.

<Image align="center" caption="Typical cloud deployments - exposing HTTPS endpoint for notifications" src="https://files.readme.io/29cd7f4e069c2a53ee4a8bc1dc278d3a67005e3765c86e54aa185623c8214a9d-Cloud_Deployment.jpg" />

<Image align="center" caption="Local deployment - No exposed HTTPS endpoint for notifications" src="https://files.readme.io/9465e4df7c44bf6d3398c154e669464b14e1a3f0d5317b8328a08504afd90424-Local_Deployment.jpg" />

<br />

# Receiving webhooks on local infrastructure

***

Receiving real-time event webhooks from Rainforest (such as [payin.processing](https://docs.rainforestpay.com/docs/payin-webhooks#processing) or [deposit.processing](https://docs.rainforestpay.com/docs/deposit-webhooks#processing)) requires a secure bridge to bypass local firewalls or NAT without compromising network security.

## Secure tunnel

This pattern uses a dedicated agent on your local server to create an encrypted outbound tunnel to a gateway. This allows Rainforest to reach your local endpoint without you having to open any inbound ports on your firewall. Typical commercial implementations of this pattern are done with <Anchor label="Cloudflare Tunnel" target="_blank" href="https://developers.cloudflare.com/tunnel/">Cloudflare Tunnel</Anchor> or <Anchor label="ngrok" target="_blank" href="https://ngrok.com/">ngrok</Anchor>.

<Image align="center" src="https://files.readme.io/74176b4d72173cf7159681e5e75156e0ba534cd4e9e2ba77668e80c4bf2e7093-Secure_Tunnel.jpg" />

Note: Ensure your local application still performs a [Webhook Signature Validation](https://docs.rainforestpay.com/docs/webhooks-and-notifications#validate-the-webhook) to ensure the request is originating from Rainforest.

## Reverse proxy

If your merchants manage their own DMZ (Demilitarized Zone), you can use a reverse proxy to filter traffic before it hits your internal network.

<Image align="center" src="https://files.readme.io/145c528089b1c2164b36be8357cf9c939b19a5027a537aa772c8279bacc6aa46-Reverse_Proxy.jpg" />

### Setup

1. Place a Load Balancer or Reverse Proxy (Nginx/HAProxy) in your DMZ.
2. Configure the firewall to allow traffic only from [Rainforest specific IP ranges](https://docs.rainforestpay.com/docs/webhooks-and-notifications#webhook-source-ip-addresses), if possible, and/or strictly validate a custom header (configured in the Rainforest portal) at the proxy level.
3. Forward the traffic from the proxy to the internal application server.

## Rainforest polling - pull mode

In high-compliance or air-gapped environments where inbound traffic is strictly forbidden, a "Pull" pattern is safer. Instead of Rainforest pushing webhook events, the platform pulls from Rainforest.

In the Rainforest Polling pattern, the on-prem service calls the [polling events endpoint](https://docs.rainforestpay.com/docs/polling-events) on a schedule and pulls events directly from Rainforest. This requires only an outbound HTTPS to Rainforest, but you must integrate the polling logic into your platform's software.

<Image align="center" src="https://files.readme.io/91e8c673f3c05a2e76d82d5b81cff9ee39cca0ffaeab8b2f8f224f24e3a50192-Rainforest_Polling.jpg" />

Polling avoids the need to expose an HTTPS endpoint but the tradeoff is delay, since events are only seen on the next poll rather than the moment they occur.

# Security considerations

***

These considerations apply regardless of the pattern selected:

* [Validate the Rainforest webhook signature](https://docs.rainforestpay.com/docs/webhooks-and-notifications#validate-the-webhook) at the final on-prem destination, not only at the cloud or relay edge. A compromised relay otherwise becomes an event injection point.
* Treat the signing key as a secret on par with API keys. Rotate per your standard schedule, store in a secrets manager, and never commit it to source control.
* Pin the four [Rainforest source IPs](https://docs.rainforestpay.com/docs/webhooks-and-notifications#webhook-source-ip-addresses) at the first public hop you control. This drops most spurious traffic before any cryptographic work.
* Use mTLS between the public relay and on-prem if you control both ends. This closes off the path even if the public component is breached.
* Apply idempotency at the component consuming the event (relay or platform). Webhooks are at-least-once, and manual replays from the portal can also redeliver events you have already processed. Use the resource ID and `event_type` as the idempotency key.
* Log every received event with its `event_type`, resource ID, and signature validation result before any processing branch. This is your audit trail when reconciling with the Rainforest portal.