Skip to main content

Overview

Merchant webhooks deliver canonical PepayEvent payloads to your backend. They mirror the same event types as merchant WebSockets, but are optimized for durable server-side processing.

Authentication

Verify webhook signatures with X-Pepay-Timestamp + X-Pepay-Signature against the raw request body using your webhook secret(s).

Request

Response

Errors

  • Signature mismatch or stale timestamp: return 400.
  • Parsing/handler failures: return non-2xx to request retry.
  • Do not return 2xx until event processing is durably queued.

Examples

  • If you have multiple endpoints with different secrets, pass a secrets array and verify against any.
  • Use X-Pepay-Network-Environment to route devnet vs mainnet secrets if you want strict separation.
  • During rotation, keep the previous secret configured until all endpoints are updated.

Dedupe and retries

  • Delivery is at-least-once, so dedupe by event.id (or X-Pepay-Event-ID).
  • Expect retries on non-2xx responses.
  • Keep handlers idempotent.

Relationship to WebSockets

  • Merchant WebSockets deliver the same event types as merchant webhooks.
  • The WebSocket stream includes replay + REST backfill for reliable realtime consumption.
  • Webhooks remain best for server-side side effects and audit trails.
Next: WebSockets (merchant)