> ## Documentation Index
> Fetch the complete documentation index at: https://waasapi.uuwallet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Withdrawal Notification Callback

`NOTIFY_WITHDRAW` (type=3)

When a user completes a withdrawal operation through WaaS, WaaS will notify you of the withdrawal details through this callback. The merchant needs to confirm in the response whether this callback has been accepted.

### Request Parameters

The request sent by WaaS is an **RSA-encrypted Base64 string**. Merchants need to decrypt it using their public key to obtain the following business parameters:

<ResponseField name="Withdrawal Callback Request Parameters" type="object">
  <Expandable title="View Full Parameter List">
    <ResponseField name="type" type="Integer" required="Yes" example="3">
      Callback type, withdrawal callback=3
    </ResponseField>

    <ResponseField name="txId" type="String" required="Yes" example="598433d2fe70a2e944bbda8b517cca36e0cf7cfe49642b569e73cf1a64">
      Blockchain transaction hash
    </ResponseField>

    <ResponseField name="chainName" type="String" required="Yes" example="ETH">
      Chain name, e.g., TRON, ETH, BSC...
    </ResponseField>

    <ResponseField name="symbol" type="String" required="Yes" example="TRON">
      Token symbol, e.g., USDT, USDC, PHT...
    </ResponseField>

    <ResponseField name="amount" type="BigDecimal" required="Yes" example="2.500000000000">
      Actual withdrawal amount
    </ResponseField>

    <ResponseField name="fromAddress" type="String" required="Yes" example="TBmNNTP84QSRW8Dvb1aCBk7GmxQnNS5rAb">
      Withdrawal source address
    </ResponseField>

    <ResponseField name="toAddress" type="String" required="Yes" example="TGDHyoMpgDQj4DmoZdwJP2FSkSG4DEchno">
      Withdrawal target address
    </ResponseField>

    <ResponseField name="callBackId" type="String" required="Yes" example="250624392590001">
      callBackId carried by merchant when requesting withdrawal. Note: Merchant must ensure its uniqueness
    </ResponseField>

    <ResponseField name="newAddress" type="string" required="Yes" example="TYLdkix4wqk1wLXbqbxrrY1oi1mHEM6uwP">
      New address, replaces toAddress when type=4
    </ResponseField>
  </Expandable>
</ResponseField>

### Response Parameters

After processing the callback, merchants need to return a JSON-formatted response body. The `data` field must return an **RSA-encrypted Base64 string** (encrypted using the public key provided by WaaS), while other fields are in plain text:

<ResponseField name="Withdrawal Callback Response Parameters" type="object">
  <Expandable title="View Full Parameter List">
    <ResponseField name="apiKey" type="String" required="Yes" example="88c47568-8d24-4983-9b4c-y1ec8b939e9b">
      Merchant API key
    </ResponseField>

    <ResponseField name="data" type="String" required="Yes" example="BDn6Liv5Z4TJ9vjfdRiuq1gaQJuODth3zlC4...">
      Encrypted business data, e.g.: BDn6Liv5Z4TJ9vjfd (refer to example on right)

      Generated by encrypting the following raw business parameters:

      **requestUUID** (String) : The unique identifier of the request. The merchant must return the same requestUUID in the response to help WaaS confirm.

      **tenantUserId** (String) : User ID of the business operator.

      * ​​Description​​: The unique identifier of the user who initiated the business operation (withdrawal or energy rental) in the merchant's own system.

      * Important Note​​: This ID refers to the user in the merchant's system, not the merchant's identity ID on the WaaS platform.
        **type** (Integer) : Callback type

      **callBackId** : Merchant must return callBackId to help WaaS with secondary confirmation

      **trackingId** (String) : Business event identifier

      **txId** (String) : Blockchain transaction hash

      **chainName** (String) : Blockchain name

      **symbol** (String) : Token symbol

      **amount** (Integer) : Withdrawal amount

      **fromAddress** (String) : Withdrawal source address

      **toAddress** (String) : Withdrawal target address

      **txTimeStamp** (Long) : Timestamp of energy arrival (in milliseconds). Valid only when the business type is energy rental (symbol="ENERGY"); can be ignored for other business types.
    </ResponseField>

    <ResponseField name="errCode" type="Integer" required="Yes" example="0">
      Global processing status code:
      `0`=Success, non-`0`=Failure
    </ResponseField>

    <ResponseField name="message" type="String" required="Yes" example="">
      Error details (required when failed):

      * Can return empty string when successful
      * Must describe specific error when failed
    </ResponseField>
  </Expandable>
</ResponseField>

***

<RequestExample>
  ```mdx Raw Business Request Parameters Before Encryption theme={null}
  {
    "tenantUserId": "1945",
    "requestUUID": "00f2faf7-b705-4d65-9d82-0b6e372b92e4",
    "txId": "598433d2fe70a2e944bbda8b517cca36e0cf7cfe49642b569e73cf1a641148cb",
    "type": 3,
    "chainName": "TRON",
    "symbol": "USDT",
    "amount": "2.500000000000",
    "fromAddress": "TBmNNTP84QSRW8Dvb1aCBk7GmxQnNS5rAb",
    "toAddress": "TGDHyoMpgDQj4DmoZdwJP2FSkSG4DEchnK",
    "business": 0,
    "callBackId": "250624392590001",
    "newAddress": "TGDHyoMpgDQj4DmoZdwJP2FSkSG4DEchnK",
    "trackingId": "102003"
  }
  ```
</RequestExample>

<ResponseExample>
  ```mdx Response Parameter Structure After Decryption theme={null}
  {
    "apiKey": "88c47568-8d24-4983-9b4c-y1ec8b939e9b",
    "data": "{\"type\":3,\"callBackId\":\"250624392590001\",\"trackingId\":\"102003\",\"txId\":\"598433d2fe70a2e944bbda8b517cca36e0cf7cfe49642b569e73cf1a641148cb\",\"chainName\":\"TRON\",\"symbol\":\"USDT\",\"amount\":\"2.500000000000\",\"fromAddress\":\"TBmNNTP84QSRW8Dvb1aCBk7GmxQnNS5rAb\",\"toAddress\":\"TGDHyoMpgDQj4DmoZdwJP2FSkSG4DEchnK\",\"requestUUID\":\"00f2faf7-b705-4d65-9d82-0b6e372b92e4\",\"tenantUserId\":\"1945\"}",
    "errCode": 0,
    "message": ""
  }
  ```
</ResponseExample>
