Update Deposit Account
Overview
The UpdateDepositCommand allows you to update an existing deposit account's information in the banking system. This command enables modification of account details, settings, and configuration after the account has been created.
Endpoint
POST /api/bpm/cmd
Request Body
{
"cmd": "UpdateDepositCommand",
"data": {
"depositEncodedKey": "DEP-123456",
"productDisplayName": "John Doe Premium Savings Account",
"associationInformation": {
"accountOfficerEncodedKey": "OFF-789",
"clientBranchEncodedKey": "BRANCH-001"
},
"accountInformation": {
"accountTierId": 2,
"accountState": "Active"
},
"signatoryInformation": [
{
"clientEncodedKey": "CLI-123456",
"role": "Primary",
"signatoryType": "Single"
}
],
"notes": "Updated account tier and officer"
}
}
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| cmd | string | Yes | Must be "UpdateDepositCommand" |
| data | object | Yes | Update data |
| ↳ depositEncodedKey | string | Yes | Deposit account identifier |
| ↳ productDisplayName | string | No | Updated account name |
| ↳ associationInformation | object | Yes | Account associations |
| ↳ accountOfficerEncodedKey | string | Yes | Account officer identifier |
| ↳ clientBranchEncodedKey | string | Yes | Branch identifier |
| ↳ accountInformation | object | Yes | Account details |
| ↳ accountTierId | integer | No | Account tier identifier |
| ↳ accountState | string | No | Account state |
| ↳ signatoryInformation | array | Yes | List of signatories (at least one required) |
| ↳ clientEncodedKey | string | Yes | Signatory client identifier |
| ↳ role | string | Yes | Signatory role |
| ↳ signatoryType | string | Yes | Type (Single, Joint) |
| ↳ notes | string | No | Update notes |
## Response Structure
### Success Response
```json
{
"succeeded": true,
"message": "Deposit account updated successfully",
"data": {
"depositId": "DEP001234",
"accountNumber": "1234567890",
"accountName": "John Doe Primary Savings Account",
"accountOfficerId": "AO456",
"status": "Active",
"updatedDate": "2024-01-15T14:30:00Z",
"updatedBy": "user@bank.com"
},
"statusCode": 200
}
Error Response
{
"succeeded": false,
"message": "Failed to update deposit account",
"errors": [
{
"code": "DEPOSIT_NOT_FOUND",
"message": "Deposit account with ID DEP001234 does not exist",
"field": "depositId"
}
],
"statusCode": 404
}
Field Descriptions
| Field | Type | Required | Description |
|---|---|---|---|
depositId | string | Yes | Unique identifier of the deposit account to update |
accountName | string | No | New display name for the deposit account |
accountOfficerId | string | No | New account officer to assign to this account |
status | string | No | New account status (Active, Dormant, Frozen, etc.) |
additionalProperties | object | No | Additional custom properties to update |
Business Rules
-
Deposit Account Validation
- Deposit account must exist in the system
- Account must not be closed
- User must have permission to update the account
-
Field Update Restrictions
- Cannot change account number once created
- Cannot change customer or product after account creation
- Cannot change currency after account creation
- Balance modifications require separate transaction commands
-
Status Changes
- Status changes may require approval based on configuration
- Some status changes may be restricted (e.g., cannot activate a closed account)
- Status changes must comply with regulatory requirements
-
Account Officer Assignment
- New account officer must exist and be active
- Officer must be assigned to the account's branch
- Officer must have appropriate permissions
Error Codes
| Code | Description | HTTP Status |
|---|---|---|
DEPOSIT_NOT_FOUND | Deposit account does not exist | 404 |
DEPOSIT_CLOSED | Cannot update a closed deposit account | 400 |
INVALID_STATUS | Invalid status value provided | 400 |
INVALID_ACCOUNT_OFFICER | Account officer does not exist or is not assigned to branch | 400 |
UNAUTHORIZED_UPDATE | User does not have permission to update this account | 403 |
VALIDATION_ERROR | One or more validation errors occurred | 400 |
INTERNAL_ERROR | An unexpected error occurred | 500 |
Code Examples
C# Example
using BankLingo.Api.Client;
using BankLingo.Api.Models;
public class DepositAccountService
{
private readonly IBankLingoClient _client;
public DepositAccountService(IBankLingoClient client)
{
_client = client;
}
public async Task<CommanExecutionResponse> UpdateDepositAccountAsync(
string depositId,
string newAccountName,
string newAccountOfficerId)
{
var command = new UpdateDepositCommand
{
DepositId = depositId,
AccountName = newAccountName,
AccountOfficerId = newAccountOfficerId,
AdditionalProperties = new Dictionary<string, string>
{
{ "lastUpdatedReason", "Account officer reassignment" },
{ "updatedChannel", "BackOffice" }
}
};
try
{
var response = await _client.Deposits.UpdateAsync(command);
if (response.Succeeded)
{
Console.WriteLine($"Deposit account updated: {response.Data.DepositId}");
}
else
{
Console.WriteLine($"Error: {response.Message}");
}
return response;
}
catch (Exception ex)
{
Console.WriteLine($"Exception: {ex.Message}");
throw;
}
}
}
JavaScript/TypeScript Example
import { BankLingoClient, UpdateDepositCommand } from '@banklingo/api-client';
class DepositAccountService {
private client: BankLingoClient;
constructor(client: BankLingoClient) {
this.client = client;
}
async updateDepositAccount(
depositId: string,
newAccountName: string,
newAccountOfficerId: string
) {
const command: UpdateDepositCommand = {
depositId,
accountName: newAccountName,
accountOfficerId: newAccountOfficerId,
additionalProperties: {
lastUpdatedReason: 'Account officer reassignment',
updatedChannel: 'BackOffice'
}
};
try {
const response = await this.client.deposits.update(command);
if (response.succeeded) {
console.log(`Deposit account updated: ${response.data.depositId}`);
} else {
console.log(`Error: ${response.message}`);
}
return response;
} catch (error) {
console.error('Exception:', error);
throw error;
}
}
}
cURL Example
curl -X PUT https://api.banklingo.com/api/administration/deposits/update \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"depositId": "DEP001234",
"accountName": "John Doe Primary Savings Account",
"accountOfficerId": "AO456",
"additionalProperties": {
"accountCategory": "Premium",
"monthlyStatementEmail": "john.doe@email.com"
}
}'
Common Use Cases
1. Update Account Name
var command = new UpdateDepositCommand
{
DepositId = "DEP001234",
AccountName = "John Doe Premium Savings"
};
2. Reassign Account Officer
var command = new UpdateDepositCommand
{
DepositId = "DEP001234",
AccountOfficerId = "AO789",
AdditionalProperties = new Dictionary<string, string>
{
{ "reassignmentReason", "Previous officer transferred" }
}
};
3. Change Account Status
var command = new UpdateDepositCommand
{
DepositId = "DEP001234",
Status = "Dormant",
AdditionalProperties = new Dictionary<string, string>
{
{ "statusChangeReason", "No transactions for 12 months" }
}
};
4. Update Custom Properties
var command = new UpdateDepositCommand
{
DepositId = "DEP001234",
AdditionalProperties = new Dictionary<string, string>
{
{ "accountCategory", "Premium" },
{ "monthlyStatementEmail": "newemail@example.com",
{ "smsNotifications", "true" }
}
};
Related Commands
- Create Deposit Account - Create new deposit account
- Retrieve Deposit By ID - Get deposit account details
- Close Deposit - Close deposit account