Currency that will be converted from. Must be a valid 3-letter ISO currency code (e.g., USD, EUR, GBP).
Bermuda Commercial Bank RESTful Open Banking API Implementation (v1)
The Bermuda Commercial Bank (BCB) RESTful Open Banking API provides secure, programmatic access to BCB's banking services, enabling developers to integrate financial services into their applications.
- Account details retrieval
- Internal transfers
- Payments (Swift)
- Virtual Accounts
- Transaction information access
- Robust security and compliance
- Comprehensive documentation
https://developers.bcb.bm/_mock/apis/open-banking-api/open-banking-api/
https://api-uat.bcb.bm/
https://api.bcb.bm/
Request
Retrieves a foreign exchange quote for converting between currencies (for the requested pair and amount). The same quote will be automatically applied by the system to any internal transfer or payment involving two different currencies, provided it is used within its expiry time.
If the requested exchange amount exceeds 100 000 BMD, the system will not return an automatic quote in the GET /v1/fx-quotes
response.
Instead, the request is routed for manual processing by our treasury desk to secure the most competitive rate available.
Clients must use the HTTP Accept header to indicate the desired response format:
- Set
Accept: application/json
for JSON responses (default) - Set
Accept: text/csv
for CSV responses If the Accept header is omitted,application/json
is assumed.
All API requests use the versioned base URL:
https://api.bcb.bm/v1/fx-quotes
- Currencies must be valid three-letter ISO 4217 codes
- Unit currency and currency of transfer must be different
- Instructed amount must be a valid decimal number with up to 2 decimal places
// Get FX quote for converting 100 USD to EUR
const getFxQuote = async (unitCurrency, currencyOfTransfer, instructedAmount) => {
try {
const response = await fetch(
'https://api.bcb.bm/v1/fx-quotes?' +
new URLSearchParams({
unitCurrency: unitCurrency,
currencyOfTransfer: currencyOfTransfer,
instructedAmount: instructedAmount
}), {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
});
// Check if the response is ok (status in the range 200-299)
if (!response.ok) {
// Parse error response
const errorData = await response.json();
throw new Error(`Error ${response.status}: ${errorData.error} - ${errorData.message}`);
}
// Parse successful response
const quote = await response.json();
// Log the complete quote details
console.log('FX Quote Details:');
console.log(`Source Currency: ${quote.sourceCurrency.currency}`);
console.log(`Source Amount: ${quote.sourceCurrency.amount}`);
console.log(`Target Currency: ${quote.targetCurrency.currency}`);
console.log(`Target Amount: ${quote.targetCurrency.amount}`);
console.log(`Exchange Rate: ${quote.exchangeRate}`);
console.log(`Quote Expires: ${new Date(quote.expiryDateTime).toLocaleString()}`);
// Return the processed quote
return {
...quote,
// Add formatted values for display
formattedSourceAmount: new Intl.NumberFormat('en-US', {
style: 'currency',
currency: quote.sourceCurrency.currency
}).format(quote.sourceCurrency.amount),
formattedTargetAmount: new Intl.NumberFormat('en-US', {
style: 'currency',
currency: quote.targetCurrency.currency
}).format(quote.targetCurrency.amount)
};
} catch (error) {
// Handle different types of errors
if (error.name === 'TypeError') {
console.error('Network error:', error.message);
} else {
console.error('API error:', error.message);
}
throw error; // Re-throw to let caller handle it
}
};
// Example usage with error handling:
try {
const quote = await getFxQuote('USD', 'EUR', '100.00');
console.log('Formatted Quote:', quote.formattedSourceAmount, '→', quote.formattedTargetAmount);
} catch (error) {
console.error('Failed to get FX quote:', error.message);
}
Required Permission: get-fx-quote
This endpoint requires the permission claim get-fx-quote
to be present in the JWT token. These permissions are embedded in the token during the authentication process and cannot be modified afterward. The token must be obtained with the appropriate permissions to access this endpoint.
- Mock server
https://developers.bcb.bm/_mock/apis/open-banking-api/open-banking-api/v1/fx-quotes
- UAT Environment - Used for testing and integration purposes
https://api-uat.bcb.bm/v1/fx-quotes
- Production Environment - Live environment for production use
https://api.bcb.bm/v1/fx-quotes
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://developers.bcb.bm/_mock/apis/open-banking-api/open-banking-api/v1/fx-quotes?unitCurrency=string¤cyOfTransfer=string&instructedAmount=string' \
-H 'Authorization: Bearer <YOUR_jwt_HERE>'
OK - The request was successful. Returns the FX quote details
The source currency and amount.
The source currency and amount.
The target currency and amount.
The target currency and amount.
The expiry date and time of the quote, expressed in UTC and formatted per ISO 8601 (yyyy-MM-ddTHH:mm:ssZ).
{ "sourceCurrency": { "currency": "USD", "amount": 1000 }, "targetCurrency": { "currency": "EUR", "amount": 902.5 }, "expiryDateTime": "2024-05-25T10:15:00.0000000Z", "exchangeRate": 0.9025 }