Skip to content

ICBC Asia

About This Page

What: ICBC Asia channel-side interface specification + moomoo-side adaptation logic Audience: PMs understanding integration details / developers locating code / operations understanding bank characteristics Prerequisites: Bank Capability MatrixReading time: 8 minutes Owner: Deposit & Withdrawal Product Team

Key takeaway: ICBC Asia is a representative traditional deposit channel — API scheduled pull for statements, supporting only manual withdrawal and wire transfer, no FPS, no BST, no eDDA.


Capability Overview

CapabilitySupportedProtocol/ChannelCore Service
Deposit Statement CollectionBank-Enterprise Direct REST APIicbc_be_relay (Python)
WithdrawalManual withdrawal (operations use corporate online banking)method=manual
FPS DepositStatement matching → auto-deposit possibleIcbcasiaMatch
Online Banking DepositStatement matching → auto-deposit possibleIcbcasiaMatch
Remittance DepositStatement matching → auto-deposit possibleIcbcasiaMatch
ATM Deposit⚠️Statement matching → no auto-depositManual review
Cheque Deposit⚠️Statement matching → no auto-depositManual review
eDDA/eDDI
BST
IdentifierValue
IMPORT_BANK_ID10 (ICBCASIA)
TransType202
Matching Commandmatch:main icbc-new (every 3 minutes)

ICBC Asia has relatively mature interfaces among Chinese-funded banks — collecting statements in real-time via Bank-Enterprise Direct API, supporting auto-deposit for FPS/online banking/remittance. Withdrawal is manual mode, with operations staff operating in corporate online banking.


Channel Interface Overview

ICBC Asia connects through the "Bank-Enterprise Direct Connection" protocol, which is a standardized interface solution for enterprise customers among Chinese-funded banks.

DimensionDescription
Transport ProtocolHTTPS REST
Data FormatJSON
AuthenticationRSA2 signing (private key signs biz_content, bank public key verifies)
Paginationcursor-based (next_tag field)
Core Serviceicbc_be_relay (Python)

RSA2 Signing Mechanism

Every request requires RSA2 signature verification, with bidirectional verification ensuring data integrity:

msg_id generation rule: "futu" + millisecond timestamp + 2 random digits, ensuring global uniqueness per request.


Channel-Side Interface Details

Statement Query Interface

This is ICBC Asia's core interface, used to pull transaction statements for a specified date range and currency.

Request Parameters

FieldTypeRequiredDescription
app_idstringApplication identifier. Production environment configuration
msg_idstringUnique transaction number. e.g. "futu" + millisecond timestamp + 2 random digits
sign_typestringSignature type. Value "RSA2"
signstringSignature value. RSA private key signature of biz_content
timestampstringRequest time. Format "YYYY-MM-DD HH:MM:SS"
biz_content.account_nostringBank account number. moomoo's receiving account at ICBC
biz_content.bank_codestringBank code. ICBC Asia bank code
biz_content.begin_datestringStart date. Format "YYYYMMDD"
biz_content.end_datestringEnd date. Format "YYYYMMDD"
biz_content.currencystringCurrency. Values HKD / USD / CNH
biz_content.min_amountstringMinimum amount. Filter small transactions
biz_content.trans_codestringTransaction type code. Hardcoded (production-specific value)
biz_content.cisstringClient system ID. Hardcoded
biz_content.login_idstringLogin ID. Hardcoded
biz_content.next_tagstringPagination marker. Empty for first request; pass bank-returned next_tag value for subsequent requests

Response Parameters

FieldTypeDescription
debit_amountdecimalDebit amount (unit: cents, no decimal point)
credit_amountdecimalCredit amount (unit: cents, no decimal point)
balancedecimalBalance after transaction (unit: cents)
th_currencystringCurrency (determined by account type)
busi_timestringTransaction time HHMMSS (used for sorting and deduplication)
remarksstringTransaction remarks (contains transaction type, payer information)
datestringTransaction date YYYYMMDD
timestringTime HHMMSS

Amount Unit Note

ICBC Asia returns amounts in cents without decimal points. For example, 100 yuan is actually returned as 10000. The system must divide by 100 when parsing to convert to yuan. This differs from most banks that directly return yuan/decimal format, and is the most common source of errors in ICBC integration.

Error Codes

Error CodeMeaningHandling
622394HTTP request errorAuto retry, log
625565Public key signature verification failedCheck RSA key pair correctness, verify key files
622395msg_id mismatchTechnical investigation, check request/response msg_id consistency
622396Abnormal return_codeCheck specific error information in bank response body
Error Code Configuration Location

Monitor metric IDs in icbc_be_relay correspond one-to-one with error codes, reporting to the monitoring system when triggered. See Unified Error Code Center.


Data Flow

Database Tables

TablePurposeKey Fields
raw_icbc_bank_flowRaw bank response, fully preservedFull JSON returned by bank
icbc_bank_flowParsed standardized statementscredit/debit (converted to yuan), date, time, remarks
icbc_balanceBalance snapshot (opening/closing balance)balance, date
icbc_be_next_tagPagination marker, records last pull positionnext_tag, account_no, currency

