Skip to content

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.

Key Features

  • Account details retrieval
  • Internal transfers
  • Payments (Swift)
  • Virtual Accounts
  • Transaction information access
  • Robust security and compliance
  • Comprehensive documentation

Available Environments

UAT Environment

URL: https://api-uat.bcb.bm

Purpose: Testing and integration

Production Environment

URL: https://api.bcb.bm

Purpose: Live production use

Download OpenAPI description
Overview
URL

https://www.bcb.bm

Bermuda Commercial Bank Limited, 34 Bermudiana Road, Hamilton HM 11, Bermuda

enquiries@bcb.bm

Languages
Servers
Mock server

https://developers.bcb.bm/_mock/apis/open-banking-api/open-banking-api/

UAT Environment - Used for testing and integration purposes

https://api-uat.bcb.bm/

Production Environment - Live environment for production use

https://api.bcb.bm/

Operations
Operations
Operations

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.

High-Value Exchange Requests (> 100 000 BMD)

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.

Content Negotiation

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.

Base URL:

All API requests use the versioned base URL:

https://api.bcb.bm/v1/fx-quotes

Validation Rules

  • 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

Sample Request in JavaScript:

// 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.

Security
Authorization or Feature Permissions
Query
unitCurrencystringrequired

Currency that will be converted from. Must be a valid 3-letter ISO currency code (e.g., USD, EUR, GBP).

currencyOfTransferstringrequired

Currency that will be converted to. Must be a valid 3-letter ISO currency code (e.g., USD, EUR, GBP). Must be different from the unit currency.

instructedAmountstringrequired

The amount to be converted from the unit currency. Must be a valid decimal number with up to 2 decimal places (e.g., "100.00").

curl -i -X GET \
  'https://developers.bcb.bm/_mock/apis/open-banking-api/open-banking-api/v1/fx-quotes?unitCurrency=string&currencyOfTransfer=string&instructedAmount=string' \
  -H 'Authorization: Bearer <YOUR_jwt_HERE>'

Responses

OK - The request was successful. Returns the FX quote details

Bodyapplication/json
sourceCurrencyCurrencyAmount (object)

The source currency and amount.

CurrencyAmount (object)

The source currency and amount.

targetCurrencyCurrencyAmount (object)

The target currency and amount.

CurrencyAmount (object)

The target currency and amount.

expiryDateTimestring

The expiry date and time of the quote, expressed in UTC and formatted per ISO 8601 (yyyy-MM-ddTHH:mm:ssZ).

exchangeRatenumber(decimal)

The exchange rate for the currency conversion.

Response
application/json
{ "sourceCurrency": { "currency": "USD", "amount": 1000 }, "targetCurrency": { "currency": "EUR", "amount": 902.5 }, "expiryDateTime": "2024-05-25T10:15:00.0000000Z", "exchangeRate": 0.9025 }
Operations
Operations
Operations
Operations
Operations