Skip to main content

Approve Deposit Account

Overview

The ApproveDepositCommand allows supervisors or authorized users to approve a pending deposit account, activating it for use.

Endpoint

POST /api/bpm/cmd

Request Body

{
"cmd": "ApproveDepositCommand",
"data": {
"accountEncodedKey": "DEP-123456",
"comment": "Account approved after verification"
}
}

Request Parameters

ParameterTypeRequiredDescription
cmdstringYesMust be "ApproveDepositCommand"
dataobjectYesApproval data
↳ accountEncodedKeystringYesDeposit account identifier
↳ commentstringNoApproval comment

## Response Structure

### Success Response

```json
{
"succeeded": true,
"message": "Deposit account approved successfully",
"data": {
"depositId": "DEP001234",
"accountNumber": "1234567890",
"status": "Active",
"approvedBy": "supervisor@bank.com",
"approvedDate": "2024-01-16T10:00:00Z",
"approvalComments": "Account documentation verified. Approved for activation."
},
"statusCode": 200
}

Error Response

{
"succeeded": false,
"message": "Failed to approve deposit account",
"errors": [
{
"code": "DEPOSIT_NOT_PENDING",
"message": "Deposit account is not in Pending_Approval status",
"field": "depositId"
}
],
"statusCode": 400
}

Field Descriptions

FieldTypeRequiredDescription
depositIdstringYesUnique identifier of the deposit account to approve
approvalCommentsstringNoComments explaining the approval decision

Business Rules

  1. Status Requirements

    • Deposit account must be in "Pending_Approval" status
    • Account must not already be approved or rejected
  2. Authorization

    • User must have approval permissions
    • User cannot approve their own requests (maker-checker separation)
    • User must be assigned to the same branch or have cross-branch approval rights
  3. Account Activation

    • Upon approval, account status changes to "Active"
    • Account becomes available for transactions
    • Customer notifications are triggered

Error Codes

CodeDescriptionHTTP Status
DEPOSIT_NOT_FOUNDDeposit account does not exist404
DEPOSIT_NOT_PENDINGDeposit account is not pending approval400
SELF_APPROVAL_NOT_ALLOWEDCannot approve your own request403
INSUFFICIENT_PERMISSIONSUser does not have approval permissions403
INTERNAL_ERRORAn unexpected error occurred500

Code Examples

C# Example

public async Task<CommanExecutionResponse> ApproveDepositAccountAsync(
string depositId,
string comments)
{
var command = new ApproveDepositCommand
{
DepositId = depositId,
ApprovalComments = comments
};

var response = await _client.Deposits.ApproveAsync(command);

if (response.Succeeded)
{
Console.WriteLine($"Deposit account {response.Data.AccountNumber} approved");
Console.WriteLine($"Status: {response.Data.Status}");
}

return response;
}

JavaScript/TypeScript Example

async approveDepositAccount(depositId: string, comments: string) {
const command = {
depositId,
approvalComments: comments
};

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

if (response.succeeded) {
console.log(`Deposit account ${response.data.accountNumber} approved`);
console.log(`Status: ${response.data.status}`);
}

return response;
}

cURL Example

curl -X POST https://api.banklingo.com/api/administration/deposits/approve \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"depositId": "DEP001234",
"approvalComments": "Account documentation verified. Approved for activation."
}'