Create Branch Vault
Overview
Creates a new vault for a specific branch to manage cash holdings and facilitate teller transactions.
Command
CreateBranchVaultCommand
Endpoint
POST /api/bpm/cmd
Request Headers
Authorization: Bearer {access_token}
Content-Type: application/json
X-Tenant-Id: {tenant_id}
Request Body
{
"cmd": "CreateBranchVaultCommand",
"data": {
"branchId": "BR-001",
"vaultName": "Main Vault",
"currencyCode": "NGN",
"maximumBalance": 10000000.00,
"minimumBalance": 50000.00,
"requiresApproval": true,
"description": "Main cash vault for branch operations"
}
}
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| branchId | string | Yes | Unique identifier of the branch where the vault will be created |
| vaultName | string | Yes | Name of the vault for identification purposes |
| currencyCode | string | Yes | ISO currency code (e.g., "NGN", "USD", "GHS") |
| maximumBalance | decimal | No | Maximum amount the vault can hold |
| minimumBalance | decimal | No | Minimum balance threshold for the vault |
| requiresApproval | boolean | No | Whether vault transactions require approval (default: false) |
| description | string | No | Additional information about the vault |
Response
Success Response (200 OK)
{
"success": true,
"message": "Branch vault created successfully",
"data": {
"vaultId": "string",
"branchId": "string",
"vaultName": "string",
"currencyCode": "string",
"currentBalance": 0.00,
"maximumBalance": "decimal",
"minimumBalance": "decimal",
"status": "Active",
"createdDate": "datetime",
"requiresApproval": "boolean"
}
}
Error Responses
400 Bad Request
{
"success": false,
"message": "Validation failed",
"errors": [
"Branch ID is required",
"Vault name is required",
"Currency code is required"
]
}
404 Not Found
{
"success": false,
"message": "Branch not found with the provided ID"
}
409 Conflict
{
"success": false,
"message": "Vault already exists for this branch and currency"
}
Business Rules
- Each branch can have multiple vaults for different currencies
- Vault name must be unique within a branch
- Maximum balance must be greater than minimum balance if both are specified
- Only active branches can have vaults created
- Currency code must be supported by the system
- Initial vault balance starts at zero
Code Example
async function createBranchVault(branchId, vaultName, currencyCode) {
const response = await fetch('/api/bpm/cmd', {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'X-Tenant-Id': tenantId
},
body: JSON.stringify({
cmd: 'CreateBranchVaultCommand',
data: {
branchId: branchId,
vaultName: vaultName,
currencyCode: currencyCode,
maximumBalance: 10000000.00,
minimumBalance: 50000.00,
requiresApproval: true,
description: 'Main cash vault for branch operations'
}
})
});
return await response.json();
}
Related Commands
- Update Branch Vault - Modify vault settings
- Get Branch Vault List - Retrieve all vaults
- Fund Branch Vault Account - Add funds to vault
Notes
- Vaults are essential for teller operations and cash management
- Consider setting appropriate balance limits based on branch size and transaction volume
- Enable approval requirements for high-security branches
- Regular monitoring of vault balances helps prevent cash shortages