Listening for channel webhooks
In the previous guide, we discussed setting up a webhook listener. If you haven't configured your listener yet, please refer to that step to prepare for receiving webhooks.
Details on the data transmitted in webhooks are available Here.
Payment Flow Diagram and Webhooks Sent
Payment Complete Webhooks
When an end user transmits cryptocurrency to a channel address, BVNK dispatches the following webhooks to notify you of the transaction's status:
- statusChanged - Processing: This webhook is issued as soon as a transaction is detected on the blockchain. It signifies the initial recognition of the payment sent to the channel address.
- statusChanged - Complete: This webhook follows when the transaction achieves the necessary number of confirmations on the blockchain, ensuring its validity and finality.
Channel webhooks are designed to address only the detection and confirmation stages of transactions. Given that the channel's address remains perpetually open to receive multiple payments, the concept of a 'payment completion' as with singular transactions does not apply in the same manner.
The transactionConfirmed webhook delivers comprehensive details about the channel payment. It includes the exact amounts transferred by the end user in the actual
fields and the transaction hash. This hash can be utilized to verify the transaction details on a blockchain explorer, found within the transactions
array.
Channel Webhooks
{
"event": "transactionDetected",
"source": "channel",
"data": {
"channelId": "326bf4e4-866e-4ec5-80e8-5233b7d29af5",
"merchantId": "a7eddadd-fd9b-45fb-82a1-dc12eaa14cba",
"merchantDisplayName": "ETH Merchant ",
"reference": "Channel Test",
"dateCreated": 1709556819750,
"lastUpdated": 1709556819750,
"status": "DETECTED",
"uuid": "2d04095f-29b0-4434-89af-573759f8f248",
"hash": "0x8ad672efcb337fb5a2025149e5e6f22e8af17f71b5270e904de28cee44de00e6",
"address": "0xf210435eb347b9c79361b97fae333abf7cba1d9b",
"tag": null,
"paidCurrency": "ETH",
"displayCurrency": "USD",
"walletCurrency": "ETH",
"feeCurrency": "ETH",
"paidAmount": 0,
"displayAmount": 0,
"walletAmount": 0,
"feeAmount": 0,
"exchangeRate": null,
"displayRate": null,
"risk": {
"level": "UNKNOWN",
"resourceName": "UNKNOWN",
"resourceCategory": "UNKNOWN",
"alerts": []
},
"sources": null,
"networkFee": {
"paidCurrency": null,
"paidAmount": 0,
"displayCurrency": null,
"displayAmount": 0
}
}
}
{
"event": "transactionConfirmed",
"source": "channel",
"data": {
"channelId": "326bf4e4-866e-4ec5-80e8-5233b7d29af5",
"merchantId": "a7eddadd-fd9b-45fb-82a1-dc12eaa14cba",
"merchantDisplayName": "ETH Merchant ",
"reference": "Channel Test",
"dateCreated": 1709556820000,
"lastUpdated": 1709556909163,
"status": "COMPLETE",
"uuid": "2d04095f-29b0-4434-89af-573759f8f248",
"hash": "0x8ad672efcb337fb5a2025149e5e6f22e8af17f71b5270e904de28cee44de00e6",
"address": "0xf210435eb347b9c79361b97fae333abf7cba1d9b",
"tag": null,
"paidCurrency": "ETH",
"displayCurrency": "USD",
"walletCurrency": "ETH",
"feeCurrency": "ETH",
"paidAmount": 0.01234,
"displayAmount": 43.28,
"walletAmount": 0.01234,
"feeAmount": 0.0001234,
"exchangeRate": {
"base": "ETH",
"counter": "ETH",
"rate": 1
},
"displayRate": {
"base": "ETH",
"counter": "USD",
"rate": 3507.29
},
"risk": {
"level": "UNKNOWN",
"resourceName": "UNKNOWN",
"resourceCategory": "UNKNOWN",
"alerts": []
},
"sources": [
"0x84a4a239805d06c685219801b82bea7c76702214"
],
"networkFee": {
"paidCurrency": "ETH",
"paidAmount": 0.000033576139821,
"displayCurrency": "USD",
"displayAmount": 0.11
}
}
}
Updated 8 months ago