Skip to main content

Exchange Rate API Documentation

Endpoint

POST https://admin.bookandlink.com/api/v1/exchange-rate

Description

Converts a specified amount from one currency to another based on the current exchange rate.


🔐 Authentication

This endpoint may require authentication (e.g., API key or Bearer token). Please confirm your access requirements.


📤 Request

Headers


Content-Type: application/json

Authorization: Bearer <your-token> (optional)

Payload (JSON)


{

"current_currency": "IDR",

"exchange_currency": "AUD",

"amount": 300000

}

FieldTypeRequiredDescription
current_currencystringThe original currency code (e.g., IDR)
exchange_currencystringThe target currency code (e.g., AUD)
amountdecimalThe amount to convert

✅ Success Response

HTTP Status Code: 200 OK


{

"status": "success",

"message": "Exchange currency rate successful",

"data": {

"currency": "AUD",

"amount": "28.479018",

"rate": "0.000095",

"remark": "1 IDR = 0.000095 AUD"

}

}

FieldTypeDescription
currencystringThe target currency
amountstringConverted amount in target currency
ratestringExchange rate used (1 unit of source currency)
remarkstringHuman-readable description of the exchange rate

❌ Error Response (Invalid Currency Code)

HTTP Status Code: 200 OK (with invalid result)


{

"status": "success",

"message": "Exchange currency rate successful",

"data": {

"currency": "AUDdd",

"amount": "nan",

"rate": "nan",

"remark": "1 IDRdd = nan AUDdd"

}

}

FieldTypeDescription
amountstringReturns "nan" if the currency is invalid
ratestringReturns "nan" for invalid exchange values
remarkstringShows invalid currency codes in string

📝 Example

Convert IDR 300,000 to AUD


curl -X POST https://admin.bookandlink.com/api/v1/exchange-rate \

-H "Content-Type: application/json" \

-d '{"current_currency":"IDR","exchange_currency":"AUD","amount":300000}'