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
| Capability | Supported | Protocol/Channel | Core Service |
|---|---|---|---|
| Deposit Statement Collection | ✅ | CSV + BAI2 file import (manual upload) | Operations staff manual import |
| Wire Transfer Withdrawal | ✅ | Telegraphic Transfer | method=ewb |
| Sub-account | ✅ | Main 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
| Dimension | Description |
|---|---|
| Protocol | File import (no real-time API) |
| Data Format | CSV and BAI2 formats |
| Collection Method | Operations staff manual file upload |
| IMPORT_BANK_ID | 34 (main account VELO) / 38 (sub-account EWB_SUBACC) |
| TransType | 207 (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:
| Field | Description | Example |
|---|---|---|
| Transaction Date | Transaction date | 2026-04-28 |
| Value Date | Value date | 2026-04-28 |
| Description | Transaction description/summary | Wire Transfer / Other Deposit |
| Debit Amount | Debit amount | — |
| Credit Amount | Credit amount (deposit-relevant field) | 10000.00 |
| Currency | Currency | HKD / USD |
| Payer Name | Payer name | CHAN TAI MAN |
| Payer Account | Payer account | — |
| Reference No | Transaction reference number | Used for deduplication |
| Type | Transaction type | Wire 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 Type | Code | Description |
|---|---|---|
| File Header | 01 | File header, contains sender/receiver identifiers |
| Group Header | 02 | Group header, contains bank identifier and date |
| Account Header | 03 | Account header, contains account number and balance info |
| Transaction Detail | 16 | Transaction detail (deposit core data) |
| Account Trailer | 49 | Account trailer, contains summary info |
| Group Trailer | 98 | Group trailer |
| File Trailer | 99 | File trailer |
BAI2 Transaction Detail (Record 16) Field Description
| Field Position | Description | Purpose |
|---|---|---|
| Type Code | Transaction type code | Distinguish debit/credit, wire/other |
| Amount | Transaction amount | Matching core |
| Fund Type | Fund type | Immediate/1-day/2-day availability |
| Bank Reference | Bank reference number | Deduplication unique key |
| Customer Reference | Customer reference number | Supplementary identifier |
| Text | Description text | Contains 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.
| Dimension | Rule |
|---|---|
| Auto-deposit | ❌ Disabled (code commented out return MatchResult::depositInstance) |
| HKD Amount Tolerance | CRM - 420 ≤ Statement ≤ CRM |
| USD Amount Tolerance | CRM - 60 ≤ Statement ≤ CRM |
| Date Window | Standard daySimilar |
| Matching Engine | EwbMatch.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 Combination | Match Result | Description |
|---|---|---|
| Amount exactly equal + Name exact match | Standard Match | Ideal scenario |
| type="Other Deposit" + Amount exactly equal | Standard Match | Name not checked (see explanation below) |
| Name similar + Amount within tolerance | Standard Match | Allows fee deductions |
| Other | No 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.
| Dimension | Rule |
|---|---|
| Auto-deposit | ✅ Enabled |
| Auto-deposit HKD Tolerance | CRM - 40 ≤ Statement ≤ CRM |
| Assisted Match HKD Tolerance | CRM - 100 ≤ Statement ≤ CRM |
| Supported Currencies | HKD only |
| Matching Engine | EwbSubAccountMatch.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 Combination | Match 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 |
| Other | No match |
Dual Engine Comparison
| Dimension | Main Account (ID:34) | Sub-Account (ID:38) |
|---|---|---|
| Match Class | EwbMatch | EwbSubAccountMatch |
| Auto-deposit | ❌ Disabled | ✅ Enabled |
| HKD Tolerance | -420 ~ 0 | -40 (auto) / -100 (assisted) |
| USD Tolerance | -60 ~ 0 | ❌ Not supported |
| Name Check | Exact or similar | N/A (sub-account proves ownership) |
| Special Rules | Other Deposit exempts name | HKD only |
Withdrawal: Wire Transfer (Telegraphic Transfer)
Withdrawal Method
| Dimension | Description |
|---|---|
| Method Code | TRANSFER_METHOD_EWB = 'ewb' |
| Classification | Wire transfer method (allTeleMethod) |
| Name | EWB Wire Transfer |
| Automation Level | Semi-automated (requires operations action) |
| Follow-up Time | 3 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_id | Name | Type | TransType | Matching Engine | Purpose |
|---|---|---|---|---|---|
| 34 | VELO | Main Account | 207 | EwbMatch | Standard wire transfer deposits |
| 38 | EWB_SUBACC | Sub-Account | 217 | EwbSubAccountMatch | Sub-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 Requirement | Modification Location | Description |
|---|---|---|
| Modify main account amount tolerance | EwbMatch.php → amountSimilar() | Adjust HKD -420 / USD -60 thresholds |
| Modify "Other Deposit" rule | EwbMatch.php → type judgment logic | Add/remove transaction types exempt from name matching |
| Enable main account auto-deposit | EwbMatch.php → uncomment depositInstance return | Currently disabled, enabling requires risk assessment |
| Modify sub-account auto-deposit tolerance | EwbSubAccountMatch.php → amountSimilarForAuto() | Adjust HKD -40 threshold |
| Modify sub-account assisted match tolerance | EwbSubAccountMatch.php → amountSimilar() | Adjust HKD -100 threshold |
| Sub-account support for USD | EwbSubAccountMatch.php → currency check | Currently HKD only |
| Add new sub-account type | Database bank_id config + new Match class | Must also register matching engine |
| Modify withdrawal follow-up time | Withdrawal follow-up configuration | Adjust 3-day deadline |
| Modify withdrawal approval template | Task.php → $stepTemplates | Adjust EWB wire transfer withdrawal approval flow |
| Modify CSV parsing rules | CSV file parsing service | Adapt to bank-side field changes |
Common Customer Complaints Top 3
| # | User Feedback | Cause | CS 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 Item | Trigger Condition | Severity | Handling Steps |
|---|---|---|---|
| CSV file import failed | File format doesn't conform to BAI2 specification | High | Check file encoding and delimiters, correct against template |
| File format change | EWB bank-side adjusted export format | High | Obtain new format specification, update parsing logic |
| Main/sub-account file confusion | Wrong type of file imported | Medium | Confirm Bank ID (34=main account, 38=sub-account), re-import |
After Reading
| I want to... | Go to |
|---|---|
| See EWB's position among all banks | Bank Capability Matrix |
| Understand the full matching engine logic | Matching & Auto-Deposit |
| See another bank with sub-accounts (DBS) | DBS |
| Check withdrawal channel execution details | Channel Execution Manual |
| Look up TransType and Bank ID reference | Deposit Reference |