Skip to main content

Transfer From Branch Vault Account

Overview

Processes a transfer or withdrawal transaction from a branch vault to another destination.

Command

TransferFromBranchVaultAccountCommand

Endpoint

POST /api/bpm/cmd

Request Headers

Authorization: Bearer {access_token}
Content-Type: application/json
X-Tenant-Id: {tenant_id}

Request Body

{
"cmd": "TransferFromBranchVaultAccountCommand",
"data": {
"vaultId": "VLT-001",
"amount": 500000.00,
"destinationType": "TellerTill",
"destinationId": "TILL-T001",
"narration": "Morning till allocation",
"transactionDate": "2024-12-18T08:00:00Z",
"requiresApproval": false
}
}

Request Parameters

ParameterTypeRequiredDescription
cmdstringYesMust be "TransferFromBranchVaultAccountCommand"
dataobjectYesTransfer transaction data
↳ vaultIdstringYesUnique identifier of the source vault
↳ amountdecimalYesAmount to transfer (must be positive)
↳ destinationTypestringYesType of destination (TellerTill, AnotherVault, ExternalAccount, BankAccount)
↳ destinationIdstringYesIdentifier of the destination
↳ narrationstringYesTransaction description
↳ transactionDatedatetimeNoTransaction timestamp (defaults to current time)
↳ requiresApprovalbooleanNoWhether transaction requires approval (default: false)
  • Type: string
  • Required: Yes
  • Description: Transaction description

transactionDate

  • Type: datetime
  • Required: No
  • Default: Current date/time
  • Description: Date and time of the transaction

requiresApproval

  • Type: boolean
  • Required: No
  • Default: Based on vault configuration
  • Description: Whether transfer requires approval

Response

Success Response (200 OK)

{
"success": true,
"message": "Transfer completed successfully",
"data": {
"transactionId": "string",
"vaultId": "string",
"destinationType": "string",
"destinationId": "string",
"amount": "decimal",
"previousBalance": "decimal",
"newBalance": "decimal",
"transactionDate": "datetime",
"status": "Completed"
}
}

Error Responses

400 Bad Request

{
"success": false,
"message": "Validation failed",
"errors": ["Amount must be greater than zero", "Destination ID is required"]
}

404 Not Found

{
"success": false,
"message": "Vault or destination not found"
}

409 Conflict

{
"success": false,
"message": "Insufficient vault balance"
}

Business Rules

  1. Amount must be positive and non-zero
  2. Vault must have sufficient balance
  3. Cannot reduce balance below minimum threshold
  4. Destination must be active
  5. Currency must match between source and destination
  6. Large transfers may require approval

Code Example

async function transferFromVault(vaultId, amount, destinationType, destinationId, narration) {
const response = await fetch('/api/bpm/cmd', {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'X-Tenant-Id': tenantId
},
body: JSON.stringify({
commandType: 'TransferFromBranchVaultAccountCommand',
data: {
vaultId: vaultId,
amount: amount,
destinationType: destinationType,
destinationId: destinationId,
narration: narration
}
})
});

return await response.json();
}

Notes

  • Verify sufficient balance before transfers
  • Monitor minimum balance thresholds
  • Document all transfers for audit purposes
  • Consider approval workflows for high-value transfers