Skip to main content

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

ParameterTypeRequiredDescription
cmdstringYesMust be "UpdateDepositCommand"
dataobjectYesUpdate data
↳ depositEncodedKeystringYesDeposit account identifier
↳ productDisplayNamestringNoUpdated account name
↳ associationInformationobjectYesAccount associations
  ↳ accountOfficerEncodedKeystringYesAccount officer identifier
  ↳ clientBranchEncodedKeystringYesBranch identifier
↳ accountInformationobjectYesAccount details
  ↳ accountTierIdintegerNoAccount tier identifier
  ↳ accountStatestringNoAccount state
↳ signatoryInformationarrayYesList of signatories (at least one required)
  ↳ clientEncodedKeystringYesSignatory client identifier
  ↳ rolestringYesSignatory role
  ↳ signatoryTypestringYesType (Single, Joint)
↳ notesstringNoUpdate 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

FieldTypeRequiredDescription
depositIdstringYesUnique identifier of the deposit account to update
accountNamestringNoNew display name for the deposit account
accountOfficerIdstringNoNew account officer to assign to this account
statusstringNoNew account status (Active, Dormant, Frozen, etc.)
additionalPropertiesobjectNoAdditional custom properties to update

Business Rules

  1. Deposit Account Validation

    • Deposit account must exist in the system
    • Account must not be closed
    • User must have permission to update the account
  2. 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
  3. 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
  4. 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

CodeDescriptionHTTP Status
DEPOSIT_NOT_FOUNDDeposit account does not exist404
DEPOSIT_CLOSEDCannot update a closed deposit account400
INVALID_STATUSInvalid status value provided400
INVALID_ACCOUNT_OFFICERAccount officer does not exist or is not assigned to branch400
UNAUTHORIZED_UPDATEUser does not have permission to update this account403
VALIDATION_ERROROne or more validation errors occurred400
INTERNAL_ERRORAn unexpected error occurred500

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" }
}
};

See Also