Skip to main content
POST
https://sandbox.finhub.cloud
/
api
/
v2.1
/
fintrans
/
{accountId}
/
types
/
{operationType}
/
prepare
Account Operations API
curl --request POST \
  --url https://sandbox.finhub.cloud/api/v2.1/fintrans/{accountId}/types/{operationType}/prepare \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --header 'X-Tenant-ID: <x-tenant-id>' \
  --data '
{
  "type": "<string>",
  "sourceAccount": {
    "walletId": "<string>"
  },
  "target": {
    "name": "<string>",
    "accountId": "<string>"
  },
  "amount": {
    "value": "<string>",
    "currency": "<string>",
    "scale": 123
  },
  "reference": "<string>",
  "metadata": {
    "orderId": "<string>",
    "customerId": "<string>",
    "note": "<string>"
  },
  "preparedOrderId": "<string>",
  "confirmationCode": "<string>",
  "clientReference": "<string>",
  "targetAccount": {
    "walletId": "<string>"
  },
  "description": "<string>",
  "merchantDetails": {
    "merchantId": "<string>",
    "merchantName": "<string>",
    "merchantCategory": "<string>"
  },
  "customerDetails": {
    "customerId": "<string>",
    "customerName": "<string>",
    "customerEmail": "<string>"
  }
}
'
{
  "code": 200,
  "message": "Success",
  "data": {
    "preparedOrderId": "666f111b-20fd-4756-b610-3ee24938e96a",
    "summary": {
      "amount": {
        "value": "5000000",
        "currency": "EUR",
        "scale": 2
      },
      "sourceAccount": "FI2112345600000785",
      "targetAccount": "69a7d5b0-58f0-4394-a3fc-4d33058dc89e",
      "fees": {
        "value": "0",
        "currency": "EUR",
        "scale": 2
      },
      "estimatedCompletionTime": "2026-01-13T10:30:00Z"
    },
    "validUntil": "2026-01-13T10:25:00Z",
    "requiresConfirmation": true
  }
}

Account Operations API

Type-specific endpoints for financial operations: topups, transfers, and withdrawals using the prepare-execute workflow.
Status: Production ReadyRecommended: Use these endpoints instead of the generic /transfers API which has known issues.
Base URL: https://sandbox.finhub.cloud/api/v2.1/fintrans
For complete details on authentication and headers, refer to the Standard HTTP Headers reference documentation.

Operation Types

The API supports three operation types:
TypePurposeTypical Use Case
topupAdd funds to accountFunding wallet from external bank
transferMove funds between accountsP2P transfers, payouts
withdrawalRemove funds from accountCash out to external bank

Topup Workflow

Add funds to an account from an external source.

Step 1: Prepare Topup

Validate and stage a topup operation.

Endpoint

POST /api/v2.1/fintrans/{accountId}/types/topup/prepare

Path Parameters

accountId
string
required
Target account UUID to receive fundsExample: 69a7d5b0-58f0-4394-a3fc-4d33058dc89e

Headers

X-Tenant-ID
string
required
Tenant identifier
Authorization
string
required
Bearer token for authentication
Content-Type
string
required
Must be application/json

Request Body

type
string
required
Operation type - must be TOPUP
sourceAccount
object
required
External source account details
target
object
required
Target account reference
amount
object
required
Amount to topup (see AmountDto)
reference
string
Payment reference or descriptionMax length: 140 characters
metadata
object
Optional metadata for tracking

Code Examples

curl -X POST "https://sandbox.finhub.cloud/api/v2.1/fintrans/69a7d5b0-58f0-4394-a3fc-4d33058dc89e/types/topup/prepare" \
  -H "X-Tenant-ID: tenant_cloudvault" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "TOPUP",
    "sourceAccount": {
      "iban": "FI2112345600000785",
      "accountHolder": "John Doe"
    },
    "target": {
      "name": "Wallet: 69a7d5b0-58f0-4394-a3fc-4d33058dc89e",
      "accountId": "69a7d5b0-58f0-4394-a3fc-4d33058dc89e"
    },
    "amount": {
      "value": "5000000",
      "currency": "EUR",
      "scale": 2
    },
    "reference": "Initial wallet funding",
    "metadata": {
      "orderId": "ORD-2026-001",
      "note": "Wallet funding transaction"
    }
  }'

Response

{
  "code": 200,
  "message": "Success",
  "data": {
    "preparedOrderId": "666f111b-20fd-4756-b610-3ee24938e96a",
    "summary": {
      "amount": {
        "value": "5000000",
        "currency": "EUR",
        "scale": 2
      },
      "sourceAccount": "FI2112345600000785",
      "targetAccount": "69a7d5b0-58f0-4394-a3fc-4d33058dc89e",
      "fees": {
        "value": "0",
        "currency": "EUR",
        "scale": 2
      },
      "estimatedCompletionTime": "2026-01-13T10:30:00Z"
    },
    "validUntil": "2026-01-13T10:25:00Z",
    "requiresConfirmation": true
  }
}
Important: The preparedOrderId is valid for a limited time (typically 5 minutes). Execute the operation before validUntil expires.

Step 2: Execute Topup

