Webhooks

To receive information about various events undertaken by the user while they use the widget, you will need to set up an endpoint which accepts payloads sent by Wert. Your endpoint will receive POST requests with content-type application/json.


Configuring the webhook endpoint

The webhook endpoint can be set up on Partner Dashboard -> Webhooks -> Webhook URL. Make sure you save the endpoint by clicking "Save".

From this page, you will also be able to see a log of all events that have been sent.

⚠️

Wert will post all payloads to the specified URL; if there are any issues with delivering the payload, it will not be resent.


Wert module lifecycle

To get an overview the full module, the actions which can lead to certain events occurring and further details for each transaction status please see this graphic:


Events

The following events are available:

TypeExecuted whenWhat is sentExample
registrationA new user on your website creates a Wert profile.name of the event
click id
{
"type": "registration",
"click_id": {{click_id}}
}
loginAn existing user logged in to Wert on your website.name of the event
click id
user id
fkyc state
lkyc state
{
"type": "login",
"click_id": {{click_id}},
"user": {
"user_id": {{user_id}},
"verification_status": {
"fkyc": {
"state": {{state}}
},
"lkyc": {
"state": {{state}}
}
}
}
}
logoutAn existing user logged out of Wert on your website.name of the event
click id
{
"type": "logout"
"click_id": {{click_id}}
}
card_addedA user added a new bank card.name of the event
click id
{
"type": "card_added"
"click_id": {{click_id}}
}
verify_startA user started the verification process.name of the event
click id
{
"type": "verify_start"
"click_id": {{click_id}}
}
verify_retryA user needs to re-upload documents to finish verification.name of the event
click id
{
"type": "verify_retry"
"click_id": {{click_id}}
}
verify_failedA user needs to re-upload documents to finish verification.name of the event
click id
{
"type": "verify_failed"
"click_id": {{click_id}}
}
verify_successA user successfully passed KYC verification.name of the event
click id
commodity
commodity amount
currency
currency amount
address
{
"type": "verify_success"
"click_id": {{click_id}}
"order": {
"base": "USD",
"base_amount": "12.111",
"quote": "BTC",
"quote_amount": "1.112",
"address": {{address}},
}
}
payment_startedA user initiated a purchase (pressed “Confirm
and Pay”) and a request was sent to the payment acquirer.
name of the event
click id
commodity
commodity amount
currency
currency amount
address
{
"type": "payment_started"
"click_id": {{click_id}}
"order": {
"id": {{order_id}},
"base": "USD",
"base_amount": "12.111",
"quote": "BTC",
"quote_amount": "1.112",
"address": {{address}},
"transaction_id": null
}
}
order_completeAn order received "Success" status.

For further details on order statuses see the lifecycle
diagram above.
name of the event
click id
commodity
commodity amount
currency
currency amount
address
txid
{
"type": "order_complete"
"click_id": {{click_id}}
"order": {
"base": "USD",
"base_amount": "12.111",
"quote": "BTC",
"quote_amount": "1.112",
"address": {{address}},
"transaction_id": {{transaction_id}}
}
}
order_failedAn order received "Failed" status.

For further details on order statuses see the lifecycle
diagram above.
name of the event
click id
commodity
commodity amount
currency
currency amount
address
{
"type": "order_failed"
"click_id": {{click_id}}
"order": {
"id": {{order_id}}
"base": "USD",
"base_amount": "12.111",
"quote": "BTC",
"quote_amount": "1.112",
"address": {{address}},
"transaction_id": null
}
}
order_canceledAn order received "Cancelled" status.

For further details on order statuses see the lifecycle
diagram above.
name of the event
click id
commodity
commodity amount
currency
currency amount
address
{
"type": "order_canceled"
"click_id": {{click_id}}
"order": {
"id": {{order_id}},
"base": "USD",
"base_amount": "12.111",
"quote": "BTC",
"quote_amount": "1.112",
"address": {{address}},
"transaction_id": null
}
}
tx_smart_contract_failedA transaction to the smart contract has failed.

