Skip to content

EWB

About This Page

What: East West Bank's CSV/BAI2 file import deposit, main account & sub-account dual matching rules, and wire transfer withdrawal business rules Audience: PMs needing to understand EWB integration details Prerequisites: Bank Capability MatrixReading time: 4 minutes Owner: Deposit Product Manager

Key takeaway: EWB imports bank statements via CSV/BAI2 files, supports main account and sub-account dual matching modes, primarily serving cross-border wire transfer scenarios.


Capability Overview

CapabilitySupportedProtocol/ChannelCore Service
Deposit Statement CollectionCSV + BAI2 file import (manual upload)Operations staff manual import
Wire Transfer WithdrawalTelegraphic Transfermethod=ewb
Sub-accountMain account(34) + Sub-account(38)EwbMatch / EwbSubAccountMatch
eDDA/eDDI
FPS
BST

EWB is the only bank using file import for statement collection — no real-time API. Operations staff manually upload CSV or BAI2 files, the system parses them and feeds into the matching engine. It also supports two independent matching logic sets for main account and sub-account.


Channel Interface Overview

DimensionDescription
ProtocolFile import (no real-time API)
Data FormatCSV and BAI2 formats
Collection MethodOperations staff manual file upload
IMPORT_BANK_ID34 (main account VELO) / 38 (sub-account EWB_SUBACC)
TransType207 (VELO) / 217 (EWB_SUBACC)

Deposit: CSV File Import

What is CSV/BAI2 Import

EWB doesn't provide a real-time API. The bank provides transaction data files via email or portal. Operations staff download and manually upload to the deposit system, which parses the file content and writes statements to the database before entering the matching engine.

Data Flow

CSV File Format

CSV is EWB's most common statement file format, comma-separated, containing the following key fields:

FieldDescriptionExample
Transaction DateTransaction date2026-04-28
Value DateValue date2026-04-28
DescriptionTransaction description/summaryWire Transfer / Other Deposit
Debit AmountDebit amount
Credit AmountCredit amount (deposit-relevant field)10000.00
CurrencyCurrencyHKD / USD
Payer NamePayer nameCHAN TAI MAN
Payer AccountPayer account
Reference NoTransaction reference numberUsed for deduplication
TypeTransaction typeWire Transfer / Other Deposit

BAI2 File Format

BAI2 (Bank Administration Institute Version 2) is a US banking industry standard reconciliation file format using fixed-format record header/body/trailer structure:

Record TypeCodeDescription
File Header01File header, contains sender/receiver identifiers
Group Header02Group header, contains bank identifier and date
Account Header03Account header, contains account number and balance info
Transaction Detail16Transaction detail (deposit core data)
Account Trailer49Account trailer, contains summary info
Group Trailer98Group trailer
File Trailer99File trailer
BAI2 Transaction Detail (Record 16) Field Description
Field PositionDescriptionPurpose
Type CodeTransaction type codeDistinguish debit/credit, wire/other
AmountTransaction amountMatching core
Fund TypeFund typeImmediate/1-day/2-day availability
Bank ReferenceBank reference numberDeduplication unique key
Customer ReferenceCustomer reference numberSupplementary identifier
TextDescription textContains payer information

Matching Rules: Dual Engine Architecture

EWB is the only bank using two independent matching engines — main account and sub-account each have their own set of rules, operating independently.

Engine 1: EWB Standard Match (ID:34, EwbMatch)

Used for processing main account (bank_id=34) deposit statements.

DimensionRule
Auto-depositDisabled (code commented out return MatchResult::depositInstance)
HKD Amount ToleranceCRM - 420 ≤ Statement ≤ CRM
USD Amount ToleranceCRM - 60 ≤ Statement ≤ CRM
Date WindowStandard daySimilar
Matching EngineEwbMatch.php

Why is HKD tolerance as high as -420? EWB deposits are primarily wire transfers. International wire transfers may deduct 20-400 HKD in fees through intermediary banks, hence the tolerance is set to the largest among all banks at -420.

Matching Logic:

Condition CombinationMatch ResultDescription
Amount exactly equal + Name exact matchStandard MatchIdeal scenario
type="Other Deposit" + Amount exactly equalStandard MatchName not checked (see explanation below)
Name similar + Amount within toleranceStandard MatchAllows fee deductions
OtherNo match

"Other Deposit" Special Rule

When the statement type is "Other Deposit", the system only checks amount, not name. These statements are typically bank internal adjustments or batch credits where payer information is inaccurate or missing; enforcing name matching would cause missed matches.

Engine 2: EWB Sub-Account Match (ID:38, EwbSubAccountMatch)

Used for processing sub-account (bank_id=38) deposit statements, with stricter rules than main account but supports auto-deposit.

