Reference Appendix

Error Code Reference (ErrCode)

Complete list of error codes (ErrCode) returned by the FastConnect API, grouped by HTTP status code.

Error Code Reference (ErrCode)

Overview

When calling the FastConnect API, each error response contains a status field (HTTP status code) and an ErrCode field (detailed error code) that helps pinpoint the exact cause of the error.

Error Code Convention

FastConnect error codes follow the convention {HTTP_STATUS}{xxx}, where xxx is the detailed code:

GroupRangeMeaning
4000xx400000 – 400015Common errors for both Trading and Market Data
4001xx400101 – 400165Trading-specific errors
4002xx400200+Market Data-specific errors

HTTP 200 — Success

The request succeeded and the server returned the expected data.

Error CodeError NameMeaning
200SuccessThe request succeeded and the server returned the expected data.

HTTP 202 — Accepted

The request was accepted and is being processed asynchronously — not an error; the client should wait or retry.

Error CodeError NameMeaning
401114Push-approval is pendingThe Smart OTP push-approval request is waiting for the user to approve in the app. The SDK (ensure_authenticated/EnsureAuthenticated/...) polls automatically; if calling the API directly, the client should retry after a few seconds.

HTTP 400 — Bad Request

The request is malformed, missing parameters, or contains invalid data.

Common Errors (4000xx)

Applies to both the Trading API and the Market Data API.

Error CodeError NameMeaning
400000Invalid RequestThe request is invalid.
400001Malformed JSON BodyThe JSON body has invalid syntax.
400002Missing Required FieldA required field is missing.
400003Invalid Field ValueThe field value is invalid.
400004Invalid Field FormatInvalid data format (regex/date/id).
400005Invalid Field ErrorThe field is invalid.
400006Missing Request BodyThe API request body is missing.
400007Data is available only for the latest x yearsData is only supported for the most recent x years.
400008Query time range cannot exceed y monthsThe query range cannot exceed y months.
400009From Date cannot be greater than To DateFrom Date cannot be greater than To Date.
400010Query time range cannot exceed z yearsThe query range cannot exceed z years.
400011The lookup time must be earlier than the current dateThe lookup time must be earlier than the current date.
400012Invalid Date/TimestampThe date/time format is invalid.
400013Invalid TimezoneThe timezone is invalid.
400014Invalid PageNumberPageNumber is invalid.
400015Invalid PageSizePageSize is invalid.

Trading Errors — Authentication and Configuration (400101 – 400110)

Errors related to credentials, 2FA, OTP, and trading account configuration.

Error CodeError NameMeaning
400101Credential has no associated clientThe credential is not associated with any client.
400102Failed to get 2FA infoUnable to retrieve 2FA information.
4001032FA info not available for this account2FA information is not available for this account.
400104Failed to send OTPFailed to send OTP.
400105Unsupported Core_Type for accountCore_Type is not supported for this account.
400106Order rejected: stock disclosure policy violationThe order was rejected due to a stock disclosure policy violation.
400107Do not edit price and quantity at the same timePrice and quantity cannot be modified at the same time.
400108OrderType is not allowedThe order type is not allowed.
400109Modify order rejected: stock disclosure policy violationThe order modification was rejected due to a stock disclosure policy violation.
400110No accounts found for clientNo account was found for the client.

Trading Errors — Order Placement Business Rules (400111 – 400148)

Business validation errors when placing/modifying/cancelling orders: price, quantity, symbol, trading session.

