Skip to main content

Webhooks

Webhooks allow you to receive real-time notifications when events occur in your ZKP2P Pay integration.

How Webhooks Work

When an event occurs (like a payment being fulfilled), ZKP2P Pay sends an HTTP POST request to your configured webhook URL with details about the event.

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│ Payment │ │ ZKP2P Pay │ │ Your Server │
│ Event │────>│ Webhook │────>│ Endpoint │
│ │ │ Delivery │ │ │
└─────────────┘ └─────────────┘ └─────────────┘

Available Events

Event TypeDescription
order.createdOrder created and intent signaled on-chain
order.payment_sentUser marked payment as sent
order.fulfilledPayment verified and USDC transferred
order.failedPayment verification or fulfillment failed
order.expiredOrder expired before completion
session.startedCheckout session started by user
session.completedCheckout session completed successfully
session.abandonedUser abandoned the checkout

See Events for detailed information on each event.

Webhook Security

All webhooks are signed using HMAC-SHA256. You should verify the signature before processing any webhook to ensure it came from ZKP2P Pay.

Headers included with each webhook:

HeaderDescription
X-Webhook-IdUnique event ID (for idempotency)
X-Webhook-TimestampUnix timestamp when the webhook was sent
X-Webhook-SignatureHMAC-SHA256 signature of the payload

See Verification for implementation details.

Retry Policy

If your endpoint doesn't respond with a 2xx status code, ZKP2P Pay will retry the webhook with exponential backoff:

AttemptDelay
1Immediate
21 minute
35 minutes
430 minutes
52 hours
68 hours
724 hours
8Final attempt

After 8 failed attempts, the webhook is marked as failed.

Quick Start

  1. Set up a webhook via the API
  2. Handle events in your endpoint
  3. Verify signatures for security
  4. Follow best practices for reliability