moomoo-Side Adaptation

Statement Standardization Mapping

Conversion from ICBC Asia raw fields to moomoo unified BankFlow format:

Bank Raw FieldBankFlow FieldConversion Logic
credit_amountcreditCents → Yuan (divide by 100)
debit_amountdebitCents → Yuan (divide by 100)
th_currencyccyMapped by account type (HKD/USD/CNH)
datedateDirect mapping YYYYMMDD
busi_timetimeDirect mapping HHMMSS
remarksremarksDirect mapping (contains transaction type labels)

Special Processing Rules

Amount Unit Conversion

ICBC Asia is currently the only bank returning amounts in cents. All amount fields (credit_amount, debit_amount, balance) must be divided by 100 before writing to the icbc_bank_flow table.

Card Number Processing

ICBC Asia card numbers are 12 digits total, where the last digit is a currency identifier. When matching user bank card numbers, the last digit must be removed before comparison.

ICBC card number: 123456789010  (12 digits, last digit "0" is currency identifier)
Matching uses:    12345678901   (remove last digit, take first 11)

Card Number Prefix Processing

Additionally, matching automatically removes 00 prefix — ICBC card number format is special, and some statements have card numbers padded with 00 prefix.

Deduplication Logic

Deduplication is based on the following four-field combination; statements with the same combination are only stored once:

Dedup key = date + time + remarks + credit + debit

Matching Rules (IcbcasiaMatch)

ICBC Asia's matching logic is divided into sub-account path and normal path — two completely different pipelines.

Dual-Path Routing

PathTrigger ConditionAuto-deposit?Amount Tolerance & Special Requirements
Sub-account pathStatement from sub-account❌ Assisted match onlySub-account SDK verification
Normal path — ExactAmount exact + Name EN+CN dual match0 (FPS) / -20 HKD / -3 USD. Card number (remove last digit) + date window
Normal path — AssistedAmount within tolerance + Name similar-20 HKD / -3 USD. Card number (remove last digit) + date window

Full Match Conditions (Auto-deposit eligible)

All conditions must be met simultaneously:

DimensionRuleDescription
CurrencyExact matchStatement currency = Application currency
AmountCRM - 20 ≤ Statement ≤ CRM (HKD/CNH); CRM - 3 ≤ Statement ≤ CRM (USD)FPS requires exact amount match (tolerance=0)
NameEN and CN name dual verification both passStricter than other banks
Date Window-3 ~ +2 daysStandard daySimilar window
Card NumberExact match after removing last digitICBC 12-digit card number special processing

Assisted Match Conditions (Requires manual review)

DimensionRuleDescription
CurrencyExact match
AmountCRM - 20 ≤ Statement ≤ CRM (HKD/CNH); CRM - 3 ≤ Statement ≤ CRM (USD)Same tolerance as auto-deposit
NameSimilar match (nameSimilar)Non-exact match can still enter manual review
Date Window-3 ~ +2 days

Matching Capability by Deposit Method

Deposit MethodStatement Label (Chinese label in remarks)Auto-depositDescription
FPS TransferFPS 轉賬Amount must match exactly (tolerance=0)
Online Banking Transfer網上轉賬存款Standard tolerance allowed
Remittance Deposit匯款存入Standard tolerance allowed
ATM DepositATM-relatedAssisted match only, requires manual review
Cheque DepositCheque-relatedAssisted match only, requires manual review
Sub-account TransferSub-account pathAssisted match only, via sub-account SDK verification

Amount Tolerance Summary

CurrencyAuto-deposit / Assisted Match ToleranceATM Special ToleranceRemittance Special Tolerance (USD)
HKD/CNHCRM - 20 ≤ Statement ≤ CRMCRM - 10 ~ CRM
USDCRM - 3 ≤ Statement ≤ CRMCRM - 55 ~ CRM

Why does ATM have special tolerance? ATM deposits may incur small service fees (approximately 10 HKD), so ATM tolerance is set to CRM-10 ~ CRM.

Why is USD remittance tolerance larger? USD cross-bank remittances pass through intermediary banks, which may deduct up to 55 USD in fees, making USD remittance tolerance much larger than local transfer's -3.

Corresponding Code

deposit/src/app/Business/Match/IcbcasiaMatch.php — contains sub-account path routing and normal path complete matching logic. Statement type is routed to different rules via regex matching of Chinese labels in the remarks field.


Balance Continuity Tracking

The system tracks ICBC account balance changes daily to ensure statement data completeness:

Verification Formula

balance[today_start] + SUM(credit - debit) == balance[today_end]

Sorting and Value Extraction

  • Daily statements sorted by busi_time ASC
  • First record's balance = day's opening balance
  • Last record's balance = day's closing balance
  • If equation doesn't hold → statement data is incomplete, trigger alert

Date Switchover Logic

