Get Exchange Rate
Fetch the exchange rate between the specified currency and HKD.
Endpoint
GET /v1/exchangeRate/get
Request
Header Parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer YOUR_ACCESS_TOKEN | Bearer access token used for authentication. |
Query Parameters
currency_code required
string
The source currency code.
Must be
HKD if target_currency is not HKD.Example:
USDtarget_currency required
string
The target currency code.
Must be
HKD if currency_code is not HKD.Example:
HKDExample request
curl -X GET "${API_URL}/v1/exchangeRate/get?currency_code=USD&target_currency=HKD" \
-H "Authorization: Bearer <ACCESS_TOKEN>"
Responses
200 Success
200 Success
Response schema:
application/jsondataobjectExchange rate result.
data
object
Exchange rate result.
currency_code
string
Source currency code, uppercased.
Example:
USDtarget_currency
string
Target currency code, uppercased.
Example:
HKDrate
string
Exchange rate: 1 unit of
currency_code equals this many units of target_currency.Example:
"7.842"Response sample
{
"data": {
"currency_code": "USD",
"target_currency": "HKD",
"rate": "7.842",
"message": "OK"
}
}
400 Bad Request
400 Bad Request
Response schema:
application/jsoncode
string
Error code returned by the API.
Example:
400000code_reason
string
Machine-readable error reason.
Example:
BAD_REQUESTmessage
string
Summary of the error.
Example:
Bad Requesterror_tracearrayList of validation errors.
error_trace
array
List of validation errors.
field
string
Request field that failed (dot notation).
code
number
Specific error code.
message
string
Human-readable explanation for this error.
Response sample
{
"error": {
"code": "400000",
"code_reason": "BAD_REQUEST",
"message": "Bad Request",
"error_trace": [
{
"field": "currency_code",
"code": 400431,
"message": "One of currency_code or target_currency must be HKD."
}
]
}
}
401 Unauthorized
401 Unauthorized
Response schema:
application/jsoncode
string
Error code (e.g. 401000).
Example:
401000code_reason
string
Machine-readable reason.
Example:
UNAUTHORIZEDmessage
string
Human-readable message.
Example:
UnauthorizedResponse sample
{
"error": {
"code": "401000",
"code_reason": "UNAUTHORIZED",
"message": "Unauthorized"
}
}
500 Failure
500 Failure
Response schema:
application/jsoncode
string
Error code returned by the API.
Example:
500999code_reason
string
Machine-readable error reason.
Example:
API_ERRORmessage
string
Human-readable message.
Example:
Api Error, please contact customer serviceResponse sample
{
"error": {
"code": "500999",
"code_reason": "API_ERROR",
"message": "Api Error, please contact customer service"
}
}