跳转到主要内容

A webhook callback is a mechanism where, when specific events occur, WaaS proactively sends notifications to the merchant system to asynchronously inform about the results or status changes of certain operations. Merchants need to provide a callback URL and implement the necessary functionality to receive and process these callbacks.


Example Scenarios

Below are examples of common callback workflows:

1. Deposit Notification Workflow

  1. The merchant submits a deposit request to the WaaS deposit AP
  2. WaaS processes the deposit request.
  3. WaaS calls the callback URL provided by the merchant to notify the deposit result.
  4. The merchant receives the notification and updates the status

2. Withdrawal Notification Workflow (No Secondary Confirmation)

  1. The merchant submits a withdrawal request to the WaaS withdrawal API.
  2. WaaS processes the withdrawal request.
  3. WaaS calls the merchant’s callback URL to notify the withdrawal result (success or failure).
  4. The merchant receives the notification and updates the status.
For withdrawal workflows that require secondary confirmation, the callback may include additional confirmation steps. Please ensure that your callback URL can correctly handle all notification scenarios.

The callback interface has the following functions:
  • Notify merchants about the creation of deposit orders.
  • Request merchant confirmation of withdrawal details before execution.
  • Notify merchants about user wallet address changes.
  • Notify merchants of the execution results of withdrawal orders.

Note

The callback interface is used to receive notifications sent by WaaS. Merchants must provide WaaS with a callback address to receive event results through the callback mechanism. All requests must use the same API-Key mechanism for authentication as other interfaces. The notification content is RSA encrypted, before being sent, and the ciphertext is in Base64 format

API Example

  • API Endpoint:https://xxxx/api/v1/uu/notify

Request Method

POST

Request Headers

NameTypeRequiredExample ValueDescription
Content-TypestringYesapplication/x-www-form-urlencodedRequest Format: Form-Encoded Format
X-API-KEYstringYesyour-api-keyAuthorization key for authentication.

Request Body Parameters

Below is the request body parameter template:
Attribute NameTypeRequiredExample ValueDescription
tenantUserIdStringYestenant123Merchant user identifier.
requestUUIDStringYes2137890Unique identifier for the request.
trackingIdStringYestrack-4567Order tracking ID.
typeIntegerYes2Callback type
businessIntegerYes0Tenant type (no actual control effect currently).
callBackIdStringNo12345Callback ID.
toAddressStringNoTUekuiBgdk...Target address.
chainNameStringNoTRONBlockchain name.
txIdStringNo22e1c72076...Transaction ID.
symbolStringNoUSDTSymbol
amountStringNo0.5Amount
txIndexIntegerNo20Transaction index.
tagStringNoWITHDRAW_SUCCESSSTag
fromAddressStringNoTUekuiBgdk...Source address.
newAddressStringNoTUekuiBgdk...New address (only used when type is 4).
riskLevelFromIntegerNo15Risk score of the source address (exists when type is 1).
riskLevelToIntegerNo15Risk score of the target address (exists when type is 1).

Callback Type Enum

Below are the enum values for the type parameter and their descriptions:
TypeEnum NameDescription
0NOTIFY_UNKNOWNUnknown notification type, no action required.
1NOTIFY_DEPOSITEDWaaS notifies the merchant of deposit order creation; parameters should be parsed and result confirmed.
2NOTIFY_REQUEST_WITHDRAWRequests merchant to confirm withdrawal order details (for secondary confirmation).
3NOTIFY_WITHDRAWWaaS notifies the merchant of withdrawal order execution result.
4NOTIFY_ADDRESSNotifies user address change; the new address (newAddress) should be parsed.
5NOTIFY_INVALID_ADDRESSWithdrawal failed (invalid address); confirmation and response required.
6NOTIFY_NOT_ENOUGH_MONEYWithdrawal failed (insufficient balance); confirmation and response required.
7NOTIFY_NOT_ENOUGH_HOT_MONEYWithdrawal failed (insufficient gas); confirmation and response required.

Request Example

{
  "tenantUserId": "tenant123",
  "requestUUID": "2137890",
  "trackingId": "track-4567",
  "type": 2,
  "business": 0,
  "callBackId": "12345",
  "toAddress": "TUekuiBgdk...",
  "chainName": "TRON",
  "txId": "22e1c72076...",
  "symbol": "USDT",
  "amount": 0.5,
  "txIndex": 20,
  "tag": "WITHDRAW_SUCCESSS",
  "fromAddress": "TUekuiBgdk...",
  "newAddress": "TUekuiBgdk...",
  "riskLevelFrom": 15,
  "riskLevelTo": 15
}

Response Parameters

Attribute NameTypeRequiredExample ValueDescription
requestUUIDStringYes2137890Unique identifier for the request.
userIdStringYes1308764Tenant ID.
createByStringYesInformation about the creator (no actual control effect).
messageStringYesDescription message (no actual control effect).
apiKeyStringYesapiKey
errCodeintYesError code: 0 indicates success; other values indicate failure.
dataStringYesEncrypted data using an RSA public key.
Below are the descriptions for the data parameter:
Attribute NameTypeExample ValueDescription
requestUUIDString2137890Unique identifier for the request, used to uniquely identify it.
userIdInteger1User ID, identifies the specific user who triggered the event.
trackingIdStringtrack-4567Order tracking ID.
addressStringtoAddress123Target address, indicates the operation’s target address.
tenantUserIdStringtenant123Merchant user identifier, used to differentiate merchant users.
chainNameStringTRONBlockchain name, identifies the blockchain where the transaction occurred.
symbolStringUSDTCurrency symbol, identifies the token or currency involved in the transaction.
callBackIdString12345Callback ID, identifies the current callback event.
amountString0.5Amount, indicates the specific transaction or operation amount.
typeInteger2Callback type, detailed explanation can be found in the callback type

Response Example

{
  "requestUUID": "2137890" ,
  "userId": 1,
  "createBy":"xxxx",
  "message": "成功处理请求",
  "apiKey": "your_api_key",
  "errCode": 0,
  "data": {
    "userId": 1,
    "trackingId": "track-4567",
    "address": "toAddress123",
    "tenantUserId": "tenant123",
    "chainName": "TRON",
    "symbol":"USDT",
    "callBackId":"12345",
    "requestUUID": "2137890",
    "amount": 0.5,
    "type": 2,
  }
}