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

📘

While it’s not common, webhooks can fail, and we don’t recommend that any of our partners rely solely on them. You have access to on-chain data, and we have listeners and the data API; you should have redundancy in these situations.


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 module lifecycle

To get an overview of the entire module, the actions that 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 sent
registrationA new user on your website creates a Wert profile.event name,
click_id
loginAn existing user logged in to Wert on your website.event name,
click_id,
user_id,
fkyc state,
lkyc state
logoutAn existing user logged out of Wert on your website.event name,
click_id
card_addedA user added a new bank card.event name,
click_id
verify_startA user started the verification process.event name,
click_id
verify_retryA user needs to re-upload documents to finish verification.event name,
click_id
verify_failedA user needs to re-upload documents to finish verification.event name,
click_id
verify_successA user successfully passed KYC verification.event name,
click_id
payment_startedA user initiated a purchase (pressed “Confirm
and Pay”), and a request was sent to the payment acquirer.
event name,
click_id,
order_id,
commodity,
commodity amount,
currency
currency amount
address,
transaction_id,
sc_address (for NFT order),
sc_input_data (for NFT order)
order_completeAn order received “Success” status.

For further details on order statuses, see the lifecycle diagram.
event name,
click_id,
order_id,
commodity,
commodity amount,
currency
currency amount
address,
transaction_id,
sc_address (for NFT order),
sc_input_data (for NFT order)
order_failedAn order received “Failed” status.

For further details on order statuses, see the lifecycle diagram.
event name,
click_id,
order_id,
commodity,
commodity amount,
currency
currency amount
address,
transaction_id,
sc_address (for NFT order),
sc_input_data (for NFT order)
order_canceledAn order received “Cancelled” status.

For further details on order statuses, see the lifecycle diagram.
event name,
click_id,
order_id,
commodity,
commodity amount,
currency
currency amount
address,
transaction_id,
sc_address (for NFT order),
sc_input_data (for NFT order)
tx_smart_contract_failedA transaction to the smart contract has failed.

For further details on order statuses, see the lifecycle diagram.
event name,
click_id,
order_id,
commodity,
commodity amount,
currency
currency amount
address,
transaction_id,
sc_address,
sc_input_data,
fallback_order_id
fallback_order_commodity,
fallback_order_commodity amount,
fallback_order_currency,
fallback_order_currency amount,
fallback_order_address,
fallback_order_transaction_id
testYou provided a callback URL in the Partner Account/Webhooks tab and pressed “Test” to receive a test webhook.event name,
click_id,
order_id,
commodity,
commodity amount,
currency
currency amount
address,
transaction_id,
sc_address,
sc_input_data
transfer_startedThis will be sent by Wert as soon as we receive a transaction_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.event name,
click_id,
order_id,
commodity,
commodity amount,
currency
currency amount
address,
transaction_id,
sc_address,
sc_input_data

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": {
    "id": "01HWBC52H04XN6ETYMAXXXXX",
    "base": "ETH",
    "base_amount": "0.0159251",
    "quote": "USD",
    "quote_amount": "53.63",
    "address": "0xF63EBd44b355b32F7E0ef65B87A0DB2fa95D8E62",
    "transaction_id": "0x8cdc3eca9b2e878cc97f326df3d420fc6809d24a38899b40e6dd5c4cbcf7b561"
  }
}

Or when using a smart contract:

{
  "type": "order_complete",
  "click_id": "6380534230062343906",
  "order": {
    "id": "01HYGMBG18D8P5CK7RN1K8MY2E",
    "base": "MATICSC",
    "base_amount": "3.67",
    "quote": "USD",
    "quote_amount": "2.85",
    "address": "0xF63EBd44b355b32F7E0ef65B87A0DB2fa95D8E62",
    "transaction_id": "0x3b3bafbc97abbbb2ed6f5b5825bcfc409e4cc05658e8530cf5750f2d35952edf",
    "partner_data": {
      "sc_id": "",
      "sc_address": "0xfc5eecb69d262b184ac1347018d381d66d3c4",
      "sc_input_data": "0x3c168eab000000000000000000000000e696823a3231b87eec57b8925d64e340c12044a60000000000000000000000000000000000000000000000000000000000000001"
    }
  }
}

Documentation related to this page