Skip to content
Trading Password and Unlock

Refresh Trade Token

Exchanges a refresh token for a new trade token and refresh token to extend the trade unlock period. The account is determined by the refresh token itself.

After tokens are passed in through updateTradeToken, WhaleCore renews them automatically with tradeRefreshToken, so the host app usually does not need this operation. If the host app refreshes tokens itself, pass the returned data.token.token and data.token.refresh_token to updateTradeToken again so that the tokens held by the SDK match the server. A 402003 response means the refresh token has expired and the trade password must be verified again.

When you call this operation through WhaleCore requestService(), you do not need to set requiresTradeToken to true.

POSThttps://api.lbkrs.com/v1/member/trade/refresh_token

Request body application/json

refresh_tokenstringrequired

Most recently obtained refresh token (tradeRefreshToken)

Responses

HTTP 200The request succeeded. The response body contains the result of the “Refresh Trade Token” operation.
Standard response envelopecodemessagedata
dataobjectdata structure
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