Events

Event request data

A typical webhook request's body looks like this:

{
"hook_id": 36,
"hook_key": "6a622fda-f696-4f5c-9eab-d09f59f17366",
"hook_time": 1579626696,
"hook_signature": "X-Webhook-Signature",
"payload": {
"event": "coins.incoming",
"data": {
"transactionId": "VHlwZXM6OlB1YmxpY0FwaTo6QWRkcmVzcy1mOGRmNGZlYy1iZTJmLTQ1YjktOWJjMy04YjMwMGNhZTg5Y2I=",
"cryptocurrency": "naira_token",
"transactionHash": "00c49d94c2c7ed92d7f166a4499a27e1bc2c3b9b",
"amount": 25985,
"type": "onchain",
"confirmed": false,
"address": "1f6d648ccdfc13e55050e24727421d5dca2eed95"
}
}
}

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
Incoming Bank Deposit
Order Success
Order Failure
Incoming Coins
{
"hook_id": 10,
"hook_key": "d814153e-2ced-4d81-82f1-327d000a3ca2",
"hook_time": 1581430102,
"hook_signature": "X-Webhook-Signature",
"payload": {
"event": "coins.incoming",
"data": {
"transactionId": "VHlwZXM6OlB1YmxpY0FwaTo6QWRkcmVzcy1mOGRmNGZlYy1iZTJmLTQ1YjktOWJjMy04YjMwMGNhZTg5Y2I=",
"cryptocurrency": "naira_token",
"transactionHash": "00c49d94c2c7ed92d7f166a4499a27e1bc2c3b9b",
"amount": "0.002",
"type": "onchain",
"confirmed": false,
"address": "1f6d648ccdfc13e55050e24727421d5dca2eed95"
}
}
}
Incoming Bank Deposit
{
"hook_id": 11,
"hook_key": "1d7394f6-b8a8-4767-af97-4cdc83c07d49",
"hook_time": 1581430302,
"hook_signature": "X-Webhook-Signature",
"payload": {
"event": "bank_deposit.incoming",
"data": {
"bankAccountId": "VHlwZXM6OlB1YmxpY0FwaTo6T3JkZXItZWY3NzVlOGMtZmVhYS00NTFhLTkyMjQtMDVmYTU4M2VjY2E0",
"amount": "2000.00",
"senderLastFour": "7789",
"senderAccountName": "Tony Stark",
"bankAccountName": "Tony Stark",
"bankAccountReference": "84b26f66-081d-46e6-8030-7fe206ba5311"
}
}
}
Order Success
{
"hook_id": 12,
"hook_key": "7d916338-d625-4e33-be18-dcd8dab2ed9d",
"hook_time": 1581430405,
"hook_signature": "X-Webhook-Signature",
"payload": {
"event": "order.succeeded",
"data": {
"orderId": "VHlwZXM6OlB1YmxpY0FwaTo6T3JkZXItYTZjN2E3Y2EtYzgzNS00YmU1LWI2YTUtZGY3MTU5YmIyOGZi",
"total_coin_amount": "0.002",
"filled_coin_amount": "0.002",
"status": "done",
"side": "sell",
"cryptocurrency": "bitcoin"
}
}
}
Order Failure
{
"hook_id": 13,
"hook_key": "dbf92264-80ae-4807-9db6-5b51e1d28d9d",
"hook_time": 1581430570,
"hook_signature": "X-Webhook-Signature",
"payload": {
"event": "order.failed",
"data": {
"orderId": "VHlwZXM6OlB1YmxpY0FwaTo6T3JkZXItZWY3NzVlOGMtZmVhYS00NTFhLTkyMjQtMDVmYTU4M2VjY2E0",
"total_coin_amount": "0.002",
"filled_coin_amount": "0.0",
"status": "failed",
"side": "buy",
"cryptocurrency": "bitcoin"
}
}
}