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
}
| Field | Type | Required | Description |
|---|---|---|---|
| current_currency | string | ✅ | The original currency code (e.g., IDR) |
| exchange_currency | string | ✅ | The target currency code (e.g., AUD) |
| amount | decimal | ✅ | The 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"
}
}
| Field | Type | Description |
|---|---|---|
| currency | string | The target currency |
| amount | string | Converted amount in target currency |
| rate | string | Exchange rate used (1 unit of source currency) |
| remark | string | Human-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"
}
}
| Field | Type | Description |
|---|---|---|
| amount | string | Returns "nan" if the currency is invalid |
| rate | string | Returns "nan" for invalid exchange values |
| remark | string | Shows 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}'