Skip to content
Trading Password and Unlock

Verify Trade Password

Verifies the trade password entered by the Client. If verification succeeds and no second-factor verification is required, returns the trade token for the account.

WhaleCore handles trade authentication automatically by default, so the host app does not need this operation. When WhaleCore is initialized with tradePasswordEnabled: true, the SDK no longer obtains trade tokens itself. When a trading call throws tradeAuthFailed (1006) or hasTradeToken() returns false, the host app asks the Client for the trade password, calls this operation, passes data.token.token as tradeToken and data.token.refresh_token as tradeRefreshToken to WhaleCoreService.updateTradeToken(...), and then retries the original operation. Tokens are issued per account, so the accountChannel passed to updateTradeToken must match the account of this request.

If need_two_factors or need_totp_two_factors is true, do not use any token in this response. Call the matching second-factor operation instead, which returns the token: POST /v1/member/trade/auth_two_factors for an SMS verification code, or POST /v1/member/trade/totp/auth_two_factors for a third-party authenticator code. Device-token verification, indicated by need_device_totp_two_factors, is outside the scope of this document.

This operation is also used to verify the Client’s current trade password before security settings are changed.

If the password is wrong, show message and let the Client enter it again. If 402009 is returned, stop retrying.

Password fields carry the MD5 digest of the 6-digit trade password as a 32-character lowercase hexadecimal string. Never send the plaintext password.

This operation obtains the trade token, so do not set requiresTradeToken to true when you call it through WhaleCore requestService().

POSThttps://api.lbkrs.com/v3/member/trade/auth

Request body application/json

trade_passwordstringrequired

MD5 digest of the trade password

typestringrequired

Verification scenario. Pass trade to unlock trading.

Responses

HTTP 200The request succeeded. The response body contains the result of the “Verify Trade Password” operation.
Standard response envelopecodemessagedata
dataobjectdata structure
need_two_factorsboolean

Whether SMS second-factor verification is still required. If true, call POST /v1/member/trade/auth_two_factors

need_totp_two_factorsboolean

Whether third-party authenticator (TOTP) second-factor verification is still required. If true, call POST /v1/member/trade/totp/auth_two_factors

need_device_totp_two_factorsboolean

Whether device-token second-factor verification is still required. This verification method is outside the scope of this document

tfa_guideboolean

If true, the SMS second-factor page can offer an option to require the verification code for this unlock only. Submit the choice through tfa_switch of POST /v1/member/trade/auth_two_factors

tokenobject

Trade token and its refresh token, issued per account

Child attributes
tokenstring

Trade token. Pass it as tradeToken to WhaleCoreService.updateTradeToken(...)

refresh_tokenstring

Refresh token. Pass it as tradeRefreshToken to updateTradeToken; it is also the input of POST /v1/member/trade/refresh_token

refresh_token_expiresinteger

Lifetime of the refresh token, in seconds, counted from issuance

HTTP 400The service rejected the request because a business rule or input validation failed. Review the business codes and correct the request before retrying.
codeintegerrequired

Business status code, 0 indicates success

messagestringrequired

Human-readable result or error message.

Whale Docs