Loading...
Loading...
Receive webhook notifications for virtual account collections.
Last updated: 2026-02-21
Receive real-time notifications when payments are made to your Virtual Account Numbers, enabling immediate payment processing, automatic reconciliation, and enhanced customer experience.
Webhooks will be sent to the callback_url provided during VAM generation via the VAM Generation API.
Required Field in VAM Generation Request:
{
"callback_url": "https://your-website.com/webhook/vam-collection"
}
Content-Type: application/json
User-Agent: Paywize-VAM-Webhook/1.0
X-Paywize-Signature: sha256=signature_hash
X-Paywize-Event: vam_payment_received
X-Paywize-Timestamp: 1640995200
X-Paywize-VAM-ID: VAM123456789
{
"data": "encrypted_payload_using_AES_256_CBC"
}
{
"event_type": "vam_payment_received",
"payment_id": "VCP987654321",
"vam_details": {
"vam_id": "VAM123456789",
"virtual_account_number": "919876543210001",
"customer_id": "CUST123456",
"purpose": "invoice_payment"
},
"payment_details": {
"amount": "5000.00",
"currency": "INR",
"payment_mode": "UPI",
"sender_vpa": "customer@paytm",
"sender_name": "John Doe",
"transaction_reference": "UPI789456123",
"bank_reference": "BNK123789456"
},
"collection_info": {
"expected_amount": "5000.00",
"collected_amount": "5000.00",
"amount_match": true,
"collection_status": "FULL_PAYMENT",
"remaining_amount": "0.00"
},
"timestamps": {
"payment_time": "2026-01-15T10:30:00Z",
"vam_created_at": "2026-01-15T09:00:00Z",
"webhook_sent_at": "2026-01-15T10:30:01Z"
},
"metadata": {
"invoice_number": "INV-2026-001",
"customer_name": "John Doe",
"order_id": "ORD789456",
"department": "sales"
}
}
| Field | Type | Description |
|---|---|---|
| event_type | String | Type of webhook event |
| payment_id | String | Unique payment identifier |
| vam_details | Object | Virtual account information |
| vam_details.vam_id | String | VAM unique identifier |
| vam_details.virtual_account_number | String | Virtual account number |
| vam_details.customer_id | String | Associated customer ID |
| vam_details.purpose | String | Payment purpose |
| payment_details | Object | Payment transaction information |
| payment_details.amount | String | Payment amount received |
| payment_details.currency | String | Payment currency |
| payment_details.payment_mode | String | Payment method used |
| payment_details.sender_vpa | String | Sender's UPI VPA |
| payment_details.sender_name | String | Sender's name |
| collection_info | Object | Collection status information |
| collection_info.expected_amount | String | Expected payment amount |
| collection_info.collected_amount | String | Total amount collected |
| collection_info.amount_match | Boolean | Payment amount matches expected |
| collection_info.collection_status | String | Collection completion status |
| timestamps | Object | Event timestamp information |
| metadata | Object | Custom metadata from VAM creation |
const crypto = require('crypto');
function verifyVAMWebhookSignature(payload, signature, secret) {
const computedSignature = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return `sha256=${computedSignature}` === signature;
}
// Usage
const isValid = verifyVAMWebhookSignature(
webhookPayload,
request.headers['x-paywize-signature'],
'your_webhook_secret'
);
const processedPayments = new Set();
function handleVAMWebhook(payload) {
const paymentId = payload.payment_id;
if (processedPayments.has(paymentId)) {
console.log('Duplicate webhook ignored');
return { status: 'duplicate', processed: false };
}
processedPayments.add(paymentId);
// Process payment
return { status: 'success', processed: true };
}
function autoReconcilePayment(webhookData) {
const {
vam_id,
payment_details,
collection_info,
metadata
} = webhookData;
// Match payment to invoice/order
const invoice = findInvoiceByNumber(metadata.invoice_number);
if (invoice && collection_info.amount_match) {
// Mark invoice as paid
markInvoiceAsPaid(invoice.id, payment_details.amount);
// Update customer record
updateCustomerPaymentHistory(
webhookData.vam_details.customer_id,
payment_details
);
// Trigger fulfillment
triggerOrderFulfillment(metadata.order_id);
}
}