HomeGuidesRecipesAPI ReferenceChangelog
Log In
Guides
These docs are for v2.0.41. Click to read the latest docs for v2.2.0.

Remote Bank Account Service

Reference page for the Remote Bank Account Service Interface

Interface

interface IRemoteBankAccountService {
  createRemoteUserBankAccount(params: CreateRemoteUserBankAccountRequest): Promise<CreateRemoteUserBankAccountResponse>;
  getAllRemoteBankAccounts(): Promise<GetAllRemoteBankAccountsResponse[]>;
  changeMainUserRemoteBankAccount(params: ChangeMainUserRemoteBankAccountRequest): Promise<void>;
  getRemoteBankAccountByUuid(params: GetRemoteBankAccountByUuidRequest): Promise<GetRemoteBankAccountByUuidResponse>;
}

Structures used

GbpAccountDetails

Field NameType
currencyCurrency
accountNumberstring
sortCodestring

EurAccountDetails

Field NameType
currencystring
ibanstring

CreateRemoteUserBankAccountRequest

Field NameType
processUuidstring
accountNamestring
accountCountryCountry
beneficiaryCountryCountry
mainBeneficiaryboolean
accountDetailsGbpAccountDetails | EurAccountDetails

CreateRemoteUserBankAccountResponse

Field NameType
firstNamestring
lastNamestring
currencyCurrency
mainBeneficiaryboolean
ibanstring
bicstring
accountNumberstring
createdAtstring
updatedAtstring
accountNamestring
bankNamestring
uuidstring
sortCodestring

GetAllRemoteBankAccountsResponse

Field NameType
firstNamestring
lastNamestring
currencyCurrency
mainBeneficiaryboolean
ibanstring
bicstring
accountNumberstring
createdAtstring
updatedAtstring
accountNamestring
bankNamestring
uuidstring
sortCodestring

ChangeMainUserRemoteBankAccountRequest

Field NameType
accountUuidstring

GetRemoteBankAccountByUuidRequest

Field NameType
accountUuidstring

GetRemoteBankAccountByUuidResponse

Field NameType
firstNamestring
lastNamestring
currencyCurrency
mainBeneficiaryboolean
ibanstring
bicstring
accountNumberstring
createdAtstring
updatedAtstring
accountNamestring
bankNamestring
uuidstring
sortCodestring

Service Methods

createRemoteUserBankAccount

createRemoteUserBankAccount(params: CreateRemoteUserBankAccountRequest): Promise<CreateRemoteUserBankAccountResponse>
Overview

This method creates an offramp bank account details for an end user. Creating the account with main_beneficiary as true will make it the default account where all offramps take place

Usage
Typescript
import getunblockSDK, { AuthenticationMethod, Country, Currency } from "@getunblock/sdk";

(async () => {
  // setup SDK
  const sdk = getunblockSDK({
    apiKey:
      "API-Key [Some merchant Key]", // Key generated at the moment the merchant was created in getunblock system
    prod: false, // If true Production environment will be used otherwise Sandbox will be used instead
  });
  
  await sdk.auth.authenticateWithSiwe({    
    message: "[Generated SIWE message]*",
    signature: "[Generated SIWE signature]*",
  });
  // * more info at https://docs.getunblock.com/docs/unblocker
  
  // SDK API call example
  const result = await sdk.remoteBankAccount.createRemoteUserBankAccount({
    accountName: "[User account name]",
    accountCountry: Country.UnitedKingdom,
    beneficiaryCountry: Country.UnitedKingdom,
    mainBeneficiary: false,
    accountDetails: {
      currency: Currency.GBP,
      accountNumber: 31926819,
      sortCode: 123456
    },
  });
})();
Javascript
const getunblockSDK = require("@getunblock/sdk").default;
const { AuthenticationMethod, Country, Currency } = require("@getunblock/sdk"); 

(async () => {
  // setup SDK
  const sdk = getunblockSDK({
    apiKey:
      "API-Key [Some merchant Key]", // Key generated at the moment the merchant was created in getunblock system
    prod: false, // If true Production environment will be used otherwise Sandbox will be used instead
  });
  
  await sdk.auth.authenticateWithSiwe({    
    message: "[Generated SIWE message]*",
    signature: "[Generated SIWE signature]*",
  });
  // * more info at https://docs.getunblock.com/docs/unblocker
  
  // SDK API call example
  const result = await sdk.remoteBankAccount.createRemoteUserBankAccount({
    accountName: "[User account name]",
    accountCountry: Country.UnitedKingdom,
    beneficiaryCountry: Country.UnitedKingdom,
    mainBeneficiary: false,
    accountDetails: {
      currency: Currency.GBP,
      accountNumber: 31926819,
      sortCode: 123456
    },
  });
})();

getAllRemoteBankAccounts

getAllRemoteBankAccounts(): Promise<GetAllRemoteBankAccountsResponse[]>
Overview

This method gets all the remote bank accounts linked to a user for the offramp process

Usage
Typescript
import getunblockSDK, { AuthenticationMethod } from "@getunblock/sdk";

