Skip to main content

Undo Deposit Approval

Overviewโ€‹

The UndoDepositApprovalCommand allows users to retract a previously approved deposit account, reverting it to draft status.

Endpointโ€‹

POST /api/bpm/cmd

Request Bodyโ€‹

{
"cmd": "UndoDepositApprovalCommand",
"data": {
"accountEncodedKey": "DEP-123456",
"comment": "Need to reverify documents"
}
}

Request Parametersโ€‹

ParameterTypeRequiredDescription
cmdstringYesMust be "UndoDepositApprovalCommand"
dataobjectYesUndo approval data
รขโ€ ยณ accountEncodedKeystringYesDeposit account identifier
รขโ€ ยณ commentstringNoReason for undoing approval

## Response Structure

### Success Response

```json
{
"succeeded": true,
"message": "Deposit approval undone successfully",
"data": {
"depositId": "DEP001234",
"accountNumber": "1234567890",
"status": "Draft",
"undoneBy": "user@bank.com",
"undoneDate": "2024-01-16T11:00:00Z",
"reason": "Account information needs to be corrected before activation"
},
"statusCode": 200
}

Field Descriptionsโ€‹

FieldTypeRequiredDescription
depositIdstringYesUnique identifier of the deposit account
reasonstringYesReason for undoing the approval

Business Rulesโ€‹

  1. Status Requirements

    • Account must be in "Active" or "Pending_Approval" status
    • Account must not have any transactions posted
  2. Authorization

    • User must have permission to undo approvals
    • Typically restricted to supervisors or system administrators
  3. Transaction Check

    • Cannot undo approval if account has posted transactions
    • Balance must be zero or initial deposit only

Error Codesโ€‹

CodeDescriptionHTTP Status
DEPOSIT_NOT_FOUNDDeposit account does not exist404
CANNOT_UNDO_APPROVALAccount has transactions and cannot be reverted400
INVALID_STATUSAccount status does not allow undo operation400
INSUFFICIENT_PERMISSIONSUser does not have 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 undoDepositApproval(depositId: string, reason: string) {
const command = {
depositId,
reason
};

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

if (response.succeeded) {
console.log(`Deposit approval undone: ${response.data.accountNumber}`);
console.log(`New Status: ${response.data.status}`);
}

return response;
}