Error CodeError NameMeaning
400111Symbol Not TradableThe symbol is not tradable.
400112Price Out of RangeThe order price must be within the ceiling/floor range.
400113Invalid Lot SizeThe order quantity must be divisible by the trading lot.
400114Price Must Be PositiveThe price must be > 0.
400115Price Must Be ZeroThe price must be = 0.
400116Price Must Be Zero For Market OrdersThe order price must be = 0 for ATO, ATC, MTL, MAK, MOK, and PLO order types.
400117Order Type Not Allowed In Current SessionThis order type cannot be placed in the current session.
400118Price Not Divisible By Tick SizeThe order price is not divisible by the tick size.
400119Sell Not Allowed In This SessionSell orders are not allowed in this session.
400120Quantity Below MinimumThe order quantity cannot be less than the minimum quantity.
400121Quantity Exceeds MaximumThe order quantity cannot be greater than the maximum quantity.
400122Duplicate Order In Periodic SessionDuplicate order in the periodic session (both buy and sell present).
400123Symbol Not Registered With ExchangeThe symbol is not registered with any exchange.
400124Symbol Rule Not ConfiguredNo rule has been configured for the symbol.
400125Symbol Even Lot Rule Not ConfiguredNo even-lot rule has been configured for the symbol.
400126Symbol Odd Lot Rule Not ConfiguredNo odd-lot rule has been configured for the symbol.
400127Cannot Change From Even To Odd LotThe quantity cannot be modified from an even lot to an odd lot.
400128Cannot Change From Odd To Even LotThe quantity cannot be modified from an odd lot to an even lot.
400129OrderQty Must Match OriginalOrderQty must equal the quantity of the order being modified.
400130Invalid Lot QuantityThe quantity is greater than the lot and not divisible by the trading lot.
400131Order Cannot Be CancelledThe order status does not allow cancellation.
400132Order Cannot Be ModifiedThe order status does not allow modification.
400133No Changes DetectedThe order modification contains no changed information.
400134Invalid Symbol FormatThe symbol must not contain spaces and must be ≤ 20 characters long.
400135Pre-session Order Type Not BoundThe pre-session order type is not bound to any session.
400136Cannot Modify MP In Continuous SessionThe MP order type cannot be modified during the continuous session.
400137Cannot Modify MOK In Continuous SessionThe MOK order type cannot be modified during the continuous session.
400138Cannot Modify MTL In Continuous SessionThe MTL order type cannot be modified during the continuous session.
400139Cannot Modify MAK In Continuous SessionThe MAK order type cannot be modified during the continuous session.
400140Derivative Account RequiredThe order account must be a derivative account.
400141Symbol Buy RestrictedThe symbol is restricted from buy trading.
400142Symbol Sell RestrictedThe symbol is restricted from sell trading.
400143Symbol Not On Derivative ExchangeThe symbol does not belong to the derivative exchange.
400144Account Cannot Trade Derivative SymbolThe account cannot place orders for derivative symbols.
400145Account SuspendedThe account is suspended for exceeding the allowed number of orders.
400146Symbol RequiredThe symbol must not be empty.
400147Quantity Must Be PositiveThe quantity must be greater than 0.
400148Quantity Exceeds LimitThe quantity exceeds the limit.

Trading Errors — Trading Session, Account, and FCO (400149 – 400165)

Errors related to trading hours, account, basic order parameters, and conditional orders (FCO).

Error CodeError NameMeaning
400149Before Trading HoursBefore trading hours.
400150After Trading Hours / Trading Account RequiredAfter trading hours. Or: missing AccountNo/ClientId, account not found.
400151Symbol RequiredThe trading symbol is missing.
400152Invalid SymbolThe symbol is invalid.
400153Order Side RequiredThe side (BUY/SELL) is missing.
400154Invalid Order SideThe order side is invalid.
400155Order Type RequiredorderType is missing.
400156Invalid Order TypeorderType is invalid.
400157Quantity Required / Price RequiredThe quantity or the price is missing.
400158Invalid QuantityThe quantity is invalid.
400159Invalid PriceThe price is invalid.
400160Operation Not PermittedThe operation is not permitted.
400161FCO Strategy Not SupportedThe FCO strategy does not match any of the supported strategies.
400162FCO Cannot Set StopOrderThe FCO order type cannot set stopOrder=True.
400163FCO Cannot Set Price Main OrderThe FCO order type cannot set a price for the main order.
400164FCO Activation Limit ReachedThe activation limit is full. No further activations are possible.
400165FCO Indicator Type MismatchThe indicator values are not of the same data type.

Trading Errors — Batch Order

Applies to POST/DELETE /api/v3/trading/order/batch (REST) and order.batchNew/order.batchCancel (WebSocket API). The whole batch is validated before processing: a batch-level error rejects the entire batch.

Some codes below share their number with regular order place/amend business errors in the tables above (400108, 400109, 400111). When handling Batch Order errors, use the endpoint you called and the ErrorMessage text to tell them apart.

Error codeMeaning in Batch OrderReference message
400108orders is empty or exceeds the maximum number of orders per batch (50).orders is required. / orders exceeds the maximum batch size of 50.
400109batchRequestId or batchRequestTime is missing.batchRequestId is required. / batchRequestTime is required.
400111batchRequestTime is outside the allowed window (30 seconds from server time).BatchRequestTime is outside the allowed replay window.
403101An account in the batch is not authorized for the API key. The entire batch is rejected.Forbidden: account '...' is not authorized.
409The batchRequestId was already submitted (same API key, same place/cancel action, same day).Duplicate batch request: ... already submitted.

