Skip to main content

Webhooks (Asynchronous Notifications)

Use webhooks to receive real-time updates on payment and payout status changes without polling the API.

Endpoint: POST /webhook (Hosted by Merchant)

Security: Verify the signature in header X-TW-Signature using your secret key.

Payload Example: Payment Success

{
"transaction_id": "TXN_TW_893745",
"merchant_order_id": "ORD_123456789",
"status": "SUCCESS",
"payment_method": "UPI_IN",
"amount": 2500,
"amount_paid": 2500,
"currency": "INR",
"created_at": "2023-10-27T10:30:00Z",
"finalized_at": "2023-10-27T10:35:00Z"
}

Payload Example: Payment Declined (Webhook)

{
"transaction_id": "TXN_TW_893746",
"merchant_order_id": "ORD_123456789",
"status": "FAILED",
"payment_method": "UPI_IN",
"amount": 2500,
"currency": "INR",
"created_at": "2023-10-27T10:30:00Z",
"finalized_at": "2023-10-27T10:32:00Z",
"decline_reason": "INSUFFICIENT_FUNDS"
}

Payload Example: Payout Success (Webhook)

{
"transaction_id": "PAY_TW_554433",
"merchant_order_id": "ORD_123456789",
"status": "SUCCESS",
"amount": 10000,
"currency": "INR",
"created_at": "2023-10-27T10:35:00Z",
"finalized_at": "2023-10-28T09:00:00Z"
}

Payload Example: Payout Failed (Webhook)

{
"transaction_id": "PAY_TW_554434",
"merchant_order_id": "ORD_123456789",
"status": "FAILED",
"amount": 10000,
"currency": "INR",
"created_at": "2023-10-27T10:35:00Z",
"finalized_at": "2023-10-28T09:00:00Z",
"decline_reason": "INVALID_ACCOUNT_NUMBER"
}