BuyCoins API Guide
Search…
Events
Event request data
A typical webhook request's body looks like this:
1
{
2
"hook_id": 36,
3
"hook_key": "6a622fda-f696-4f5c-9eab-d09f59f17366",
4
"hook_time": 1579626696,
5
"hook_signature": "X-Webhook-Signature",
6
"payload": {
7
"event": "coins.incoming",
8
"data": {
9
"transactionId": "VHlwZXM6OlB1YmxpY0FwaTo6QWRkcmVzcy1mOGRmNGZlYy1iZTJmLTQ1YjktOWJjMy04YjMwMGNhZTg5Y2I=",
10
"cryptocurrency": "naira_token",
11
"transactionHash": "00c49d94c2c7ed92d7f166a4499a27e1bc2c3b9b",
12
"amount": 25985,
13
"type": "onchain",
14
"confirmed": false,
15
"address": "1f6d648ccdfc13e55050e24727421d5dca2eed95"
16
}
17
}
18
}
Copied!
Note: It's useful to store & validate webhook events received using the unique hook_id and the hook_key so as to prevent replay events from triggering unintended actions.

Event types

Incoming Coins
Order Success
Order Failure
Deposit Success
Deposit Failure
1
{
2
"hook_id": 10,
3
"hook_key": "d814153e-2ced-4d81-82f1-327d000a3ca2",
4
"hook_time": 1581430102,
5
"hook_signature": "X-Webhook-Signature",
6
"payload": {
7
"event": "coins.incoming",
8
"data": {
9
"transactionId": "VHlwZXM6OlB1YmxpY0FwaTo6QWRkcmVzcy1mOGRmNGZlYy1iZTJmLTQ1YjktOWJjMy04YjMwMGNhZTg5Y2I=",
10
"cryptocurrency": "naira_token",
11
"transactionHash": "00c49d94c2c7ed92d7f166a4499a27e1bc2c3b9b",
12
"amount": "0.002",
13
"type": "onchain",
14
"confirmed": false,
15
"address": "1f6d648ccdfc13e55050e24727421d5dca2eed95"
16
}
17
}
18
}
Copied!
1
{
2
"hook_id": 12,
3
"hook_key": "7d916338-d625-4e33-be18-dcd8dab2ed9d",
4
"hook_time": 1581430405,
5
"hook_signature": "X-Webhook-Signature",
6
"payload": {
7
"event": "order.succeeded",
8
"data": {
9
"orderId": "VHlwZXM6OlB1YmxpY0FwaTo6T3JkZXItYTZjN2E3Y2EtYzgzNS00YmU1LWI2YTUtZGY3MTU5YmIyOGZi",
10
"total_coin_amount": "0.002",
11
"filled_coin_amount": "0.002",
12
"status": "done",
13
"side": "sell",
14
"cryptocurrency": "bitcoin"
15
}
16
}
17
}
Copied!
1
{
2
"hook_id": 13,
3
"hook_key": "dbf92264-80ae-4807-9db6-5b51e1d28d9d",
4
"hook_time": 1581430570,
5
"hook_signature": "X-Webhook-Signature",
6
"payload": {
7
"event": "order.failed",
8
"data": {
9
"orderId": "VHlwZXM6OlB1YmxpY0FwaTo6T3JkZXItZWY3NzVlOGMtZmVhYS00NTFhLTkyMjQtMDVmYTU4M2VjY2E0",
10
"total_coin_amount": "0.002",
11
"filled_coin_amount": "0.0",
12
"status": "failed",
13
"side": "buy",
14
"cryptocurrency": "bitcoin"
15
}
16
}
17
}
Copied!
1
{
2
"hook_id": 14,
3
"hook_key": "dbf92264-80ae-4807-9db6-5b51e1d28d9d",
4
"hook_time": 1581430570,
5
"hook_signature": "X-Webhook-Signature",
6
"payload": {
7
"event": "deposit.success",
8
"data": {
9
"reference": "transfers_1632717468063",
10
"amountKobo": 2000000,
11
"totalAmountKobo": 2000000,
12
"status": "success"
13
}
14
}
15
}
Copied!
1
{
2
"hook_id": 15,
3
"hook_key": "dbf92264-80ae-4807-9db6-5b51e1d28d9d",
4
"hook_time": 1581430570,
5
"hook_signature": "X-Webhook-Signature",
6
"payload": {
7
"event": "deposit.failed",
8
"data": {
9
"reference": "transfers_1632717468063",
10
"amountKobo": 2000000,
11
"totalAmountKobo": 2000000,
12
"status": "failed"
13
}
14
}
15
}
Copied!
Last modified 3mo ago
Copy link
Contents
Event types