Skip to main content

Webhook Guide

In this mini tutorial you will be able to create a webhook for receiving notifications from the payment systems

Step 1: Create a Webhook Endpoint​

Build a secure HTTPS endpoint on your server to process:

// Example Node.js endpoint
app.post("/webhooks/payments", async (req, res) => {
// Handle event type
switch (req.body.type) {
case "checkout_session.finished":
await fulfillOrder(req.body.transaction_hash, req.body.sessionId);
break;
case "checkout_session.expired":
await releaseInventory(req.body.sessionId);
break;
}

res.status(200).end();
});

Step 2: Register Your Webhook URL​

Provide this URL in your Dashboard:

Settings → Developers → Webhooks → Add Endpoint
# Example valid URL
https://api.your-app.com/webhooks/payments

Step 3: Test Events​

curl -X POST your-endpoint-url \
-H "Content-Type: application/json" \
-d '{"type":"checkout_session.finished","transaction_hash":"pay_123"}'