Skip to content

Airstar Bank

About This Page

What: Airstar Bank BST channel-side REST API specification + moomoo-side adaptation logic Audience: PMs understanding integration details / developers locating code / operations understanding bank characteristics Prerequisites: BST Banks Overview, Bank Capability MatrixReading time: 10 minutes Owner: Deposit & Withdrawal Product Team

Key takeaway: Airstar is the only BST bank using REST API (not Socket). The polling model means response time is in minutes rather than seconds, but integration complexity is lower than CMB/CMBC.


Capability Overview

CapabilitySupportedProtocol/ChannelCore Service
BST DepositREST API (RSA-OAEP encryption)airstar_service (Go)
BST Withdrawalauto_bs automated BST withdrawalairstar_service (Go)
Mandate AuthorizationREST APIairstar_service (Go)
Online Account OpeningThree-in-one flow (open account + authorize + first deposit)airstar_service (Go)
eDDA Authorization
eDDI Direct Debit
FPS

Airstar Bank is the only virtual bank BST channel integrated with moomoo — unlike CMB/CMBC's traditional binary dedicated lines, Airstar uses modern REST API architecture, supports moomoo-initiated operations for all functions, and is the only BST bank fully supporting CNH.


Core Identifiers

IdentifierValueDescription
IMPORT_BANK_ID55System internal bank unique number
TransType304 (ASB_BST)Airstar BST dedicated type
AUTO_SETTING_ID3Auto-withdrawal configuration ID
Service Nameairstar_serviceCore BST service
Proto Fileairstar_service/proto/airstar_service.protoInterface definition
Code LanguageGoDifferent from CMB/CMBC's Python

Channel Interface Overview

DimensionDescription
Protocol TypeHTTP REST API
EncryptionRSA-OAEP (SHA1, 200-byte blocks, Base64 encoding)
Data FormatJSON (encrypted: {"messageBody": "base64..."})
Communication ModeHTTP request-response + polling
EncodingUTF-8
AuthenticationRSA key pair (not certificates)

Why Does Airstar Use REST Instead of Socket?

Airstar is a Hong Kong licensed virtual bank (licensed in 2019) with a fully cloud-native technical architecture. Traditional banks (CMB/CMBC) use Socket dedicated line communication for historical reasons; Airstar directly provides standard REST API — more developer-friendly, but requires moomoo-side to implement polling mechanism for async results.


Channel-Side Interface Details — 11 Bank-Side REST APIs + 14 Internal RPC Methods

Airstar provides 11 bank-side REST APIs + 14 internal RPC methods, covering the full lifecycle of authorization, deposit, and withdrawal:

Authorization Interfaces (4)

API NameEndpointDirectionPurpose
CreateAuth/authorization/applymoomoo → BankCreate eDDA authorization (Mandate)
QueryAuth/authorization/statusmoomoo → BankQuery authorization status
CancelAuth/authorization/cancelmoomoo → BankCancel authorization
NotifyAuthResult/authorization/resultmoomoo → BankNotify authorization approval result

Deposit Interfaces (2)

API NameEndpointDirectionPurpose
CreateTransfer (direction=deposit)/transfer/initmoomoo → BankInitiate deposit request
QueryTransfer (direction=deposit)/transfer/statusmoomoo → BankQuery deposit status (for polling)

Unified Transfer Interface

Airstar API uses a unified Transfer interface, distinguishing deposit and withdrawal via the transfer_direction field, rather than separate deposit/withdrawal endpoints.

Withdrawal/Refund Interfaces (2)

API NameEndpointDirectionPurpose
CreateWithdrawRefund/transfer/withdraw/reversalmoomoo → BankCreate withdrawal refund
QueryRefund/transfer/withdraw/reversal/statusmoomoo → BankQuery refund status

Account Interfaces (2)

API NameEndpointDirectionPurpose
QuerySecAccount/account/infomoomoo → BankQuery securities account info (balance, etc.)
NotifyDepositApproval/transfer/approvalmoomoo → BankNotify deposit approval result
All Interfaces Are moomoo-Initiated