Execute a prepared topup operation.

Endpoint

POST /api/v2.1/fintrans/{accountId}/types/topup/execute

Path Parameters

accountId
string
required
Target account UUID (must match the prepare request)

Request Body

preparedOrderId
string
required
Prepared order ID from the prepare stepExample: 666f111b-20fd-4756-b610-3ee24938e96a
confirmationCode
string
2FA or confirmation code (if required by policy)
clientReference
string
Client-side reference for idempotency

Code Examples

curl -X POST "https://sandbox.finhub.cloud/api/v2.1/fintrans/69a7d5b0-58f0-4394-a3fc-4d33058dc89e/types/topup/execute" \
  -H "X-Tenant-ID: tenant_cloudvault" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "preparedOrderId": "666f111b-20fd-4756-b610-3ee24938e96a",
    "confirmationCode": "123456"
  }'

Response

{
  "code": 200,
  "message": "Transaction executed successfully",
  "data": {
    "executionId": "01d40939-0b87-4cda-b4aa-ac6cf3ab61ab",
    "status": "EXECUTED",
    "transactionId": "TXN-2026-001-ABC123",
    "amount": {
      "value": "5000000",
      "currency": "EUR",
      "scale": 2
    },
    "executedAt": "2026-01-13T10:24:35.123Z",
    "estimatedSettlement": "2026-01-13T11:00:00Z",
    "trackingReference": "TRK-666f111b-20fd"
  }
}

Transfer Workflow

Move funds between internal accounts or to external beneficiaries.

Prepare Transfer

POST /api/v2.1/fintrans/{accountId}/types/transfer/prepare

Request Body Structure

{
  "type": "TRANSFER",
  "sourceAccount": {
    "accountId": "69a7d5b0-58f0-4394-a3fc-4d33058dc89e"
  },
  "beneficiary": {
    "id": "benef_123456",
    "accountNumber": "LT121000011101001000",
    "name": "Recipient Name"
  },
  "amount": {
    "value": "10000",
    "currency": "EUR",
    "scale": 2
  },
  "reference": "Invoice payment #INV-2026-001",
  "transferType": "SEPA"
}

Execute Transfer

POST /api/v2.1/fintrans/{accountId}/types/transfer/execute
Same execution flow as topup - provide preparedOrderId.

Withdrawal Workflow

Remove funds from wallet to an external bank account. Typically used for cash-out operations to a personal or business bank account.

Step 1: Prepare Withdrawal

POST /api/v2.1/fintrans/{accountId}/types/withdraw/prepare
Endpoint Note: The operation type is withdraw (not withdrawal) in the URL path.

Path Parameters

accountId
string
required
Source wallet/account UUID

Request Body

sourceAccount
object
required
Source wallet details
targetAccount
object
required
Target bank account details
amount
object
required
Withdrawal amount
description
string
Withdrawal description/referenceExample: "E2E Test - Withdrawal to personal account"
reference
string
Transaction referenceExample: "WD-TEST-1736777400000"

Code Examples

curl -X POST "https://sandbox.finhub.cloud/api/v2.1/fintrans/wallet_abc123/types/withdraw/prepare" \
  -H "X-Tenant-ID: tenant_cloudvault" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "sourceAccount": {
      "walletId": "wallet_abc123"
    },
    "targetAccount": {
      "iban": "FI2112345600000785",
      "accountHolder": "John Doe",
      "bic": "NDEAFIHH"
    },
    "amount": {
      "value": "500000",
      "currency": "EUR",
      "scale": 2
    },
    "description": "Withdrawal to personal account",
    "reference": "WD-2026-001"
  }'

Response

{
  "code": 200,
  "message": "Success",
  "data": {
    "preparedOrderId": "abc123-def456-ghi789",
    "summary": {
      "amount": {
        "value": "500000",
        "currency": "EUR",
        "scale": 2
      },
      "sourceAccount": "wallet_abc123",
      "targetAccount": "FI2112345600000785",
      "fees": {
        "value": "250",
        "currency": "EUR",
        "scale": 2
      }
    },
    "validUntil": "2026-01-13T10:25:00Z"
  }
}

Step 2: Execute Withdrawal

POST /api/v2.1/fintrans/{accountId}/types/withdraw/execute

Request Body

preparedOrderId
string
required
Prepared order ID from prepare step

Code Examples

curl -X POST "https://sandbox.finhub.cloud/api/v2.1/fintrans/wallet_abc123/types/withdraw/execute" \
  -H "X-Tenant-ID: tenant_cloudvault" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "preparedOrderId": "abc123-def456-ghi789"
  }'

Purchase Operations

Process merchant payments by debiting from customer wallet. Used for goods/services purchases.

Step 1: Prepare Purchase

POST /api/v2.1/fintrans/{accountId}/types/purchase/prepare

Path Parameters

accountId
string
required
Customer wallet/account UUID

Request Body

sourceAccount
object
required
Source wallet details
merchantDetails
object
required
Merchant information
amount
object
required
Purchase amount
description
string
Purchase descriptionExample: "E2E Test - Purchase transaction"

Code Examples

