Skip to content
Assets

Submit Currency Exchange

Submits a currency exchange request by either the source amount or the target amount. Returns the exchange record id, whether the request falls within service hours, and the estimated processing completion time outside service hours. Used for the exchange result page and the outside-service-hours notice.

POSThttps://api.lbkrs.com/v1/forex/convert

Request body application/json

fromstringrequired

Source currency, such as USD

tostringrequired

Target currency, such as HKD

amountstring

Source amount (pass it when submitting by source amount). Mutually exclusive with target_amount; only one of them can have a value

target_amountstring

Target amount (pass it when submitting by target amount). Mutually exclusive with amount; only one of them can have a value

account_channelstringrequired

Broker channel

Responses

HTTP 200The request succeeded. The response body contains the result of the “Submit currency exchange” operation.
Standard response envelopecodemessagedata
dataobjectdata structure
okboolean

Whether the submission succeeded

idinteger

id of the newly created exchange record, which can be used to query the exchange details

in_serviceboolean

Whether the current time is within exchange service hours. When false, the request is processed only after service hours begin

deal_timestring

Estimated processing completion time, as a Unix timestamp (in seconds). When in_service is false, Broker App uses it to show “Currently outside service hours. The exchange is expected to complete by xx”

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