Unlike CMBC (bank proactively pushes data to moomoo), Airstar's bank-side interfaces are all initiated by moomoo. This means moomoo has full process control, but also needs to handle polling, timeout handling, and other additional logic.


Core Interface Field Details

CreateAuthReq — Create Authorization Request

Request parameters when user initiates Mandate authorization from moomoo App:

FieldTypeRequiredDescription
request_idstring(16-50)Unique request ID. Idempotency guarantee, cannot be duplicated
ciduint64Customer ID. moomoo UID
bank_card_numberstring(12)Bank card number. Airstar bank card fixed 12 digits
id_card_typestringID document type. Values "HKID" or "CNID"
id_card_numberstring(1-35)ID document number. HKID/Home Return Permit number
en_namestring(1-127)English name. Must match bank-registered name
phone_numberstringPhone number. Format "+86-1XXX" or "+852-XXX"

Bank Card Number Fixed 12 Digits

Airstar bank card numbers are uniformly 12-digit numbers. Unlike traditional banks' 16-19 digit card numbers, developers must note length validation rules.

CreateAuthRsp — Authorization Response

FieldTypeDescription
codeuint32200 = Success, other = Failure
totaluint32Total associated UIDs
securities_client_nosarray[uint64]UID list

Note Response Direction

Note: CreateAuthRsp here are response fields for when the bank initiates authorization on the moomoo side, not the return after moomoo initiates authorization. The response for moomoo-initiated authorization creation is empty (no additional fields).

CreateDepositReq — Initiate Deposit Request

FieldTypeRequiredDescription
request_idstring(16-50)Request ID. Idempotency guarantee
ciduint64Customer ID. moomoo UID
market_iduint32Market ID. Values 1=HK, 2=US
account_iduint32Account ID. Securities account ID
currencystringCurrency. Values HKD / USD / CNH
amountstringAmount. String format, e.g. "50000.00"
bank_card_numberstring(12)Bank card number. 12-digit Airstar card
en_namestring(1-127)English name. Must match Mandate authorization

QueryDepositRsp — Deposit Query Response

Complete information returned when polling deposit status:

FieldTypeDescription
deposit_iduint64Deposit task ID (system-unique)
request_idstringRequest ID (corresponds to CreateDepositReq)
ciduint64Customer ID
currencystringCurrency
amountstringAmount
bank_card_numberstringBank card number
en_namestringCustomer name
ref_idstringmoomoo-side reference number
bank_ref_idstringBank-side reference number (key for reconciliation)
statusstringDeposit status (see table below)
fail_codestringFailure code (only has value on failure)
fail_reasonstringFailure reason description
sourcestringSource: 1=moomoo-side, 2=bank-side

Deposit Status Values

StatusMeaningDescriptionTerminal
newNewJust initiated deposit request
pendingProcessingBank is processing
successSuccessDeposit complete, funds credited
failedFailedBank rejected (insufficient balance/limit, etc.)
refundedRefundedAirstar-unique — bank refunds after successful deposit

QuerySecuritiesAccountRsp — Securities Account Query Response

Complete securities account information under Airstar authorization:

FieldTypeDescription
codeuint32200 = Success
statusstringAuthorization status (Mandate status)
depositobjectDeposit limit information
withdrawobjectWithdrawal limit information
securities_accountsarraySecurities account list
bankcard_infoobjectBank card information

SecuritiesAccount — Securities Account Details

FieldTypeDescription
market_iduint32Market ID (1=HK, 2=US)
account_numberstringSecurities account number (16 digits)
capital_infosarray[CapitalInfo]Capital information per currency
account_name_enstringEnglish account name
account_name_cnstringChinese account name (Simplified)
account_name_hkstringTraditional Chinese account name

CapitalInfo — Capital Information

FieldTypeDescriptionUnit
currencystringCurrencyHKD/USD/CNH
cash_withdrawal_amountuint64Withdrawable cashCents (divide by 100)
max_withdrawal_amountuint64Maximum withdrawable amountCents (divide by 100)

