Search…
Webhook
Webhook is used for sending deposit notifications to your desired URL. You can setup the URL upon wallet creation and it will send a deposit notification request to your endpoint using your key and secret
The request includes 2 headers:
    key: Same client key
    secret: Same client secret
Once your server receives the request on your endpoint you need to check the request key and secret to check the validity of the request and make sure that this request is coming from Vault. (In more advanced scenarios HMAC-signature structure can be configured)
You can use webhook test on REST API interactive explorer on https://api.vault.bitholla.com/docs to test the sample request sent to your server.
Webhook request expects 200 status response from your server.
Check the fields in is_confirmed and is_suspicious in the data you receive on your server. The webhook notifications are always sent when the deposit is confirmed. Often you receive the first webhook notification with status is_confirmed: false which is used to notify about an incoming deposit. In these cases do not assume the deposit is confirmed and wait for the second notification before you process it.
get
https://api.vault.bitholla.com
/v1/wallet/:wallet_name/webhook/test
Webhook Test

Advance Signature

This structure is not used for normal wallets and is only applied for extra security upon client request. In the advance model, webhook deposit notification signs your request using your provided key and secret.
You are required to calculate the signature on your side and match it with the api-signature provided along with the api-nonce in the request header.
This is a sample code for signature you can refer to:
1
const secret = <your api-secret>;
2
const verb = 'POST';
3
const url = <your wallet webhook url>;
4
const data = <notification object data>;
5
const nonce = Date.now();
6
const stringData = JSON.stringify(data);
7
8
const signature = crypto
9
.createHmac('sha256', secret)
10
.update(verb + url + nonce + stringData)
11
.digest('hex');
12
13
console.log(signature)
Copied!
Last modified 9mo ago