HomeGuidesRecipesAPI ReferenceChangelog
Log In
Guides

Transaction Fee Service

Reference page for the Transaction Fee Service Interface

Interface

interface ITransactionFeeService {
  getTransactionFeeEstimation(dto: TransactionFeeEstRequest): Promise<TransactionFeeEstResponse>;
}

Structures used

TransactionFeeEstRequest

Field NameType
paymentMethodPaymentMethods
directionProcessDirection
inputCurrencyCurrency
outputCurrencyCurrency
amountnumber

TransactionFeeEstResponse

Field NameType
percentageFeenumber
totalAmountnumber

Service Methods

createRemoteUserBankAccount

getTransactionFeeEstimation(params: TransactionFeeEstRequest): Promise<TransactionFeeEstResponse>
Overview

This method returns the estimated transaction fee

Usage
Typescript
import getunblockSDK, { Currency, PaymentMethods, ProcessDirection } 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
  });
  
  // SDK API call example
  const result = await sdk.transactionFee.getTransactionFeeEstimation({
    paymentMethod: PaymentMethods.OPEN_PAYD_BANK_TRANSFER,
    direction: ProcessDirection.ONRAMP,
    inputCurrency: Currency.EUR,
    outputCurrency: Currency.USD,
    amount: 100
  });
})();
Javascript
const getunblockSDK = require("@getunblock/sdk").default;
const { Currency, PaymentMethods, ProcessDirection } = 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
  });
  
  // SDK API call example
  const result = await sdk.transactionFee.getTransactionFeeEstimation({
    paymentMethod: PaymentMethods.OPEN_PAYD_BANK_TRANSFER,
    direction: ProcessDirection.ONRAMP,
    inputCurrency: Currency.EUR,
    outputCurrency: Currency.USD,
    amount: 100
  });
})();