curl -X POST "https://sandbox.finhub.cloud/api/v2.1/fintrans/wallet_abc123/types/purchase/prepare" \
  -H "X-Tenant-ID: tenant_cloudvault" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "sourceAccount": {
      "walletId": "wallet_abc123"
    },
    "merchantDetails": {
      "merchantId": "MERCHANT_TEST_001",
      "merchantName": "Test Merchant Ltd",
      "merchantCategory": "RETAIL"
    },
    "amount": {
      "value": "250000",
      "currency": "EUR",
      "scale": 2
    },
    "description": "Purchase transaction - electronics"
  }'

Step 2: Execute Purchase

POST /api/v2.1/fintrans/{accountId}/types/purchase/execute
Same execution pattern as withdrawal - provide preparedOrderId.

Sale Operations

Process revenue receipts by crediting to merchant/seller wallet. Used for sales, invoices, and revenue recognition.

Step 1: Prepare Sale

POST /api/v2.1/fintrans/{accountId}/types/sale/prepare

Path Parameters

accountId
string
required
Merchant/seller wallet/account UUID

Request Body

targetAccount
object
required
Target wallet to credit
customerDetails
object
required
Customer/payer information
amount
object
required
Sale amount
description
string
Sale descriptionExample: "E2E Test - Sale transaction (revenue receipt)"

Code Examples

curl -X POST "https://sandbox.finhub.cloud/api/v2.1/fintrans/wallet_abc123/types/sale/prepare" \
  -H "X-Tenant-ID: tenant_cloudvault" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "targetAccount": {
      "walletId": "wallet_abc123"
    },
    "customerDetails": {
      "customerId": "CUSTOMER_TEST_001",
      "customerName": "Test Customer",
      "customerEmail": "[email protected]"
    },
    "amount": {
      "value": "750000",
      "currency": "EUR",
      "scale": 2
    },
    "description": "Sale transaction - consulting services"
  }'

Step 2: Execute Sale

POST /api/v2.1/fintrans/{accountId}/types/sale/execute
Same execution pattern - provide preparedOrderId.

Beneficiary Management

Manage saved beneficiaries for faster transfers.

Create Beneficiary

POST /api/v2.1/fintrans/{accountId}/beneficiaries

Request Body

{
  "name": "Regular Supplier Ltd",
  "accountNumber": "LT121000011101001000",
  "bic": "AGBLLT2X",
  "type": "BUSINESS",
  "currency": "EUR",
  "country": "LT",
  "isPrimary": false
}

Response

{
  "code": 200,
  "message": "Beneficiary created successfully",
  "data": {
    "beneficiaryId": "benef_abc123def456",
    "status": "ACTIVE",
    "createdAt": "2026-01-13T10:24:35.123Z"
  }
}

Amount Representation

All amounts must use the AmountDto structure with value as a string in minor units.

Examples

Display AmountAmountDto Representation
€100.00{"value": "10000", "currency": "EUR", "scale": 2}
€50,000.00{"value": "5000000", "currency": "EUR", "scale": 2}
$1,234.56{"value": "123456", "currency": "USD", "scale": 2}
¥5000{"value": "5000", "currency": "JPY", "scale": 0}

Conversion Helper

// Convert decimal to AmountDto
function toAmountDto(amount, currency = 'EUR', scale = 2) {
  const value = String(Math.round(amount * Math.pow(10, scale)));
  return { value, currency, scale };
}

// Convert AmountDto to decimal
function fromAmountDto(amountDto) {
  return parseInt(amountDto.value) / Math.pow(10, amountDto.scale);
}

// Usage
const dto = toAmountDto(50000); // 50,000.00 EUR
// { value: "5000000", currency: "EUR", scale: 2 }

const amount = fromAmountDto(dto);
// 50000

Operation Limits

Limits are configured per account and can be queried via the allowed operations endpoint.

Typical Limits

OperationDaily LimitSingle TransactionVerification Required
Topup€50,000€10,000TENANT_VERIFIED
Transfer (Internal)€100,000€25,000TENANT_VERIFIED
Transfer (SEPA)€25,000€10,000TENANT_VERIFIED
Withdrawal€10,000€5,000FINHUB_VERIFIED

Error Handling

Common Error Codes

CodeMeaningAction Required
400Invalid request or expired prepared orderRetry prepare step
402Insufficient fundsRequest smaller amount
403Forbidden (beneficiary creation)Retry immediately
409Duplicate transactionCheck if already processed
429Rate limit exceededWait and retry with backoff

Retry Strategy

const executeWithRetry = async (fn, maxRetries = 3) => {
  for (let attempt = 1; attempt <= maxRetries; attempt++) {
    try {
      return await fn();
    } catch (error) {
      if (error.status === 403 && attempt < maxRetries) {
        await new Promise(resolve => setTimeout(resolve, 100 * attempt));
        continue;
      }
      throw error;
    }
  }
};

Testing

Sandbox Test Data

Use these test IBANs in sandbox environment:
IBANPurposeResult
FI2112345600000785Successful topupAlways succeeds
FI2112345600000786Insufficient fundsReturns 402 error
FI2112345600000787Slow processingSimulates 30s delay