Skip to main content

Close Deposit Account

Overviewโ€‹

The CloseDepositCommand allows authorized users to close a deposit account, making it inactive and preventing future transactions.

Endpointโ€‹

POST /api/bpm/cmd

Request Bodyโ€‹

{
"cmd": "CloseDepositCommand",
"data": {
"accountEncodedKey": "DEP-123456",
"closureType": "ClientRequested",
"comment": "Account closure as per customer request"
}
}

Request Parametersโ€‹

ParameterTypeRequiredDescription
cmdstringYesMust be "CloseDepositCommand"
dataobjectYesClosure data
รขโ€ ยณ accountEncodedKeystringYesDeposit account identifier
รขโ€ ยณ closureTypestringYesType of closure (ClientRequested, Dormant, etc.)
รขโ€ ยณ commentstringNoClosure reason/comment

## Response Structure

### Success Response

```json
{
"succeeded": true,
"message": "Deposit account closed successfully",
"data": {
"depositId": "DEP001234",
"accountNumber": "1234567890",
"status": "Closed",
"closingBalance": 250000.00,
"transferToAccountNumber": "9876543210",
"closedBy": "user@bank.com",
"closedDate": "2024-01-16T15:00:00Z",
"closureReason": "Customer request - Account consolidation"
},
"statusCode": 200
}

Error Responseโ€‹

{
"succeeded": false,
"message": "Failed to close deposit account",
"errors": [
{
"code": "OUTSTANDING_BALANCE",
"message": "Account has outstanding balance that must be transferred",
"field": "depositId"
}
],
"statusCode": 400
}

Field Descriptionsโ€‹

FieldTypeRequiredDescription
depositIdstringYesUnique identifier of the deposit account to close
closureReasonstringYesReason for closing the account
transferToAccountNumberstringConditionalAccount to transfer remaining balance (required if balance > 0)

Business Rulesโ€‹

  1. Balance Requirements

    • If account has a positive balance, must specify transfer account
    • Cannot close account with negative balance
    • All pending transactions must be cleared
  2. Authorization

    • User must have permission to close accounts
    • Some account types may require approval before closure
  3. Account Status

    • Account must be in "Active" or "Dormant" status
    • Cannot close already closed accounts
  4. Transfer Account Validation

    • Transfer account must exist and be active
    • Transfer account must belong to the same customer
    • Transfer account must support the currency
  5. Post-Closure

    • Account status changed to "Closed"
    • No further transactions allowed
    • Account retained for historical records

Error Codesโ€‹

CodeDescriptionHTTP Status
DEPOSIT_NOT_FOUNDDeposit account does not exist404
OUTSTANDING_BALANCEAccount has balance requiring transfer400
INVALID_TRANSFER_ACCOUNTTransfer account is invalid400
PENDING_TRANSACTIONSAccount has pending transactions400
ALREADY_CLOSEDAccount is already closed400
INSUFFICIENT_PERMISSIONSUser does not have closure permission403
INTERNAL_ERRORAn unexpected error occurred500

Code Examplesโ€‹

C# Exampleโ€‹

Code Removed

Implementation details removed for security.

Contact support for implementation guidance.

JavaScript/TypeScript Exampleโ€‹

async closeDepositAccount(
depositId: string,
reason: string,
transferToAccount?: string
) {
const command = {
depositId,
closureReason: reason,
transferToAccountNumber: transferToAccount
};

const response = await this.client.deposits.close(command);

if (response.succeeded) {
console.log(`Deposit account closed: ${response.data.accountNumber}`);
console.log(`Closing Balance: ${response.data.closingBalance.toFixed(2)}`);

if (response.data.transferToAccountNumber) {
console.log(`Balance transferred to: ${response.data.transferToAccountNumber}`);
}
}

return response;
}

cURL Exampleโ€‹

curl -X POST https://api.banklingo.com/api/administration/deposits/close \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"depositId": "DEP001234",
"closureReason": "Customer request - Account consolidation",
"transferToAccountNumber": "9876543210"
}'

Common Use Casesโ€‹

1. Close Zero-Balance Accountโ€‹

Code Removed

Implementation details removed for security.

Contact support for implementation guidance.

2. Close Account with Balance Transferโ€‹

Code Removed

Implementation details removed for security.

Contact support for implementation guidance.

3. Close Dormant Accountโ€‹

Code Removed

Implementation details removed for security.

Contact support for implementation guidance.

Integration Examplesโ€‹

Complete Account Closure Workflowโ€‹

Code Removed

Implementation details removed for security.

Contact support for implementation guidance.

Notesโ€‹

  • Permanent Action: Account closure is typically permanent and cannot be easily reversed
  • Historical Data: Closed accounts remain in the system for historical and compliance purposes
  • Balance Transfer: Automatic balance transfer is executed as part of the closure process
  • Notifications: System sends closure confirmation to customer and account officer
  • Regulatory Compliance: Closure must comply with banking regulations and customer agreement terms
  • Audit Trail: All closure operations are logged with detailed audit information

See Alsoโ€‹