(async () => {
  // setup SDK
  const sdk = getunblockSDK({
    apiKey:
      "API-Key [Some merchant Key]", // Key generated at the moment the merchant was created in getunblock system
    prod: false, // If true Production environment will be used otherwise Sandbox will be used instead
  });
  
  await sdk.auth.authenticateWithSiwe({    
    message: "[Generated SIWE message]*",
    signature: "[Generated SIWE signature]*",
  });
  // * more info at https://docs.getunblock.com/docs/unblocker
  
  // SDK API call example
  const result = await sdk.remoteBankAccount.getAllRemoteBankAccounts();
})();
Javascript
const getunblockSDK = require("@getunblock/sdk").default;
const { AuthenticationMethod } = require("@getunblock/sdk"); 

(async () => {
  // setup SDK
  const sdk = getunblockSDK({
    apiKey:
      "API-Key [Some merchant Key]", // Key generated at the moment the merchant was created in getunblock system
    prod: false, // If true Production environment will be used otherwise Sandbox will be used instead
  });
  
  await sdk.auth.authenticateWithSiwe({    
    message: "[Generated SIWE message]*",
    signature: "[Generated SIWE signature]*",
  });
  // * more info at https://docs.getunblock.com/docs/unblocker
  
  // SDK API call example
  const result = await sdk.remoteBankAccount.getAllRemoteBankAccounts();
})();

changeMainUserRemoteBankAccount

changeMainUserRemoteBankAccount(params: ChangeMainUserRemoteBankAccountRequest): Promise<void>
Overview

This method allows to change the main user remote bank account to which all off ramps by default take place. This account can be selected based on existing ones

Usage
Typescript
import getunblockSDK, { AuthenticationMethod } from "@getunblock/sdk";

(async () => {
  // setup SDK
  const sdk = getunblockSDK({
    apiKey:
      "API-Key [Some merchant Key]", // Key generated at the moment the merchant was created in getunblock system
    prod: false, // If true Production environment will be used otherwise Sandbox will be used instead
  });
  
  await sdk.auth.authenticateWithSiwe({    
    message: "[Generated SIWE message]*",
    signature: "[Generated SIWE signature]*",
  });
  // * more info at https://docs.getunblock.com/docs/unblocker
  
  // SDK API call example
  const result = await sdk.remoteBankAccount.changeMainUserRemoteBankAccount({
    accountUuid: "b89b8075-e845-48a6-9b70-123c12e0aed0",
  });
})();
Javascript
const getunblockSDK = require("@getunblock/sdk").default;
const { AuthenticationMethod } = require("@getunblock/sdk"); 

(async () => {
  // setup SDK
  const sdk = getunblockSDK({
    apiKey:
      "API-Key [Some merchant Key]", // Key generated at the moment the merchant was created in getunblock system
    prod: false, // If true Production environment will be used otherwise Sandbox will be used instead
  });
  
  await sdk.auth.authenticateWithSiwe({    
    message: "[Generated SIWE message]*",
    signature: "[Generated SIWE signature]*",
  });
  // * more info at https://docs.getunblock.com/docs/unblocker
  
  // SDK API call example
  const result = await sdk.remoteBankAccount.changeMainUserRemoteBankAccount({
    accountUuid: "b89b8075-e845-48a6-9b70-123c12e0aed0",
  });
})();

getRemoteBankAccountByUuid

Overview

This method gets a specific remote bank account by UUID

Usage
Typescript
import getunblockSDK, { AuthenticationMethod } from "@getunblock/sdk";

(async () => {
  // setup SDK
  const sdk = getunblockSDK({
    apiKey:
      "API-Key [Some merchant Key]", // Key generated at the moment the merchant was created in getunblock system
    prod: false, // If true Production environment will be used otherwise Sandbox will be used instead
  });
  
  await sdk.auth.authenticateWithSiwe({    
    message: "[Generated SIWE message]*",
    signature: "[Generated SIWE signature]*",
  });
  // * more info at https://docs.getunblock.com/docs/unblocker
  
  // SDK API call example
  const result = await sdk.remoteBankAccount.getRemoteBankAccountByUuid({
    accountUuid: "b89b8075-e845-48a6-9b70-123c12e0aed0",
  });
})();
Javascript
const getunblockSDK = require("@getunblock/sdk").default;
const { AuthenticationMethod } = require("@getunblock/sdk"); 

(async () => {
  // setup SDK
  const sdk = getunblockSDK({
    apiKey:
      "API-Key [Some merchant Key]", // Key generated at the moment the merchant was created in getunblock system
    prod: false, // If true Production environment will be used otherwise Sandbox will be used instead
  });
  
  await sdk.auth.authenticateWithSiwe({    
    message: "[Generated SIWE message]*",
    signature: "[Generated SIWE signature]*",
  });
  // * more info at https://docs.getunblock.com/docs/unblocker
  
  // SDK API call example
  const result = await sdk.remoteBankAccount.getRemoteBankAccountByUuid({
    accountUuid: "b89b8075-e845-48a6-9b70-123c12e0aed0",
  });
})();