WebhooksStay synchronized with payment events
Receive real-time notifications from ZSI Pay when important payment events occur. Use webhooks to keep your application, orders, and payment records synchronized.
Overview
What are webhooks?
Webhooks allow ZSI Pay to notify your server whenever an important event occurs. Instead of repeatedly asking the API whether a payment has changed, your application can receive the update automatically.
This is especially useful for payment confirmation, failed payments, refunds, and other asynchronous events.
ZSI Pay
Payment event
Payment Event
ZSI Pay
Webhook
Your server
Your application processes the event and updates its records.
Getting started
Configure your webhook endpoint
Create a publicly accessible HTTPS endpoint in your backend that can receive webhook requests from ZSI Pay.
Create endpoint
Create a dedicated server-side endpoint to receive ZSI Pay webhook events.
Secure endpoint
Validate incoming webhook requests before processing payment information.
Process events
Update your payment or order records based on the verified event.
Endpoint
Receive webhook requests
Your webhook endpoint should accept the HTTP method and content type defined by the ZSI Pay webhook specification.
app.post("/webhooks/zsi-pay", async (req, res) => {
const event = req.body;
// Verify the webhook request
// Check whether the event was
// already processed
// Process the payment event
res.status(200).json({
received: true,
});
});Events
Payment events
Your webhook endpoint can receive notifications for supported payment lifecycle events.
payment.createdTriggered when a payment is successfully created.
payment.pendingIndicates that the payment is awaiting completion or confirmation.
payment.completedTriggered when a payment has been successfully completed.
payment.failedTriggered when a payment attempt fails.
payment.cancelledTriggered when a payment is cancelled.
payment.refundedTriggered when a completed payment is refunded.
Event names and availability should follow the current ZSI Pay API specification.
Payload
Webhook event structure
A webhook payload contains the information your application needs to identify and process the event.
{
"id": "evt_example",
"type": "payment.completed",
"created_at": "2026-09-23T10:30:00Z",
"data": {
"payment_id": "payment_example",
"reference": "ORDER-12345",
"status": "completed",
"amount": 1000,
"currency": "USD"
}
}Security
Verify every webhook
Never assume that an incoming request is genuine just because it reached your endpoint. Validate webhook authenticity before updating payment or order records.
Signature verification
Use the webhook signing mechanism provided by ZSI Pay to verify that the request originated from the payment platform.
Protect your secrets
Keep webhook secrets and API credentials on your server and never expose them in client-side applications.
Reliability
Build for retries and duplicate events
Webhook delivery can be retried when a receiving endpoint does not successfully acknowledge an event. Your application should therefore be designed to safely process the same event more than once.
Idempotent processing
Store a unique event identifier and make sure an event is not applied to your business logic more than once.
Acknowledge successfully
Return the appropriate successful HTTP response after your endpoint has accepted the event.
Process asynchronously
For heavier operations, consider placing the event into a queue and processing it asynchronously.
Testing
Test your webhook integration
Before moving to production, verify that your endpoint can receive, authenticate, process, and acknowledge webhook events correctly.
Continue building with ZSI Pay
Explore the rest of our developer resources to complete your integration.
Ready to connect your webhook?
Follow the integration documentation and start building your payment flow with ZSI Pay.
