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

# Withdrawal Failure Notification Callback

`NOTIFY_INVALID_ADDRESS` (type=5)

When a withdrawal operation fails due to an invalid address or other reasons, WaaS notifies the merchant through this callback: **This withdrawal operation has been completely terminated, and user funds can be safely unfrozen**

### Key Points

1. **Operation Termination**: This withdrawal operation will not be retried or completed
2. **Fund Safety**: Merchant can unfreeze user funds
3. **Failure Reasons**:
   * Invalid address (format error or blacklisted address)
   * Target chain does not support the asset
   * Other technical limitations preventing withdrawal completion

### Request Parameters

The request is an **RSA-encrypted Base64 string**. Merchants need to decrypt to obtain business parameters:

<ResponseField name="Withdrawal Failure Request Parameters" type="object">
  <Expandable title="View Full Parameter List">
    <ResponseField name="callBackId" type="String" required="Yes" example="D846735969">
      Merchant must ensure the uniqueness of this callBackId. WaaS will actively callback the merchant carrying this parameter to notify which withdrawal order has failed.
    </ResponseField>

    <ResponseField name="toAddress" type="String" required="Yes" example="TGDHyoMpgDQj4DmoZdwJP2FSkSG4DEchn2">
      Target withdrawal address that triggered the failure
    </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:

      **tenantUserId** (String) : User ID initiating withdrawal (in merchant system, not WaaS system)

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

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

      **type** (String) : Callback type

      **requestUUID** (String) : Unique request identifier, merchant must return the same requestUUID in response to help WaaS confirm
    </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 Request After Decryption
  {
    "business": 0,
    "requestUUID": "47b8d46c-12c9-4d64-98a0-ad1fbb6d0c29",
    "tenantUserId": "ryan_test_3",
    "callBackId": "D846735969",
    "type": 5,
    "toAddress": "TGDHyoMpgDQj4DmoZdwJP2FSkSG4DEchn2",
    "trackingId": "102007"
  }
  ```
</RequestExample>

<ResponseExample>
  ```mdx Response Parameter Structure After Decryption
  {
    "apiKey": "88c47568-8d24-4983-9b4c-y1ec8b939e9b",
    "data": "{\"tenantUserId\":\"ryan_test_3\",\"callBackId\":\"D846735969\",\"trackingId\":\"102007\",\"requestUUID\":\"47b8d46c-12c9-4d64-98a0-ad1fbb6d0c29\",\"type\":5}"
    "errCode": 0,
    "message": ""
  }
  ```
</ResponseExample>
