Webhook Guide

PayPal Guides de test webhook

Payment event webhooks and simulator testing

Chemin rapide : commandes helper CLI

Use these first to avoid setup mistakes, then follow the full provider steps below.

instatunnel webhook init --provider paypal --port 3000 --path /webhooks/paypal
instatunnel webhook verify --provider paypal --secret-env PAYPAL_WEBHOOK_ID
instatunnel webhook test --provider paypal

If you run into provider-specific issues, use the full checklist sections below.

For cross-provider MCP + webhook diagnostics, open /docs/troubleshooting.

Replay + helper signature (dashboard)

Open /dashboard or /dashboard/tunnels and use Webhook Command Center for this provider. It gives one-click replay and signature verification helpers.

instatunnel webhook verify --provider paypal --secret-env PAYPAL_WEBHOOK_ID
curl -i -X POST "https://YOUR-SUBDOMAIN.instatunnel.my/webhooks/paypal" -H "Content-Type: application/json" --data-binary @sample-paypal.json

Required signature header: paypal-transmission-sig (plus transmission metadata headers)

1. Setup app locale

Create a local webhook endpoint at: /webhooks/paypal

import express from 'express'

const app = express()
app.use(express.json())

app.post('/webhooks/paypal', async (req, res) => {
  // 1) Capture PayPal transmission headers
  // 2) POST to /v1/notifications/verify-webhook-signature with your webhook_id
  // 3) Accept event only when verification_status === 'SUCCESS'
  console.log('paypal event:', req.body.event_type)
  res.status(200).send('ok')
})

app.listen(3000, () => console.log('listening on :3000'))

2. Lancer InstaTunnel

instatunnel 3000 --subdomain paypal-dev

Keep a fixed subdomain so your provider dashboard URL does not keep changing.

3. Champs provider a coller

FieldValueWhere/notes
Webhook URL{{WEBHOOK_URL}}PayPal Developer Dashboard > Webhooks
EventsPAYMENT.CAPTURE.COMPLETED (example)Subscribe to only required event types
Webhook IDWH-...Store as PAYPAL_WEBHOOK_ID for signature verification calls
EnvironmentSandbox firstUse simulator in sandbox before production

Use the helper below to generate exact values with your chosen subdomain and path.

Assistant setup webhook en un clic

Genere commande tunnel, URL webhook et valeurs provider pretes a coller.

Lancer InstaTunnel

instatunnel 3000 --subdomain paypal-dev

URL webhook

https://paypal-dev.instatunnel.my/webhooks/paypal
Champ providerValeur a collerNotes
Webhook URL
https://paypal-dev.instatunnel.my/webhooks/paypal
PayPal Developer Dashboard > Webhooks
Events
PAYMENT.CAPTURE.COMPLETED (example)
Subscribe to only required event types
Webhook ID
WH-...
Store as PAYPAL_WEBHOOK_ID for signature verification calls
Environment
Sandbox first
Use simulator in sandbox before production

Astuce : gardez un sous-domaine stable par provider pour eviter la reconfiguration.

4. Envoyer un evenement de test

  1. Use PayPal Webhook Simulator in sandbox to send test events.
  2. Validate your endpoint returns 200 and event body is parsed.
  3. For simulator events, self-verify with your webhook ID. For real events, call verify-webhook-signature and require verification_status=SUCCESS.

5. Verifier la signature

Verify this header on every request: paypal-transmission-sig (plus transmission metadata headers)

// Send verification request to PayPal API
POST /v1/notifications/verify-webhook-signature
{
  transmission_id,
  transmission_time,
  cert_url,
  auth_algo,
  transmission_sig,
  webhook_id: process.env.PAYPAL_WEBHOOK_ID,
  webhook_event: req.body
}
// accept only when verification_status === "SUCCESS"

6. Retrys et idempotence

  • Use PayPal event ID as idempotency key.
  • Respond quickly with 200 after enqueueing background processing.
  • Treat all webhook deliveries as at-least-once and replay-safe.

7. Echecs courants et corrections rapides

Verification status not SUCCESS

Check webhook ID/environment mismatch and transmission headers.

Simulator event not received

Confirm sandbox app uses current tunnel URL and active webhook subscription.

Simulator verification confusion

Simulator mock events cannot be verified via verify-webhook-signature endpoint; use real events for API verification tests.

Duplicate processing

Deduplicate by event ID before writing side effects.

PayPal Guides de test webhook | InstaTunnel