Reject Deposit Account
Overview
The RejectDepositCommand allows supervisors or authorized users to reject a pending deposit account with a reason for rejection.
Endpoint
POST /api/bpm/cmd
Request Body
{
"cmd": "RejectDepositCommand",
"data": {
"accountEncodedKey": "DEP-123456",
"comment": "Documentation incomplete"
}
}
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| cmd | string | Yes | Must be "RejectDepositCommand" |
| data | object | Yes | Rejection data |
| ↳ accountEncodedKey | string | Yes | Deposit account identifier |
| ↳ comment | string | No | Rejection reason |
## Response Structure
### Success Response
```json
{
"succeeded": true,
"message": "Deposit account rejected successfully",
"data": {
"depositId": "DEP001234",
"accountNumber": "1234567890",
"status": "Rejected",
"rejectedBy": "supervisor@bank.com",
"rejectedDate": "2024-01-16T10:00:00Z",
"rejectionReason": "Incomplete documentation. Customer KYC verification failed."
},
"statusCode": 200
}
Error Response
{
"succeeded": false,
"message": "Failed to reject deposit account",
"errors": [
{
"code": "DEPOSIT_NOT_PENDING",
"message": "Deposit account is not in Pending_Approval status",
"field": "depositId"
}
],
"statusCode": 400
}
Field Descriptions
| Field | Type | Required | Description |
|---|---|---|---|
depositId | string | Yes | Unique identifier of the deposit account to reject |
rejectionReason | string | Yes | Reason for rejecting the deposit account |
Business Rules
-
Status Requirements
- Deposit account must be in "Pending_Approval" status
- Account must not already be approved or rejected
-
Authorization
- User must have approval permissions
- User cannot reject their own requests (maker-checker separation)
-
Rejection Reason
- Rejection reason is mandatory
- Reason must be clear and specific
-
Post-Rejection
- Account status changes to "Rejected"
- Account cannot be used for transactions
- Rejection notification sent to initiator
Error Codes
| Code | Description | HTTP Status |
|---|---|---|
DEPOSIT_NOT_FOUND | Deposit account does not exist | 404 |
DEPOSIT_NOT_PENDING | Deposit account is not pending approval | 400 |
REJECTION_REASON_REQUIRED | Rejection reason is mandatory | 400 |
INSUFFICIENT_PERMISSIONS | User does not have rejection permissions | 403 |
INTERNAL_ERROR | An unexpected error occurred | 500 |
Code Examples
C# Example
public async Task<CommanExecutionResponse> RejectDepositAccountAsync(
string depositId,
string reason)
{
var command = new RejectDepositCommand
{
DepositId = depositId,
RejectionReason = reason
};
var response = await _client.Deposits.RejectAsync(command);
if (response.Succeeded)
{
Console.WriteLine($"Deposit account {response.Data.AccountNumber} rejected");
Console.WriteLine($"Reason: {response.Data.RejectionReason}");
}
return response;
}
JavaScript/TypeScript Example
async rejectDepositAccount(depositId: string, reason: string) {
const command = {
depositId,
rejectionReason: reason
};
const response = await this.client.deposits.reject(command);
if (response.succeeded) {
console.log(`Deposit account ${response.data.accountNumber} rejected`);
console.log(`Reason: ${response.data.rejectionReason}`);
}
return response;
}
Related Commands
- Request Deposit Approval - Submit deposit for approval
- Approve Deposit - Approve pending deposit account