Amount Unit is Cents

Amount fields in CapitalInfo are in cents, not yuan. For example, cash_withdrawal_amount = 5000000 means 50,000.00 yuan. Development and operations must note unit conversion to avoid amount errors.


Key Differences from CMB/CMBC

DimensionCMB/CMBCAirstar
ProtocolSM2 encrypted Socket / ProtobufREST API + RSA-OAEP
Communication ModeSocket bidirectional link (bank push)HTTP request-response + polling
CNH SupportLimited / completely unsupportedFull support HKD + USD + CNH
Processing Session08:40 ~ 15:5908:30 ~ 15:59 (10 minutes earlier)
Deposit Result RetrievalSocket real-time pushUp to 60 polls
Withdrawal Result RetrievalSocket real-time pushUp to 10 polls + 2h fallback sync
Refund MechanismNoneHas REFUNDED status (requires reversal)
Authorization ModelBST agreement (2 states)Mandate authorization (6 states)
Online Account OpeningNot supportedSupports three-in-one flow
Initiatormoomoo only / Bank only (varies by interface)moomoo + bank bidirectional
Code LanguagePythonGo
Interface Count9 RPC11 bank-side REST APIs + 14 internal RPC methods
Data FormatBinary / ProtobufJSON

One-line summary: CMB/CMBC is bank-dominated dedicated line communication (push model); Airstar is moomoo-dominated API calling (polling model).


RSA-OAEP Encryption Scheme

Encryption Parameters

ParameterValueDescription
AlgorithmRSA-OAEPAsymmetric encryption + OAEP padding
Hash FunctionSHA1OAEP padding uses SHA1
Block Size200 bytes/blockPlaintext exceeding 200 bytes needs block encryption
EncodingBase64Base64-encoded after encryption

Encryption Flow

Request/Response Format

Encrypted request body:

json
{
  "messageBody": "dGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIGVuY3J5cHRlZCBtZXNzYWdl..."
}

Decryption flow (after receiving response):

  1. Extract Base64 string from messageBody
  2. Base64 decode to get ciphertext
  3. Block RSA-OAEP decrypt
  4. Concatenate plaintext → parse JSON
Security Comparison with CMBC SM2
DimensionCMBC SM2Airstar RSA-OAEP
Algorithm typeNational crypto elliptic curveRSA asymmetric
Key length256 bits2048+ bits
Compliance requirementMandatory for Chinese domestic banksInternational standard
Block processingNot needed200 bytes/block
PerformanceFasterSlower (large keys)
Airstar, as a Hong Kong virtual bank, is not subject to Chinese national crypto algorithm compliance requirements and thus uses the internationally standard RSA scheme.

Polling Strategy

Airstar doesn't support Socket push; all async operation results are obtained via polling. This is the most critical technical detail in Airstar integration.

Deposit Polling

Job NameResponsibilityPoll LimitFollow-up Action
AsbBstCreateJobSend deposit request to AirstarEnter polling after successful creation
AsbBstCreateResultJobPoll deposit resultMax 60 timesSuccess→credit / Failed→notify / Timeout→manual
AsbBstDepositJobExecute crediting after confirmationCreate deposit flow, update balance

Withdrawal Polling

Job NameResponsibilityPoll LimitFollow-up Action
AsbBstTransferWithdrawal instruction + result pollingMax 10 timesSuccess/Failed→process / Timeout→fallback
SyncAsbBstWithdrawFallback sync after timeout2-hour windowResult within window→process / Timeout→manual

Polling Timeout ≠ Transaction Failure

Polling timeout only means moomoo-side didn't get the bank-side result within expected time. The transaction may still be processing on the bank side. Operations encountering this situation should proactively contact Airstar to confirm transaction status; do not directly determine it as failed.


Limit System

Three-Tier Limit Configuration

Airstar uses the same three-tier limit system as CMB/CMBC, but with different specific values:

CurrencyPer-transaction MaxCumulative AlarmDaily Circuit Breaker
HKD3,000,00040,000,00015,000,000
USD500,00010,000,0003,000,000
CNH0 (no limit)0 (no alarm)0 (no circuit breaker)

CNH No Limits

Airstar's CNH limits are all set to 0, meaning no restrictions. This aligns with CNH being Airstar's exclusive advantage positioning — encouraging RMB deposits/withdrawals. However, actual operations are still subject to bank-side internal limits.

Circuit Breaker Mechanism

Circuit breaker trigger condition: Daily cumulative amount - Withdrawal amount < stop_amount

Circuit Breaker PhaseSystem Action
TriggerAutomatically close that currency's auto-withdrawal for the day
AlertFeishu message notifies operations team
RecoveryOperations manually restores after confirming risk is controllable, or auto-resets next day

Online Account Opening Minimum Deposit

CurrencyMinimum DepositDescription
HKD10,000Ensure new clients have sufficient trading capital
USD1,500
CNH10,000

Regular deposits have no minimum amount requirement; this limit only applies to the first deposit in the online account opening three-in-one flow.


REFUNDED Status (Airstar-Unique)

REFUNDED is Airstar's unique status distinguishing it from all other BST banks — the bank initiates a refund after successful deposit.

REFUNDED vs FAILED Comparison

DimensionFAILEDREFUNDED
MeaningBank rejects deposit requestBank refunds after successful deposit
FundsNever reached securities accountCredited then returned
Balance ImpactNone (never increased)Increased then must be deducted
Reversal OperationNot neededMust execute (auto-reversal)
User ExperienceDeposit failed notificationDeposit success then refund notification
PrevalenceAll banks have thisAirstar only

Reversal Flow

REFUNDED Trigger Scenarios

ScenarioDescription
Bank anti-fraudBank's risk control system detects abnormal transaction after deposit
Compliance requirementsRegulator requires specific transactions to be returned
User complaintUser disputes unauthorized transaction at bank
System errorBank-side double credit correction

Insufficient Balance During Reversal

If the user has already used deposited funds for trading (buying stocks, etc.) after successful deposit, there may be insufficient balance during reversal to deduct the full amount. This requires operations manual intervention — this is the most complex exception scenario for REFUNDED status.


Security Check (Airstar-Unique)

Airstar Bank adds risk level assessment to authorization and deposit flows — a mechanism traditional BST banks don't have:

Risk Level Handling

Risk LevelLevel ValueSystem ActionDescription
Level 0-2APPROVENormal passLow-risk transaction, auto-approved
Level 3MANUALRoute to manual reviewMedium risk, operations decides after manual review
Level 4REJECTDirect rejectionHigh risk, auto-reject transaction
VERIFYAdditional verification neededRequire user to complete extra identity verification

Risk Level Source

Risk levels are returned by the Airstar bank-side; moomoo-side decides handling based on them. The bank-side risk control model considers:

  • Whether transaction amount is abnormal
  • Whether transaction frequency is abnormal
  • Customer historical behavior
  • Device/IP risk
  • Anti-money laundering (AML) rules

Coordination with moomoo-Side Risk Control

Dual risk control means: A transaction may pass moomoo-side risk control (not on blacklist, not over limit) but be blocked by Airstar-side risk control (Level 3/4). Operations troubleshooting deposit/withdrawal failures should check risk control logs on both sides.


Deposit Flow

Two Deposit Sources

Sourcesource ValueDescription
moomoo-initiated1User taps deposit in moomoo App
Bank-initiated2User initiates transfer to securities account in Airstar Bank App

Bank-initiated (source=2) is Airstar-unique — CMB/CMBC BST deposits can only be initiated from the moomoo side.

Complete Deposit Flow

Deposit Trading Session

SessionTime RangeDescription
Normal trading session08:30 ~ 15:5910 minutes earlier than CMB/CMBC
Non-trading session16:00 ~ next day 08:29Does not accept new requests