In addition to the batch-level errors above, each order in the batch is validated with the regular place/cancel order rules (the 4001xx codes in the tables above). For REST, per-order errors are returned in the per-order results (success, errorCode, errorMessage).

Market Data Errors — Corporate Actions

Applies to data-corporateActions. Validation errors return HTTP 400 with the following codes.

Error codeMeaning
504210from or to is missing.
400213from/to has an invalid date format (yyyy/MM/dd required).
400202from is later than to.
504211The range from from to to exceeds 5 days.
504212Invalid language (only vn or en accepted).
504213pageIndex is less than 1.
504214Invalid pageSize (only 10, 20, 50 or 100 accepted).
400004symbol has an invalid format or is longer than 20 characters.

When the query is valid but there are no events in the time range, the API returns HTTP 204 (no body), which is not an error.


HTTP 401 — Unauthorized

The token/credentials are missing or incorrect, or the user has not been authenticated.

Access Token (401000 – 401016)

Error CodeError NameMeaning
401000Missing Authorization HeaderThe Authorization header is missing.
401001UnauthorizedNot authenticated.
401002Access Token MissingThe access token is missing.
401003Access Token InvalidThe access token is invalid.
401004Access Token ExpiredThe access token has expired.
401009Access Token Not Yet ValidThe access token is not yet valid (nbf).
401010Token Signature InvalidThe token signature is invalid.
401011Missing Signature HeaderThe signature header (X-Signature) is missing.
401012Signature Not RecognizedThe signature is not recognized.
401013Signature Not ValidThe signature is invalid. The token value is invalid.
401014Signature Not MatchedThe signature does not match.
401015Signature Body EmptyThe signature is invalid. The request body is empty.
401016Token Not Include OTPThe token does not include an OTP.

Refresh Token and OTP (401100 – 401108)

Error CodeError NameMeaning
401100OTP Verification FailedOTP verification failed.
401101Invalid Refresh TokenThe refresh token is invalid.
401102Refresh Token Missing ClientThe refresh token is missing client information.
401103Refresh Token Revoked or ExpiredThe refresh token has been revoked or has expired.
401104Invalid API Key ReferenceThe API key reference from the refresh token is invalid.
401105Invalid API Key or SecretThe API key or secret is invalid.
401106Invalid Token TypeThe token type is incorrect; a refresh token is required.
401107Refresh Token Missing JTIThe refresh token is missing the jti claim.
401108Refresh Token Missing Key IDThe refresh token is missing the key_id claim.

HTTP 403 — Forbidden

The user is authenticated but does not have permission to perform the action.

Error CodeError NameMeaning
403000ForbiddenNo permission to access the resource/operation.
403001Insufficient ScopeThe token/API key does not have sufficient permission scope.
403100No Scopes GrantedThe API key has not been granted any scope.
403101Account Not AuthorizedThe account is not authorized for the API key (used by Batch Order: a single unauthorized account rejects the whole batch).
403102Product Not Enabled For AccountThe account has not been granted access to this product.

HTTP 404 — Not Found

The API endpoint or resource does not exist.

Error CodeError NameMeaning
404000Resource Not FoundThe requested resource was not found.
404100ClientRequestId Not FoundClientRequestId was not found.
404101ClientRequestId Has No OrderIdClientRequestId has no corresponding OrderId.
404102OrderId Not FoundOrderId was not found.
404103Account Not FoundThe account was not found.
404204Symbol Not FoundThe symbol was not found.

HTTP 405 — Method Not Allowed

An incorrect HTTP method was used (for example, using GET instead of POST).

Error CodeError NameMeaning
405000Method Not AllowedThe method is not supported for the endpoint.
405001GET Not AllowedThis endpoint does not support GET.
405002POST Not AllowedThis endpoint does not support POST.
405003PUT Not AllowedThis endpoint does not support PUT.
405004PATCH Not AllowedThis endpoint does not support PATCH.
405005DELETE Not AllowedThis endpoint does not support DELETE.
405006OPTIONS Not AllowedThis endpoint does not support OPTIONS.

HTTP 408 — Request Timeout

The server waited too long to receive the request from the client.

Error CodeError NameMeaning
408000Request TimeoutThe request timed out.
408200Market Data Export Request TimeoutTimeout while receiving the market data export request.

HTTP 409 — Conflict

The request is valid but conflicts with the current state of the resource/business.

