Skip to main content

Overview

The BankTransferClient enables direct bank transfer cash-outs to any supported Colombian bank. Unlike PSE (which is a payment collection method), bank transfers allow you to send funds from a Kusama account to a traditional Colombian bank account. Key features:
  • Supports all major Colombian banks
  • Direct transfers to savings or checking accounts
  • Automatic execution with source account specification
Access it via bloque.swap.bankTransfer.

Constructor

The BankTransferClient is automatically initialized as part of the SwapClient.
import { Bloque } from '@bloque/sdk';

const bloque = new Bloque({ apiKey: 'your-api-key' });
const bankTransferClient = bloque.swap.bankTransfer;

Methods

create()

Creates a bank transfer swap order to send funds from Kusama to a Colombian bank account.
async create(params: CreateBankTransferOrderParams): Promise<CreateBankTransferOrderResult>

Parameters

params
CreateBankTransferOrderParams
required
Bank transfer order parameters

Returns

CreateBankTransferOrderResult
object

Example: Cash-out to Bancolombia

// Step 1: Find available rates for DUSD -> COP via Kusama -> Bancolombia
const rates = await bloque.swap.findRates({
  fromAsset: 'DUSD/6',
  toAsset: 'COP/2',
  fromMediums: ['kusama'],
  toMediums: ['bancolombia'],
  amountSrc: '5000000' // 5.000000 DUSD
});

// Step 2: Create bank transfer order
const result = await bloque.swap.bankTransfer.create({
  rateSig: rates.rates[0].sig,
  toMedium: 'bancolombia',
  amountSrc: '5000000',
  depositInformation: {
    bankAccountType: 'savings',
    bankAccountNumber: '5740088718',
    bankAccountHolderName: 'Juan Pérez',
    bankAccountHolderIdentificationType: 'CC',
    bankAccountHolderIdentificationValue: '1234567890',
  },
  args: {
    sourceAccountUrn: 'did:bloque:card:abc123'
  },
});

console.log('Order ID:', result.order.id);
console.log('Status:', result.order.status);
console.log('From Amount:', result.order.fromAmount, 'DUSD');
console.log('To Amount:', result.order.toAmount, 'COP');

Example: Cash-out to Banco de Bogotá (checking account)

const result = await bloque.swap.bankTransfer.create({
  rateSig: rate.sig,
  toMedium: 'banco_de_bogota',
  amountSrc: '2000000',
  depositInformation: {
    bankAccountType: 'checking',
    bankAccountNumber: '987654321',
    bankAccountHolderName: 'María López',
    bankAccountHolderIdentificationType: 'CE',
    bankAccountHolderIdentificationValue: '456789',
  },
  args: { sourceAccountUrn: 'did:bloque:card:xyz789' },
});

Example: Using destination amount instead

// Specify exact amount to receive in COP
const result = await bloque.swap.bankTransfer.create({
  rateSig: rate.sig,
  toMedium: 'banco_bbva_colombia',
  type: 'dst', // Specify we're providing destination amount
  amountDst: '50000000', // Exactly 500,000.00 COP
  depositInformation: {
    bankAccountType: 'savings',
    bankAccountNumber: '1122334455',
    bankAccountHolderName: 'Carlos Ruiz',
    bankAccountHolderIdentificationType: 'NIT',
    bankAccountHolderIdentificationValue: '900123456',
  },
  args: { sourceAccountUrn: 'did:bloque:card:def456' },
});

Supported Banks

The following Colombian banks are supported:
Bank CodeBank Name
bancolombiaBancolombia
banco_de_bogotaBanco de Bogotá
banco_daviviendaBanco Davivienda
banco_popularBanco Popular
banco_bbva_colombiaBBVA Colombia
banco_av_villasBanco AV Villas
banco_de_occidenteBanco de Occidente
banco_caja_social_bcscBanco Caja Social
banco_agrario_de_colombiaBanco Agrario
banco_gnb_sudamerisBanco GNB Sudameris
banco_falabellaBanco Falabella
banco_pichinchaBanco Pichincha
banco_coomevaBanco Coomeva
banco_finandina_bicBanco Finandina
banco_santander_de_negocios_colombiaSantander Colombia
banco_wBanco W
banco_btg_pactual_colombiaBTG Pactual
banco_cooperativo_coopcentralCoopcentral
banco_itauBanco Itaú
banco_bancamiaBancamía
banco_serfinanzaSerfinanza
banco_mundo_mujerBanco Mundo Mujer
banco_contactarBanco Contactar
banco_unionBanco Unión
citibank_colombiaCitibank Colombia
banco_jp_morgan_colombiaJP Morgan Colombia
davibankDavibank
ban100BAN100
lulo_bankLulo Bank
mibancoMibanco

Fee Structure for Bank Transfers

Bank transfer fees typically include:
  1. Exchange rate spread: The difference between market rate and offered rate
  2. Platform fee: Bloque’s service fee (percentage-based)
  3. Bank transfer fee: Fixed fee charged by the destination bank
const rate = rates.rates[0];

// Inspect fee breakdown
console.log('Total fee:', rate.fee.value);
console.log('Formula:', rate.fee.formula);

for (const component of rate.fee.components) {
  console.log(`${component.name}:`, component.value);
  
  if (component.type === 'fixed') {
    console.log('  Fixed amount:', component.amount, 'COP');
  } else if (component.type === 'percentage') {
    console.log('  Percentage:', component.percentage, '%');
  }
}

Transfer Flow

  1. Find rates: Use swap.findRates() with fromMediums: ['kusama'] and toMediums: [bankCode]
  2. Create order: Call bankTransfer.create() with bank account details and source account
  3. Auto-execution: Funds are automatically debited from the source Kusama account
  4. Bank processing: Transfer is processed by the destination bank
  5. Completion: Funds arrive in the specified bank account

Webhook Notifications

Receive real-time updates on transfer status:
const result = await bloque.swap.bankTransfer.create({
  rateSig: rate.sig,
  toMedium: 'bancolombia',
  amountSrc: '5000000',
  webhookUrl: 'https://your-app.com/webhooks/bank-transfer',
  depositInformation: { /* ... */ },
  args: { sourceAccountUrn: 'did:bloque:card:abc123' },
});
Webhook events include:
  • Order created
  • Transfer initiated
  • Transfer completed
  • Transfer failed (with reason)

Error Handling

import { 
  BloqueConfigError, 
  BloqueValidationError,
  BloqueInsufficientFundsError 
} from '@bloque/sdk-core';

try {
  const result = await bloque.swap.bankTransfer.create(params);
} catch (error) {
  if (error instanceof BloqueConfigError) {
    console.error('Not connected to a session');
  } else if (error instanceof BloqueInsufficientFundsError) {
    console.error('Insufficient funds in source account');
  } else if (error instanceof BloqueValidationError) {
    console.error('Invalid bank account details:', error.message);
  } else {
    console.error('Unexpected error:', error);
  }
}
  • CreateBankTransferOrderParams - Parameters for creating bank transfer orders
  • CreateBankTransferOrderResult - Result of creating bank transfer order
  • BankDepositInformation - Bank account details
  • KusamaAccountArgs - Source account arguments
  • SupportedBank - Supported bank codes
  • BankAccountType - Account type (savings/checking)
  • IdentificationType - ID types (CC/CE/NIT/PP)
  • SwapOrder - Swap order details
  • ExecutionResult - Auto-execution result
  • OrderType - Order type (src/dst)

Build docs developers (and LLMs) love