Withdrawal Flow

Complete Withdrawal Flow

auto_bs Auto-Withdrawal Conditions

Airstar withdrawal uses auto_bs auto-withdrawal channel, AUTO_SETTING_ID = 3:

ConditionDescription
Mandate status = OPENAuthorization relationship valid
Account status normalNot frozen, not closed
Not on withdrawal blacklistBlacklist check passed
Per-transaction within limitHKD ≤ 3M / USD ≤ 500K
Daily not circuit-brokenToday's cumulative hasn't triggered stop threshold
Within trading session08:30 ~ 15:59
Risk level ≤ Level 2Airstar-side risk control passed

If any condition is not met, routes to manual approval. Note condition 7 (risk level) is an auto-withdrawal prerequisite unique to Airstar.


Online Account Opening (Airstar-Unique)

Airstar supports three-in-one online account opening — new customers complete everything within moomoo App:

Three-in-one vs Traditional Flow

StepTraditional Flow (CMB/CMBC)Three-in-one (Airstar)
Account openingComplete in moomoo AppComplete in moomoo App
AuthorizationGo to bank counter/online banking to signComplete Mandate within moomoo App
DepositReturn to moomoo App to depositComplete first deposit immediately
Total time1~3 days (including bank signing)A few minutes

First Deposit Limits

CurrencyMinimum DepositRegular Deposit MinimumMultiple
HKD10,000No requirement
USD1,500No requirement
CNH10,000No requirement

The higher minimum limit for first deposits ensures new customers have sufficient funds to trade, avoiding "register but don't trade" inactive users.


Exception Scenarios Handbook

Authorization Exceptions (5 Types)

#ExceptionSymptomCauseHandling
1Authorization stuck at PROCESSINGMandate has no status change for extended timeBank processing delayQuery QueryAuth to confirm status
2Authorization FAILCreateAuth returns failureName/ID mismatchVerify user information, guide retry
3Authorization CANCELUser cancelled at bankUser's deliberate actionConfirm user intent
4Partial market mapping failureSome of 3 markets have binding exceptionsMarket configuration issueManually supplement binding relationship
5CancelAuth failureCancel authorization request rejectedMandate not in OPEN stateCheck current status then retry

Deposit Exceptions (7 Types)

#ExceptionSymptomCauseHandling
1Deposit creation failureCreateDeposit returns errorParameter exception/Mandate not OPENCheck parameters and Mandate status
260-poll timeoutStatus stays pendingBank processing exceptionManually contact Airstar to confirm
3Deposit failurestatus=failedBank rejectedCheck fail_code/fail_reason
4Deposit refundstatus=refundedBank initiated refundExecute reversal, notify user
5Reversal insufficient balanceREFUNDED but deduction failsUser already spent deposited fundsOperations manual intervention
6Bank-initiated deposit not syncedsource=2 but moomoo didn't receiveAPI call lostManually query Airstar API to supplement
7Duplicate depositSame deposit creates multiple recordsrequest_id dedup failureInvestigate via request_id/bank_ref_id

Withdrawal Exceptions (5 Types)

#ExceptionSymptomCauseHandling
1Withdrawal instruction failureAsbBstTransfer errorParameter exception/bank rejectionCheck error code, release freeze
210-poll timeoutAsbBstTransfer exhaustedBank processing slowlyEnter SyncAsbBstWithdraw
32h fallback timeoutSyncAsbBstWithdraw window endsBank processing exceptionManually contact Airstar to confirm
4Freeze not releasedWithdrawal failed but funds still frozenRelease flow exceptionManually release frozen funds
5Bank-side withdrawal not syncedUser initiated withdrawal from Airstar AppCallback lostManually query API to execute deduction

Common Customer Complaints Top 3

