OurPay sends webhooks to publicly reachable HTTPS endpoints. During local development, expose your handler through a temporary HTTPS tunnel and register that URL in the sandbox dashboard.

Start your application

Run the application that owns your webhook route. For a Next.js app on port 3000, for example:
Terminal
Your handler might now be available at http://localhost:3000/api/webhook/ourpay.

Open an HTTPS tunnel

Use a tunnel provider such as ngrok:
Terminal
Copy the HTTPS forwarding origin printed by ngrok. If it is https://example.ngrok-free.app, the public webhook URL is:

Register the sandbox endpoint

  1. Open the sandbox organization in the OurPay dashboard.
  2. Go to Settings → Webhooks and add the tunnel URL.
  3. Choose Raw delivery and select the events your handler needs.
  4. Generate or enter a secret and store the same value in your local environment.
Use the TypeScript or Python SDK to verify the exact raw request body with the webhook-id, webhook-timestamp, and webhook-signature headers. Do not parse or reserialize the JSON before signature verification.

Trigger and inspect a delivery

Complete a sandbox checkout or perform another sandbox action that emits one of the selected events. The tunnel inspector and your application logs should show the request and response. Return a 2xx response only after the signature is valid and the event has been accepted for idempotent processing. OurPay can retry a delivery, so store webhook-id with a unique constraint before running fulfillment side effects.
Tunnel URLs usually change when the tunnel restarts. Update or disable the sandbox webhook endpoint afterward so OurPay does not keep retrying an expired URL.