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": {
    "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"
    }
  }
}

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"
    }
  }
}

Documentation related to this page