For further details on order statuses see the lifecycle
diagram above.
name of the event
click Id
commodity
commodity amount
currency
currency amount
address
txn id
input data
fallback order
{
"type": "tx_smart_contract_failed",
"click_id": "click_id",
"order": {
"id": {{order_id}},
"base": "ETHSC",
"base_amount": "0.01",
"quote": "usd",
"quote_amount": "18.34",
"address": {{address}},
"transaction_id": {{txn id}},
"partner_data": {
"sc_id": "",
"sc_address": {{sc_address}},
"sc_input_data": {{sc_input_data}},
"sc_type_name": {{sc_type_name}}
},
"fallback_order": {
"id": {{order_id}},
"base": "ETH",
"base_amount": "0.01001706",
"quote": "usd",
"quote_amount": "18.34",
"address": {{address}},
"transaction_id": {{txn id}}
}
}
}
testYou provided a callback URL in the Partner Account/Webhooks tab and pressed “Test” to receive a test webhookname of the event
click id
commodity
commodity amount
currency
currency amount
address
input data
{
"type": "test",
"click_id": "test_click_id",
"order": {
"base": "USD",
"base_amount": "12.111",
"quote": "BTC",
"quote_amount": "1.112",
"address": "some_address",
"transaction_id": "some_transaction_id",
"partner_data": {
"sc_id": "0x48ece197c28e49d8a895604a17b8c29e",
"sc_address": "0x3432a9F32E873512c83e9C390E28bA6a98071C01",
"sc_input_data": "0x3432a9F32E873512c83e9C390E28bA6a98071C01",
"sc_type_name": "NFT"
}
}
}
transfer_startedThis will be sent by Wert as soon as we receive a tx_id from the node, meaning that as soon as the payment is completed and the crypto is sent, but before we receive any block confirmations.name of the event
click id
commodity
commodity amount
currency
currency amount
address
txn_id
input data
{
"type": "transfer_started",
"click_id": {{click_id}},
"order": {
"id": "01HBE0YY5SMKXXA4ZCM952HS90",
"base": "GHST",
"base_amount": "6.06775449",
"quote": "usd",
"quote_amount": "5",
"address": {{address}},
"transaction_id": {{transaction_id}},
"partner_data": {
"sc_address": {{sc_address}},
"sc_input_data": {{sc_input_data}},
"sc_type_name": {{sc_type_name}}
}
}
}

Webhook structure

A webhook for the verify_failed event, for example, which only sends the name of the event and the click ID would be similar to:

{
  "type": "verify_failed",
  "click_id": "6380534230062343906"
}

Whereas for the order_failed event, which includes order details, the webhook would be similar to:

{
  "type": "order_failed", 
  "click_id": "6380534230062343906",
	"order": {
    "base": "USD",
    "base_amount": "12.111",
    "quote": "BTC",
    "quote_amount": "1.112",
    "address": "0x0000000000000000000000000000000000000000",
    "partner_data": {
      "sc_id": "0x48ece197c28e49d8a895604a17b8c29e",
      "sc_address": "0x3432a9F32E873512c83e9C390E28bA6a98071C01",
      "sc_input_data": "0x3432a9F32E873512c83e9C390E28bA6a98071C01",
      "sc_type_name": "NFT"
    }
  }
}

Or when using a smart contract:

{
  "type": "order_complete",
  "click_id": "6380534230062343906",
  "order": {
    "base": "ETHSC",
    "base_amount": "0.24",
    "quote": "USD",
    "quote_amount": "1271.39",
    "address": "0xF63EBd44b355b32F7E0ef65B87A0DB2fa95D8E62",
    "transaction_id": "0xa290389cb4fedb931b8b14526de4a712d3c26c8ab464ce46cca1e0647bdf48cd",
    "partner_data": {
      "sc_id": "SBzHmZVcM5",
      "sc_address": "0x047c2f21549861d5a3a16c7cef909838e61caa45",
      "sc_input_data": "0x067a22e6000000000000000000000000f61ebd45b345b32f7e0ef65b87a0db2fa95d8e62000000000000000000000000c794047d59f11bef4035241ab403c9a419d7da8d0000000000000000000000000000000000000000000000000354a6ba7a18000000000000000000000000000000000000000000000000000000000000638575dc00000000000000000000000000000000000000000000000000000000000009e9000000000000000000000000de6b6090d32eb3eeae95453ed14358819ea30d33000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041b83573cc8f90dded059bad262ac56f6fa22f167bb564328e373439bf6778da03411acc3ec4cf932c1adcb15d8aa3b4f61e71db2c6c9e3b29c65e2e5099b944bb1c00000000000000000000000000000000000000000000000000000000000000",
      "sc_type_name": "ERC-721"
    }
  }
}

Documentation related to this page