Documentation Index
Fetch the complete documentation index at: https://docs-alpha.pepay.io/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Merchant webhooks deliver canonicalPepayEvent 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 withX-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
2xxuntil event processing is durably queued.
Examples
- If you have multiple endpoints with different secrets, pass a
secretsarray and verify against any. - Use
X-Pepay-Network-Environmentto 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(orX-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.

