Withdrawal Data Dictionary
About This Page
What: All code tables, database table structures, and field meanings related to withdrawals — pure reference type Audience: Product managers and operations staff who need to look up specific numbers/codes Prerequisites: None, refer anytime. For business explanations of rules see Withdrawal Rules ManualReading time: Reference type, search as needed Owner: Withdrawal Product Manager
Withdrawal Task Status Codes
| Status Code | Constant | Meaning | Description |
|---|---|---|---|
| 0 | PENDING | Pending | Task created, awaiting approval |
| 1 | PROCESSING | Processing | Approval in progress (Audit / Confirm / Remittance) |
| 2 | DONE | Completed | Withdrawal successful, funds remitted |
| 3 | REJECTED | Rejected | Approval not passed or risk control intercept |
| 4 | WITHDRAW | Withdrawn | User actively cancelled |
| 5 | REVERSE | Reversed | Remitted funds have been reversed |
Withdrawal Action Codes
| Action | Meaning | Description |
|---|---|---|
| NEXT | Submit to next step | Approval passed, advance to next step |
| REJECTED | Reject | Reject withdrawal application |
| CANCEL | User cancel | User actively cancels withdrawal |
| REVERSE | Reversal | Reverse already remitted funds |
| FOLLOW | Follow up | Mark as being followed up |
| CANCEL_FOLLOW | Cancel follow-up | Remove follow-up mark |
| TRANSFER | Transfer | Transfer task to another person for handling |
Withdrawal Channel Codes
| Channel Key | Name | Mode | Supported Banks |
|---|---|---|---|
auto_bs | BST | BST | CMB, CMBC, Airstar |
hsbc | HSBC Online Banking | Online Banking | HSBC |
hase | Hang Seng Online Banking | Online Banking | Hang Seng |
boc_fps | BOC FPS | FPS | BOC |
cgb_fps_api | CGB FPS | FPS | CGB |
sc | Standard Chartered | FPS | SCB |
boc | BOC Same-bank | Traditional | BOC |
manual | ICBC Manual | Traditional | ICBC Asia |
chats_rtgs | CHATS/RTGS | Traditional | HK banks |
tele_transfer | Cross-border Wire | Traditional | BOC (cross-border) |
ewb | EWB Wire | Traditional | EWB |
check | Cheque | Traditional | — |
BST Authorization (Mandate) Status Codes
| Status | Meaning | Description |
|---|---|---|
| CLOSE | Not authorized | Initial state or cancelled, cannot deposit/withdraw |
| PROCESSING | Authorizing | Waiting for bank processing, cannot deposit/withdraw |
| OPEN | Authorized | Can deposit/withdraw normally |
| WAITING | Awaiting confirmation | User needs to confirm on bank side |
| FAIL | Authorization failed | Bank rejected, need to re-initiate |
| CANCEL | Cancelled | User or system cancelled |
Authorization vs Agreement
CMB/CMBC use "BST agreement", Airstar uses "Mandate authorization". Different terminology, same business meaning. Status code differences see BST Overview.
Bank Callback Result Codes
CMB / CMBC BST Callback
| Result Code | Meaning | System Handling |
|---|---|---|
| 0 | Success | Task → DONE, notify user |
| -5 | Timeout | Automatically switch to backup exit_server for retry |
| -6 | Bank rejection | Mark as failed, requires manual handling |
Airstar BST Status
Airstar uses polling mode, with independent status codes for deposits and withdrawals:
Deposit status:
| Status | Meaning |
|---|---|
| NEW | Instruction created |
| PENDING | Bank processing |
| SUCCESS | Deposit arrived |
| FAILED | Failed |
| REFUNDED | Refunded (Airstar exclusive) |
Withdrawal status:
| Status | Meaning |
|---|---|
| NEW | Instruction created |
| PENDING | Bank processing |
| SUCCESS | Withdrawal complete |
| FAILED | Failed |
Airstar Error Codes
140630xxx Series (Bank → moomoo)
| Error Code | Meaning | Common Cause |
|---|---|---|
| 14063001x | Authorization-related errors | Mandate status abnormal, authorization expired |
| 14063002x | Deposit-related errors | Amount exceeds limit, account abnormal |
| 14063003x | Withdrawal-related errors | Insufficient balance, account frozen |
140630xxx Series (Bank Error Codes, Detailed)
| Error Code | Meaning | Description |
|---|---|---|
| 140630001 | Parameter error, transfer failed | Request parameter error |
| 140630002 | Agreement does not exist, transfer failed | BST authorization does not exist |
| 140630003 | Transfer amount exceeds remaining limit | Exceeds BST transfer quota |
| 140630005 | Customer account balance insufficient | Bank account balance insufficient |
| 140630007 | Customer account number error | Bank account number incorrect |
| 140630008 | Customer name error | Name does not match bank records |
| 140630009 | Customer status does not allow deposit | Deposit-specific |
| 140630010 | Customer status does not allow withdrawal | Withdrawal-specific |
| 140630099 | System reason, transfer failed | Catch-all error |
140670xxx Series (Pre-check Error Codes)
| Error Code | Meaning | Check Type |
|---|---|---|
| 140670001 | Authorization expired, cannot deposit/withdraw | Authorization check |
| 140670002 | Authorized bank card does not exist, cannot deposit/withdraw | Authorization check |
| 140670003 | Risk control restriction, cannot deposit/withdraw | Risk control check |
| 140670004 | Account has outstanding debt, cannot withdraw | Negative equity check |
| 140670005 | Securities account balance insufficient, cannot withdraw | Risk control check |
| 140670006 | Dormant account, cannot deposit | Account check |
| 140670007 | Securities account does not exist/closed, cannot deposit/withdraw | Account check |
| 140670008 | NSS questionnaire not completed, cannot withdraw | Audit check |
| 140670009 | GDCA not completed, cannot deposit/withdraw | Audit check |
| 140670010 | Online account opening new card binding, deposit amount cannot be less than 10000 | Audit check (deposit) |
| 140670011 | Online account opening new card binding, deposit not yet exceeding 10000, cannot withdraw | Audit check (withdrawal) |
| 140670012 | Review rejected withdrawal request | Business rejection |
| 140670099 | Other error, system abnormal | Catch-all |
140600xxx Series (Authorization Error Codes)
| Error Code | Meaning |
|---|---|
| 140600001 | Bank rejected authorization |
| 140600002 | Mobile number does not match bank registration |
| 140600003 | Account name does not match bank registration |
| 140600004 | ID information does not match bank registration |
| 140600005 | Bank account number error |
| 140600099 | Bank rejected authorization (catch-all) |
INFO
Complete BST bank-specific error code reference table see BST Overview § Error Codes.
Bank Channel Type Codes (TransType)
BST Channels
| TransType | Code | Bank | Purpose |
|---|---|---|---|
| 101 | BST_CMBC | CMBC BST | Deposit/Withdrawal |
| 102 | BST_CMBCCHINA | CMB BST | Deposit/Withdrawal |
| 304 | ASB_BST | Airstar BST | Deposit/Withdrawal |
Bank Direct Connect Channels
| TransType | Code | Bank | Purpose |
|---|---|---|---|
| 201 | HANGSENG | Hang Seng Bank | Deposit |
| 202 | ICBCASIA | ICBC Asia | Deposit |
| 203 | BANKCOMM | Bank of Communications | Deposit |
| 204 | CMBC | CMBC Bank | Deposit |
| 205 | CMBCCHINA | CMB Bank | Deposit |
| 207 | VELO | Velo Bank (sub-account) | Deposit |
| 209 | ANZ | ANZ Bank | Deposit |
| 220 | SGICBC_SUBACC | Singapore ICBC (sub-account) | Deposit |
| 301 | BOC | BOC B2E | Deposit |
| 302 | HASE_EDDI | Hang Seng eDDA/eDDI (deposit direct debit) | Deposit only |
| 303 | HSBC_EDDI | HSBC eDDA/eDDI (deposit direct debit) | Deposit only |
SBA Procedure Status Codes
Main Status
| Status | Meaning | Is Terminal |
|---|---|---|
new | Newly created | No |
pending | Deduction complete, awaiting/executing transfer | No |
end_ok | Withdrawal successful | Yes |
end_reject | Withdrawal rejected | Yes |
end_cancel | Withdrawal cancelled | Yes |
end_reverse | Withdrawal reversed | Yes |
Sub-status (ext_status)
| Main Status | Sub-status | Meaning | User-Visible Status |
|---|---|---|---|
| new | freeze | Awaiting freeze | Processing |
| new | (empty) | Awaiting deduction | Processing |
| new | waiting | Cancellable | Processing (cancellable) |
| new | manual_confirm | Pending manual confirmation | Processing |
| new | confirmed | Confirmed | Processing |
| pending | deduct_done | Deduction complete | Processing |
| pending | transfer_auto | Auto transfer in progress (BST) | Processing |
| pending | transfer_manual | Awaiting manual transfer | Processing |
| pending | transfer_done | Transfer complete | Processing |
| pending | transfer_reject | Transfer rejected | Processing |
| pending | unfreeze | Unfreezing | Processing |
| pending | move_next | Deferred to next trading day | Processing |
| pending | waiting_trade | Waiting for trading day | Processing |
| end_ok | transfer_done | Final success | Completed |
Core Field Descriptions
Withdrawal Task Fields (Task)
| Field | Business Meaning |
|---|---|
tid | Withdrawal task ID (unique identifier) |
uid | User ID (moomoo account number) |
amount | Withdrawal amount |
currency | Currency: HKD / USD / CNH / JPY / SGD |
method | Withdrawal channel key, may be null (requires manual selection) |
status | Task status (0~5) |
sub_status | Sub-status — channel-specific subprocess status |
template | Approval template key |
step | Current approval step (audit / confirm / remittance) |
procedure_id | SBA Procedure ID |
bank_card_id | User bank card ID |
bank_id | Bank ID (BST bank identification) |
import_bank_id | Receiving bank ID (user side) |
export_bank_id | Paying bank ID (company side) |
fee | Withdrawal fee (currently all 0) |
real_amount | Actual arrived amount |
high_risk | High-risk bitmask value |
Approval Flow Fields (Flow)
| Field | Business Meaning |
|---|---|
task_id | Associated withdrawal task ID |
step | Approval step |
action | Action (NEXT / REJECTED / CANCEL etc.) |
operator_id | Operator ID (0 = system automatic) |
operator_name | Operator name |
remark | Remarks |
create_time | Operation time |
Database Table Overview
The withdrawal system has 10 core tables:
Main Tables
| Table Name | Purpose | Key Fields |
|---|---|---|
| tasks | Withdrawal task main table | tid, uid, status, method, template, step, procedure_id, amount, currency |
| task_log | Status change log | tid, old_status, new_status, operator, time |
| flows | Approval operation flow | task_id, step, action, operator_id, remark |
| sba_list | Task-SBA association | tid, procedure_id, request_id, sba_status, ext_status |
Queue Tables
| Table Name | Purpose | Key Fields |
|---|---|---|
| queue | Async event queue | event, tid, start_time, processing, retry_times, lock |
Bank Tables
| Table Name | Purpose | Key Fields |
|---|---|---|
| cmb_list | CMB bank-side withdrawal records | serial_id, uid, amount, currency, status(0-3), tid |
| ms_list | CMBC bank-side withdrawal records | ref_no, sec_ac(uid), amt, ccy, status(0-3), tid |
| task_cgb_fps | CGB FPS withdrawal status | tid, api_status, batch_no, trace_no, error_code |
Configuration and Auxiliary Tables
| Table Name | Purpose | Key Fields |
|---|---|---|
| auto_settings | BST auto-withdrawal configuration | id(bank), {hk/us/cn}_status, amount, max_amount, alarm_amount, stop_amount |
| bank_card_status | Bank card currency availability status | bank_card_id, hkd_status, usd_status, cnh_status |
| check_extra | Cheque withdrawal extra info | tid, check_id, check_date, print_status |
| nick_list | User Chinese/English name cache | uid, nick_cn, nick_en (for CHATS/RTGS) |
If requirements change: Adding new withdrawal channel tables
Reference the task_cgb_fps pattern: Create an independent status tracking table for each channel with API integration. Must include at minimum tid, api_status, error_code, trace_no.
What to Read Next
| I want to... | Go to |
|---|---|
| See why a specific rule exists and whether it can be changed | Withdrawal Rules Manual |
| Understand how a withdrawal flows end-to-end | Withdrawal Lifecycle |
| See a specific channel's technical execution details | Channel Execution Manual |
| Troubleshoot a withdrawal issue by symptom | Withdrawal Troubleshooting |
| Look up more terms and abbreviations | Glossary |