TimePull StrategyDescription
00:00 ~ 00:35Pull previous day's dataBank end-of-day settlement may be delayed, ensure previous day data is complete
After 00:35Pull current day's dataSwitch to current day real-time statements

Why 00:35? ICBC Asia's end-of-day batch processing usually completes around 00:30, with a 5-minute buffer before switching to the new day.


Async Tasks

TaskTrigger MethodDescription
icbc_be_relayCron scheduledPeriodically pull statements from ICBC API, store in raw and parsed tables
Daily completion00:00:10Pull previous day's complete statements every midnight, ensure no gaps
match:main icbc-newEvery 3 minutesExecute ICBC statement matching, attempt auto-deposit or assisted match

Withdrawal

ICBC Asia currently doesn't support API-automated withdrawal, using manual processing.

DimensionDescription
Method Codemanual (manual withdrawal)
Operation MethodOperations staff logs into ICBC corporate online banking, manually executes transfers
Follow-up Time3 days (longer than standard 1 day)
Reason for Longer Follow-upICBC Asia's statement arrival speed is slower; bank processing and statement reflection after withdrawal needs more time

Deposit Timeout Rules

After a user submits a deposit application, the system sets notification and rejection timeout days. After timeout, the system notifies the user or auto-rejects.

Deposit MethodSame Bank (Notification days + Rejection days)Cross-bank HKD/CNHCross-bank USD
FPS1 day + 1 day2~4 days + 1 day1~4 days + 1 day
Online Banking Transfer1 day + 1 day2~4 days + 1 daySame as left
ATM / Cheque2 days + 1 day2 days + 1 daySame as left

"Notification days + Rejection days" meaning: If no matching statement found after notification days → system notifies user to confirm; if still no match after rejection days → system auto-rejects the deposit application.


Bilateral Feature Matrix

FunctionChannel-Side (ICBC Asia)moomoo-SideStatus
Statement QueryBank-Enterprise Direct REST API + RSA2 signingicbc_be_relay scheduled pull✅ Live
Paginationnext_tag cursor mechanismicbc_be_next_tag table records progress✅ Live
BalanceEach transaction returns balanceicbc_balance table + continuity verification✅ Live
FPS DepositStatement label FPS 轉賬Exact match → auto-deposit✅ Live
Online Banking DepositStatement label 網上轉賬存款Exact match → auto-deposit✅ Live
Remittance DepositStatement label 匯款存入Tolerance match → auto-deposit✅ Live
ATM DepositATM transaction statementsAssisted match → manual review⚠️ No auto-deposit
Cheque DepositCheque transaction statementsAssisted match → manual review⚠️ No auto-deposit
WithdrawalCorporate online banking manual operationmethod=manual✅ Manual mode
eDDA/eDDINot supported
BSTNot supported

Change Guide

If you need to modify ICBC Asia-related business rules, here are the specific modification locations:

Change RequirementModification LocationDescription
Modify statement pull frequencyicbc_be_relay cron configurationAdjust scheduled task interval
Replace RSA keyicbc_be_relay/conf/API_GATEWAY.pubReplace public key file, restart service
Modify date switchover timerelay.py → 00:35 judgment logicAdjust end-of-day switchover threshold
Add currency queryrelay.pybiz_content.currency enumAdd new currency and configure corresponding receiving account
Modify matching amount toleranceIcbcasiaMatch.phplocalTransferSimilarAmountAdjust HKD -20 / USD -3 thresholds
Modify FPS exact match rulesIcbcasiaMatch.php → FPS branchAdjust FPS tolerance (currently=0)
Modify matching date windowIcbcasiaMatch.phpdaySimilarAdjust -3~+2 day parameters
Add auto-deposit-eligible statement typesIcbcasiaMatch.php → remarks regexAdd new Chinese label matching rules
Modify card number processing rulesIcbcasiaMatch.php → card number comparison logicAdjust remove-last-digit/remove-prefix strategy
Modify matching frequencydeposit/doc/crontab.shmatch:main icbc-newAdjust cron interval
Modify withdrawal follow-up daysWithdrawal configuration → manual method parametersAdjust 3-day follow-up period

Common Customer Complaints Top 3

#User FeedbackCauseCS Script
1"ICBC deposit not arrived"Bank-Enterprise Direct query timeout or statement not collected"Your deposit is being processed, please wait patiently for matching"
2"Deposit amount is wrong"ICBC uses cents unit, conversion differences possible"The system is verifying the amount, we will process any discrepancies promptly"
3"Why can't I withdraw via ICBC"ICBC only has deposit integration, no withdrawal support"ICBC currently only supports deposits, please use other bank channels for withdrawals"

After Reading

I want to...Go to
See ICBC's position among all banksBank Capability Matrix
Understand the full matching engine logicMatching & Auto-Deposit
Look up TransType and Bank ID referenceDeposit Reference
See BST banks (CMB/CMBC/Airstar)BST Banks
Understand statement collection's position in system architectureSystem Architecture & Data Flow
Was this page helpful?

内部业务文档 · 仅限 moomoo 团队使用