#User FeedbackCauseCS Script
1"Insufficient balance, can't deposit"140630005 bank balance insufficient"Please confirm your Airstar Bank account has sufficient balance and try again"
2"Authorization still processing"Mandate stuck at PendingAuthorise"The bank is reviewing your authorization application, usually completed within 1-2 business days"
3"Funds returned after successful deposit"REFUNDED status"The bank returned this deposit for compliance reasons, please contact customer service for details"

Monitoring & Alerts

Airstar 13 Key Alerts

#Alert ItemTrigger ConditionSeverityHandling
1Authorization creation timeoutMandate in PROCESSING exceeds thresholdHighCheck Airstar API connectivity
2Authorization failure rate spikeFAIL count exceeds limit per time unitHighInvestigate bank-side exceptions
3Deposit creation failureAsbBstCreateJob consecutive failuresHighCheck request parameters and API status
4Deposit polling timeout60 polls exhaustedHighManually contact Airstar to confirm
5Deposit refund (REFUNDED)REFUNDED status receivedCriticalImmediately reverse, notify user and operations
6Withdrawal polling timeout10 polls exhaustedHighEnter SyncAsbBstWithdraw
7Withdrawal fallback timeout2h window ends still pendingCriticalManually confirm bank-side status
8Freeze not releasedWithdrawal failed but freeze not rolled backCriticalManually release freeze
9Daily circuit breaker triggeredToday's cumulative reaches stop thresholdMediumOperations decides whether to restore
10Cumulative alarm triggeredCumulative reaches alarm thresholdMediumOperations monitors, assess risk
11Duplicate transaction detectedrequest_id duplicateHighCheck dedup logic
12API connectivity exceptionAirstar API timeout or error rate increaseCriticalContact Airstar Bank tech support
13Bank-initiated volume anomalysource=2 transaction volume spikeMediumInvestigate if normal business fluctuation

Code Location & Service Deployment

DimensionDescription
Service Nameairstar_service
Code LanguageGo
Proto Fileairstar_service/proto/airstar_service.proto
DependenciesRSA encryption library, HTTP client, JSON serialization

Key Code Modules

ModuleResponsibility
airstar_service/api/11 bank-side REST API request/response handling
airstar_service/crypto/RSA-OAEP encryption/decryption (200-byte blocks)
airstar_service/job/Polling Jobs (CreateResult/Transfer/Sync)
airstar_service/mandate/Mandate authorization state machine
airstar_service/deposit/Deposit logic (including REFUNDED reversal)
airstar_service/withdraw/Withdrawal logic (including circuit breaker check)
airstar_service/proto/Protobuf interface definitions
airstar_service/config/Bank connection config, RSA keys, limit parameters

Change Guide

Change RequirementModification LocationDescription
Modify limitsSQL seed + configHKD/USD/CNH three-tier limits
Modify polling countjob/ polling logicAdjust 60/10 attempt limits
Modify processing sessionSession validation logicCurrently starts at 08:30
Add supported currencyCreateDepositReq + limit configRequires Airstar-side simultaneous support
Modify RSA keysconfig/ + crypto/Requires coordination with Airstar for key rotation
Adjust risk level strategySecurity check handling logice.g., change Level 3 to auto-reject
Modify reversal logicdeposit/ REFUNDED handlingAdjust reversal failure fallback strategy
Modify auto-withdrawal conditionsauto_bs config + AUTO_SETTING_ID=3Reference Withdrawal Rules Manual
Add new API interfaceAirstar provides new API docs → implement handlerRequires Airstar-side to publish interface first
Adjust alert thresholdsMonitoring configurationAdjust sensitivity based on business volume

After Reading

I want to...Go to
See comparison of all three BST banksBST Banks Overview
Understand CMBC's Protobuf/SRPC schemeCMBC
See withdrawal auto-approval conditions and three-tier limitsWithdrawal Rules Manual
Check Airstar error codes (140630xxx / 140670xxx)Unified Error Code Center
See BST task schedules and alertsScheduled Tasks & Monitoring
See all banks capability comparisonBank Capability Matrix
Understand SBA fund orchestration freeze-release mechanismSBA Service Architecture
Was this page helpful?

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