Skip to main content

Request Deposit Approval

Overview

The RequestDepositApprovalCommand submits a deposit account for approval, initiating the maker-checker workflow.

Endpoint

POST /api/bpm/cmd

Request Body

{
"cmd": "RequestDepositApprovalCommand",
"data": {
"accountEncodedKey": "DEP-123456",
"comment": "Ready for approval"
}
}

Request Parameters

ParameterTypeRequiredDescription
cmdstringYesMust be "RequestDepositApprovalCommand"
dataobjectYesApproval request data
↳ accountEncodedKeystringYesDeposit account identifier
↳ commentstringNoRequest comment

## Response Structure

### Success Response

```json
{
"succeeded": true,
"message": "Approval request submitted successfully",
"data": {
"depositId": "DEP001234",
"accountNumber": "1234567890",
"status": "Pending_Approval",
"requestedBy": "user@bank.com",
"requestedDate": "2024-01-15T14:30:00Z",
"comments": "New savings account for VIP customer. Please review and approve.",
"priority": "High"
},
"statusCode": 200
}

Field Descriptions

FieldTypeRequiredDescription
depositIdstringYesUnique identifier of the deposit account
commentsstringNoComments for the approver
prioritystringNoPriority level (Low, Normal, High)

Business Rules

  1. Status Requirements

    • Account must exist and not be closed
    • Account must not already be pending approval
  2. Authorization

    • User must have permission to request approval
    • System validates approval workflow requirements

Error Codes

CodeDescriptionHTTP Status
DEPOSIT_NOT_FOUNDDeposit account does not exist404
ALREADY_PENDING_APPROVALAccount is already pending approval400
INSUFFICIENT_PERMISSIONSUser does not have permission403
INTERNAL_ERRORAn unexpected error occurred500

Code Examples

C# Example

public async Task<CommanExecutionResponse> RequestApprovalAsync(string depositId)
{
var command = new RequestDepositApprovalCommand
{
DepositId = depositId,
Comments = "Please review and approve this deposit account",
Priority = "Normal"
};

var response = await _client.Deposits.RequestApprovalAsync(command);
return response;
}

JavaScript/TypeScript Example

async requestApproval(depositId: string) {
const command = {
depositId,
comments: 'Please review and approve this deposit account',
priority: 'Normal'
};

const response = await this.client.deposits.requestApproval(command);
return response;
}