DimensionRule
Auto-depositEnabled
Auto-deposit HKD ToleranceCRM - 40 ≤ Statement ≤ CRM
Assisted Match HKD ToleranceCRM - 100 ≤ Statement ≤ CRM
Supported CurrenciesHKD only
Matching EngineEwbSubAccountMatch.php

Why is sub-account tolerance smaller? Sub-account deposits are typically local transfers with lower and more predictable fees, not requiring the large tolerance buffer needed for main account wire transfers.

Matching Logic:

Condition CombinationMatch Result
Currency=HKD + Amount within auto-deposit tolerance (-40~0)Auto-deposit (Deposit Match)
Currency=HKD + Amount within assisted match tolerance (-100~0)Standard Match
OtherNo match

Dual Engine Comparison

DimensionMain Account (ID:34)Sub-Account (ID:38)
Match ClassEwbMatchEwbSubAccountMatch
Auto-deposit❌ Disabled✅ Enabled
HKD Tolerance-420 ~ 0-40 (auto) / -100 (assisted)
USD Tolerance-60 ~ 0❌ Not supported
Name CheckExact or similarN/A (sub-account proves ownership)
Special RulesOther Deposit exempts nameHKD only

Withdrawal: Wire Transfer (Telegraphic Transfer)

Withdrawal Method

DimensionDescription
Method CodeTRANSFER_METHOD_EWB = 'ewb'
ClassificationWire transfer method (allTeleMethod)
NameEWB Wire Transfer
Automation LevelSemi-automated (requires operations action)
Follow-up Time3 days

Wire Transfer Withdrawal Data Flow

Why is follow-up time 3 days? International wire transfers typically take 1-3 business days to arrive. Operations staff need to track bank-side processing status during this period.


Sub-Account System

EWB uses a main account + sub-account dual-layer architecture, distinguished by different bank_ids:

bank_idNameTypeTransTypeMatching EnginePurpose
34VELOMain Account207EwbMatchStandard wire transfer deposits
38EWB_SUBACCSub-Account217EwbSubAccountMatchSub-account deposits

Business difference between main and sub-accounts:

  • Main Account: All users share one receiving account number; after deposit, matched to specific users via name + amount
  • Sub-Account: Each user is assigned a unique sub-account number; after deposit, ownership confirmed directly via account number, thus supporting auto-deposit

Change Guide

Change RequirementModification LocationDescription
Modify main account amount toleranceEwbMatch.phpamountSimilar()Adjust HKD -420 / USD -60 thresholds
Modify "Other Deposit" ruleEwbMatch.php → type judgment logicAdd/remove transaction types exempt from name matching
Enable main account auto-depositEwbMatch.php → uncomment depositInstance returnCurrently disabled, enabling requires risk assessment
Modify sub-account auto-deposit toleranceEwbSubAccountMatch.phpamountSimilarForAuto()Adjust HKD -40 threshold
Modify sub-account assisted match toleranceEwbSubAccountMatch.phpamountSimilar()Adjust HKD -100 threshold
Sub-account support for USDEwbSubAccountMatch.php → currency checkCurrently HKD only
Add new sub-account typeDatabase bank_id config + new Match classMust also register matching engine
Modify withdrawal follow-up timeWithdrawal follow-up configurationAdjust 3-day deadline
Modify withdrawal approval templateTask.php$stepTemplatesAdjust EWB wire transfer withdrawal approval flow
Modify CSV parsing rulesCSV file parsing serviceAdapt to bank-side field changes

Common Customer Complaints Top 3

#User FeedbackCauseCS Script
1"EWB deposit not arrived"CSV file not imported or format error"Your deposit is being processed, please contact customer service if it exceeds 2 business days"
2"EWB wire transfer withdrawal is slow"Cross-border wire transfers typically take 1-3 business days"Wire transfer withdrawals typically take 1-3 business days to arrive, please be patient"
3"Mixed up sub-account and main account"Bank ID 34(main) vs 38(sub) import error"Please confirm the account type for your deposit; if there's an error, please contact customer service for correction"

Monitoring & Alerts

Alert ItemTrigger ConditionSeverityHandling Steps
CSV file import failedFile format doesn't conform to BAI2 specificationHighCheck file encoding and delimiters, correct against template
File format changeEWB bank-side adjusted export formatHighObtain new format specification, update parsing logic
Main/sub-account file confusionWrong type of file importedMediumConfirm Bank ID (34=main account, 38=sub-account), re-import

After Reading

I want to...Go to
See EWB's position among all banksBank Capability Matrix
Understand the full matching engine logicMatching & Auto-Deposit
See another bank with sub-accounts (DBS)DBS
Check withdrawal channel execution detailsChannel Execution Manual
Look up TransType and Bank ID referenceDeposit Reference
Was this page helpful?

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