Error CodeError NameMeaning
409Duplicate Batch RequestThe Batch Order batchRequestId was already submitted (see the Batch Order section under HTTP 400).
409000ConflictGeneral state conflict.
409100Duplicate RequestDuplicate request — already submitted earlier with the same RequestId.
409101Resource Already ExistsThe resource already exists and cannot be created again.
409102Insufficient Buying PowerInsufficient buying power to place the order.
409103Insufficient Account BalanceInsufficient account balance.

HTTP 429 — Too Many Requests

Too many requests were sent within a time period and were rate limited.

General Rate Limit (429000 – 429100)

Error CodeError NameMeaning
429000Rate Limit ExceededThe system's general request limit was exceeded.
429100Daily Order Limit ExceededThe account's daily order limit was exceeded.

Transaction Limits (429101 – 429126)

Error CodeError NameMeaning
429101Volume Exceeds Current RoomThe volume exceeds the current room.
429102Deposit Exceeds Approval LimitThe deposit amount exceeds the approval limit.
429103Exceeds Allowable Input LimitExceeds the allowable input limit.
429104Exceeds Allowable Approval LimitExceeds the allowable approval limit.
429105Override Exceeds Withdrawable AmountThe override amount exceeds the withdrawable amount.
429106Exceeds Withdrawable AmountExceeds the withdrawable amount.
429107Exceeds Daily Transaction LimitExceeds the daily transaction limit.
429108Exceeds Maximum Withdrawable AmountExceeds the maximum withdrawable amount.
429109Exceeds Account Transaction LimitExceeds the account's transaction amount.
429110Exceeds Maximum Withdrawable BalanceExceeds the maximum withdrawable cash balance.
429111Exceeds Allowable Input LimitExceeds the allowable input limit.
429112Exceeds Allowable Input AmountExceeds the allowable input amount.
429113Exceeds Daily Transaction LimitExceeds the daily transaction limit.
429114Exceeds Transferable AmountExceeds the transferable amount.
429115Exceeds Maximum Transferable AmountExceeds the maximum transferable amount upon approval.
429116Exceeds Daily Transferable LimitExceeds the amount transferable in a single day.
429117Transfer Exceeds Napas LimitThe transfer amount exceeds the Napas limit.
429118Exceeds Maximum Withdrawable BalanceExceeds the maximum withdrawable cash balance.
429119Cash Advance Exceeds Maximum LimitThe cash advance amount exceeds the maximum allowed limit.
429120Received Cash Advance Exceeds MaximumThe received cash advance amount exceeds the maximum allowed.
429121Blocked Volume Exceeds Available BalanceThe blocked volume exceeds the available balance.
429122Released Volume Exceeds Blocked VolumeThe released volume exceeds the blocked volume.
429123Exceeds Allowable Input LimitExceeds the allowable input limit.
429124Exceeds Auto-Approval Cash AdvanceExceeds the maximum auto-approved cash advance amount.
429125Rejection Reason Length ExceededThe rejection reason exceeds the allowed length.
429126Volume Exceeds LimitThe volume exceeds the limit.

HTTP 500 — Internal Server Error

A server-side error occurred and the request could not be processed.

Error CodeError NameMeaning
500000Internal Server ErrorA server-side error occurred and the request could not be processed.
500002Database Execution ErrorA business processing error occurred at the database layer.
500100Token Verification Failed: Client ID MismatchToken verification failed: client_id mismatch.
500101Token Verification Failed: Scopes MissingToken verification failed: the scopes claim is missing.
500200Market Data Persistence ErrorAn error occurred while persisting market data.

HTTP 502 — Bad Gateway

An intermediate server received an invalid response from the upstream server.

Error CodeError NameMeaning
502000Bad GatewayGeneral gateway error with the upstream system.
502100CashPosition No DataUpstream CashPosition returned no data for the account.
502101GetCashBalance No DataUpstream GetCashBalance returned no data for the account.
502102GetAssetsExtends FailedUpstream GetAssetsExtends failed for the account.

HTTP 503 — Service Unavailable

The service is temporarily unavailable (overloaded/under maintenance/dependency failure).

Error CodeError NameMeaning
503000Service UnavailableThe service is temporarily unable to serve requests.
503001System Maintenance WindowThe system is in a maintenance window.

HTTP 504 — Gateway Timeout

An intermediate server did not receive a timely response from the upstream server.

Error CodeError NameMeaning
504000Gateway TimeoutGeneral timeout when calling the upstream.

On this page