HomeGuidesRecipesAPI ReferenceChangelog
Log In

Unblock Bank Account Service

Reference page for the Unblock Bank Account Service Interface

Interface

interface IUnblockBankAccountService {
  createUnblockUserBankAccount(params: CreateUnblockUserBankAccountRequest): Promise<CreateUnblockUserBankAccountResponse>;
  getAllUnblockUserBankAccounts(): Promise<GetAllunblockUserBankAccountsResponse>;
  simulateOnRamp(params: SimulateOnRampRequest): Promise<SimulateOnRampResponse>;
  getUnblockBankAccountById(params: GetUnblockBankAccountByIdRequest): Promise<GetUnblockBankAccountByIdResponse>;
}

Structures used

Union types, Literal Types and Enums

type CreateUnblockUserBankAccountResponse = UserBankAccount;

type GetAllunblockUserBankAccountsResponse = UserBankAccount[];

type GetUnblockBankAccountByIdResponse = UserBankAccount & UserBankAccountDetails;

CreateUnblockUserBankAccountRequest

Field NameType
currencyCurrency

SimulateOnRampRequest

Field NameType
currencyCurrency
valuenumber

GetUnblockBankAccountByIdRequest

Field NameType
accountUuidstring

UserBankAccount

Field NameType
currencyCurrency
createdAtstring
updatedAtstring
uuidstring

UserBankAccountDetails

Field NameType
bicstring
accountNumberstring
ibanstring
holderNamestring
currentBalancenumber
availableBalancenumber
sortCodestring

SimulateOnRampResponse

Field NameType
messagestring

Service Methods

createUnblockUserBankAccount

createUnblockUserBankAccount(params: CreateUnblockUserBankAccountRequest): Promise<CreateUnblockUserBankAccountResponse>
Overview

This method allows to creates a new bank account for a user in Unblock system for specific currency

Usage
Typescript
import getunblockSDK, { AuthenticationMethod, 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.unblockBankAccount.createUnblockUserBankAccount({
    currency: Currency.GBP
  });
})();
Javascript
const getunblockSDK = require("@getunblock/sdk").default;
const { AuthenticationMethod, 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.unblockBankAccount.createUnblockUserBankAccount({
    currency: Currency.GBP
  });
})();

getAllUnblockUserBankAccounts

getAllUnblockUserBankAccounts(): Promise<GetAllunblockUserBankAccountsResponse>
Overview

This method returns a list of all user account by unblock

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.unblockBankAccount.getAllUnblockUserBankAccounts();
})();
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.unblockBankAccount.getAllRemoteBankAccounts();
})();

simulateOnRamp

simulateOnRamp(params: SimulateOnRampRequest): Promise<SimulateOnRampResponse>
Overview

This method simulates an on-ramp operation - Sandbox environment only

Usage
Typescript
import getunblockSDK, { AuthenticationMethod, 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.unblockBankAccount.simulateOnRamp({
    currency: Currency.GBP,
    value: 1
  });
})();
Javascript
const getunblockSDK = require("@getunblock/sdk").default;
const { AuthenticationMethod, 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.unblockBankAccount.simulateOnRamp({
    currency: Currency.GBP,
    value: 1
  });
})();

getUnblockBankAccountById

getUnblockBankAccountById(params: GetUnblockBankAccountByIdRequest): Promise<GetUnblockBankAccountByIdResponse>
Overview

This method returns details of user bank account by unblock based on id. For GBP accounts no IBAN is returned. For EUR accounts no Bank Account and Sort Code is returned.

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.unblockBankAccount.getUnblockBankAccountById({
    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.unblockBankAccount.getUnblockBankAccountById({
    accountUuid: "b89b8075-e845-48a6-9b70-123c12e0aed0",
  });
})();