Start your application
Run the application that owns your webhook route. For a Next.js app on port 3000, for example:Terminal
http://localhost:3000/api/webhook/ourpay.
Open an HTTPS tunnel
Use a tunnel provider such as ngrok:Terminal
https://example.ngrok-free.app, the public webhook URL is:
Register the sandbox endpoint
- Open the sandbox organization in the OurPay dashboard.
- Go to Settings → Webhooks and add the tunnel URL.
- Choose Raw delivery and select the events your handler needs.
- Generate or enter a secret and store the same value in your local environment.
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 a2xx 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.