Overview
Webhooks deliver real-time notifications when payment and request events occur. Configure your endpoints to receive HMAC-signed POST requests with automatic retry logic and comprehensive event data.Webhook Configuration
Setup in Portal
- Navigate to Platform Settings โ Webhooks in Request Portal
- Click Add webhook
- In the dialog that opens, enter URL and click Create webhook
- Click copy button to copy Signing Secret to clipboard (see Authentication for API key setup)
- Enable/disable or delete webhooks as needed
Local Development
Use ngrok to receive webhooks locally:Event Types
See Payload Examples below for detailed webhook structures.
Payment Events
Event | Description | Context | Primary Use |
---|---|---|---|
payment.confirmed | Payment fully completed and settled | After blockchain confirmation | Complete fulfillment, release goods |
payment.partial | Partial payment received for request | Installments, partial orders | Update balance, allow additional payments |
payment.failed | Payment execution failed | Recurring payments, cross-chain transfers | Notify failure, retry logic, pause subscriptions |
payment.refunded | Payment has been refunded to payer | Cross-chain payment failures, refund scenarios | Update order status, notify customer |
Processing Events
Event | Description | Context | Primary Use |
---|---|---|---|
payment.processing | Crypto-to-fiat payment in progress | subStatus values: initiated, pending_internal_assessment, ongoing_checks, sending_fiat, fiat_sent, bounced | Track crypto-to-fiat payment status, update UI |
Request Events
Event | Description | Context | Primary Use |
---|---|---|---|
request.recurring | New recurring request generated | Subscription renewals, scheduled payments | Send renewal notifications, update billing |
Compliance Events
Event | Description | Context | Primary Use |
---|---|---|---|
compliance.updated | KYC or agreement status changed | kycStatus values: not_started, pending, approved, rejected, retry_required agreementStatus values: not_started, pending, completed, rejected, failed | Update user permissions, notify status |
payment_detail.updated | Bank account verification status updated | States: approved, failed, pending | Enable fiat payments, update profiles |
Security Implementation
Signature Verification
Every webhook includes an HMAC SHA-256 signature in thex-request-network-signature
header:
Security Requirements
- HTTPS only: Production webhooks require HTTPS endpoints
- Always verify signatures: Never process unverified webhook requests
- Keep secrets secure: Store signing secrets as environment variables
- Return 2xx for success: Any 2xx status code confirms successful processing
Request Headers
Each webhook request includes these headers:Header | Description | Example |
---|---|---|
x-request-network-signature | HMAC SHA-256 signature | a1b2c3d4e5f6... |
x-request-network-delivery | Unique delivery ID (ULID) | 01ARZ3NDEKTSV4RRFFQ69G5FAV |
x-request-network-retry-count | Current retry attempt (0-3) | 0 |
x-request-network-test | Present for test webhooks | true |
content-type | Always JSON | application/json |
Retry Logic
Automatic Retries
- Max attempts: 3 retries (4 total attempts)
- Retry delays: 1s, 5s, 15s
- Trigger conditions: Non-2xx response codes, timeouts, connection errors
- Timeout: 5 seconds per request
Response Handling
Error Logging
Request API logs all webhook delivery failures with:- Endpoint URL
- Attempt number
- Error details
- Final failure after all retries
Payload Examples
All payment events include anexplorer
field linking to Request Scan for transaction details.
Common Fields:
requestId
/requestID
: Unique identifier for the payment requestpaymentReference
: Short reference, also unique to a request, used to link payments to the requesttimestamp
: ISO 8601 formatted event timestamppaymentProcessor
: Eitherrequest-network
(crypto) orrequest-tech
(fiat)
Payment Confirmed
Payment Processing
Payment Partial
Payment Failed
Compliance Updated
Implementation Examples
For a complete working example, see the EasyInvoice demo which implements webhook handling for payment notifications.- Express.js
- Next.js
Testing
Portal Testing
- Go to Platform Settings โ Webhooks in Request Portal
- Create a webhook if you havenโt already
- Select the webhook event type and click Send test event
- Monitor your endpoint logs for test requests
Test Webhook Identification
Test webhooks include thex-request-network-test: true
header:
Best Practices
Error Handling
- Implement idempotency: Use delivery IDs to prevent duplicate processing
- Graceful degradation: Handle unknown event types without errors
Performance
- Timeout management: Complete processing within 5 seconds
Troubleshooting
Common Issues
Signature verification fails:- Check your signing secret matches Portal configuration
- Ensure youโre using the raw request body for signature calculation
- Verify HMAC SHA-256 implementation
- Confirm endpoint URL is accessible via HTTPS
- Verify endpoint returns 2xx status codes
Debugging Tips
- Use ngrok request inspector to see raw webhook data
- Monitor retry counts in headers to identify issues
- Test with Portalโs โSend test webhooksโ feature
Related Documentation
Webhooks & Events
High-level webhook concepts and workflow
EasyInvoice Demo
Complete webhook implementation example
Authentication
API key setup and webhook security
Payment Processing
Understanding payment lifecycle events
Request Portal
Configure webhooks and manage API keys
Request Scan
Explore transactions and request details