Seize Lock Amount
Convert a locked amount to an actual debit, permanently removing the funds from the account for legal seizure or final payment settlement.
Overviewโ
The SeizeDepositLockAmountCommand converts an amount lock into an actual debit transaction. Unlike DeleteDepositLockAmountCommand which releases funds back to the account, this command permanently debits the locked amount. This is used for legal seizures, court orders, final settlement of card transactions, or when a hold must be converted to a permanent charge.
Key Capabilitiesโ
- Lock Conversion: Converts lock to actual debit
- Permanent Debit: Funds permanently removed from account
- Transaction Creation: Creates seizure transaction for audit
- Channel Integration: Links to transaction channel
- Service Categorization: Supports service ID and description
- Atomic Operation: Uses database transaction for consistency
- Audit Trail: Complete record of seizure with reason
API Endpointโ
POST /api/bpm/cmd
Request Structureโ
{
"commandName": "SeizeDepositLockAmountCommand",
"data": {
"accountEncodedKey": "string",
"blockReference": "string",
"channelEncodedKey": "string",
"transactionExternalReference": "string",
"serviceId": "string",
"serviceDescription": "string",
"remarks": "string",
"serviceCommision": "decimal"
}
}
Request Fieldsโ
| Field | Type | Required | Description |
|---|---|---|---|
accountEncodedKey | string | Yes | Account number or encoded key |
blockReference | string | Yes | Unique reference from original lock |
channelEncodedKey | string | Yes | Transaction channel identifier |
transactionExternalReference | string | No | External system reference |
serviceId | string | No | Service identifier for categorization |
serviceDescription | string | No | Human-readable service description |
remarks | string | No | Additional notes/reason for seizure |
serviceCommision | decimal | No | Optional commission amount |
Response Structureโ
Success Responseโ
{
"isSuccessful": true,
"message": "Locked amount has been seized successfully.",
"statusCode": "00",
"data": {
"transactionKey": "8A3F2D1E9B5C4F7A6E8D2C1B3A9F5E7D",
"amount": 2500.00
}
}
Error Responseโ
{
"isSuccessful": false,
"message": "There is no existing amount lock with the specified reference",
"statusCode": "Client_Not_Found"
}
Sample Requestsโ
1. Seize for Legal Orderโ
{
"commandName": "SeizeDepositLockAmountCommand",
"data": {
"accountEncodedKey": "ACC001234567",
"blockReference": "LEGAL-HOLD-2024-123",
"channelEncodedKey": "BRANCH-CHANNEL",
"serviceId": "LEGAL_SEIZURE",
"serviceDescription": "Court Order Seizure",
"remarks": "Court order #CO-2024-5678 - Final seizure"
}
}
2. Seize Card Transactionโ
{
"commandName": "SeizeDepositLockAmountCommand",
"data": {
"accountEncodedKey": "SAV987654321",
"blockReference": "CARD-AUTH-20241217-001",
"channelEncodedKey": "CARD-CHANNEL",
"transactionExternalReference": "VISA-TXN-456789",
"serviceId": "CARD_SETTLEMENT",
"serviceDescription": "Card Transaction Settlement",
"remarks": "Final settlement of card purchase",
"serviceCommision": 25.00
}
}
3. Seize Hotel Chargesโ
{
"commandName": "SeizeDepositLockAmountCommand",
"data": {
"accountEncodedKey": "8A3F2D1E9B5C4F7A6E8D2C1B3A9F5E7D",
"blockReference": "HOTEL-HOLD-5678",
"channelEncodedKey": "MERCHANT-CHANNEL",
"serviceId": "HOTEL_PAYMENT",
"serviceDescription": "Hotel Room Charges",
"remarks": "Final hotel bill - Room damages"
}
}
Business Logicโ
Processing Workflowโ
Validation Stepsโ
- Extract Fields: Get all request parameters
- Account Query: Load account with Client, Product, Currency relationships
- Account Validation: Verify account exists
- Channel Query: Validate transaction channel
- Channel Validation: Verify channel is valid and active
- Lock Query: Find lock with matching blockReference and LOCKED state
- Lock Validation: Verify lock exists and transaction is in HOLD state
- Transaction Begin: Start database transaction
- Transaction Key: Generate unique GUID-based key
- State Updates:
- Set lock transaction to SETTLED
- Set lock state to SEIZED
- Decrease BlockedAmount (not AccountBalance - already blocked)
- Seizure Transaction Creation:
- Create CBSTransaction with SETTLED state
- Create DepositTransaction with DEBIT entry
- Link to GL account from product
- Set narration with block reference
- Persist Changes: Update lock, account, and transactions
- Commit: Commit database transaction
- Success Response: Return transaction key and amount
Balance Impactโ
Before Seize:
AccountBalance: 10,000.00 (already reduced when lock was created)
BlockedAmount: 2,000.00
Available: 8,000.00
After Seize (2,000 lock converted):
AccountBalance: 10,000.00 (unchanged - was already debited)
BlockedAmount: 0.00 (lock removed)
Available: 10,000.00
Net Effect: 2,000 permanently removed
Error Responsesโ
| Error Code | Message | Scenario | Resolution |
|---|---|---|---|
Client_Not_Found | "Account not valid" | Invalid account identifier | Verify account number/key |
INVALID_REQUEST | "Channel not valid" | Invalid or inactive channel | Verify channelEncodedKey |
Client_Not_Found | "No lock with reference" | Lock not found or already processed | Verify blockReference |
Code Examplesโ
C# Implementationโ
Implementation details removed for security.
Contact support for implementation guidance.
JavaScript Implementationโ
async seizeLockAmount(
accountEncodedKey,
blockReference,
channelEncodedKey,
options = {}
) {
const request = {
commandName: 'SeizeDepositLockAmountCommand',
data: {
accountEncodedKey,
blockReference,
channelEncodedKey,
transactionExternalReference: options.externalRef,
serviceId: options.serviceId,
serviceDescription: options.serviceDescription,
remarks: options.remarks,
serviceCommision: options.commission
}
};
const response = await fetch(`${this.baseUrl}/api/bpm/cmd`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${this.accessToken}`,
'X-Tenant-ID': this.tenantId
},
body: JSON.stringify(request)
});
return await response.json();
}
Python Implementationโ
def seize_lock_amount(
self,
account_encoded_key: str,
block_reference: str,
channel_encoded_key: str,
transaction_external_reference: Optional[str] = None,
service_id: Optional[str] = None,
service_description: Optional[str] = None,
remarks: Optional[str] = None,
service_commision: Optional[float] = None
) -> SeizeLockResponse:
request_data = {
'commandName': 'SeizeDepositLockAmountCommand',
'data': {
'accountEncodedKey': account_encoded_key,
'blockReference': block_reference,
'channelEncodedKey': channel_encoded_key,
'transactionExternalReference': transaction_external_reference,
'serviceId': service_id,
'serviceDescription': service_description,
'remarks': remarks,
'serviceCommision': service_commision
}
}
response = requests.post(
f'{self.base_url}/api/bpm/cmd',
headers=self.headers,
json=request_data
)
result = response.json()
return SeizeLockResponse(
is_successful=result.get('isSuccessful', False),
message=result.get('message', ''),
status_code=result.get('statusCode', ''),
transaction_key=result.get('data', {}).get('transactionKey'),
amount=result.get('data', {}).get('amount')
)
Business Rulesโ
Validation Rulesโ
- Account Required: accountEncodedKey must be provided
- Block Reference Required: blockReference must match existing lock
- Channel Required: channelEncodedKey must be valid transaction channel
- Account Must Exist: Account must be in system
- Channel Must Exist: Channel must be valid and active
- Lock Must Exist: Lock with blockReference must exist
- Lock Must Be Active: Lock state must be LOCKED (not UNLOCKED or SEIZED)
- Transaction Hold State: Lock transaction must be in HOLD state
Operational Rulesโ
- Atomic Operation: Uses database transaction for consistency
- Permanent Debit: Funds cannot be recovered after seizure
- State Changes: Lock รขโ โ SEIZED, Transaction รขโ โ SETTLED
- Balance Impact: BlockedAmount decreased (balance was already reduced at lock time)
- Transaction Creation: New seizure transaction created with unique key
- Deposit Transaction: DEBIT entry created for accounting
- GL Integration: Links to product's savings control GL account
- Narration: Auto-generated with block reference
- Methodology: Uses account product's accounting methodology
- Rollback on Error: Transaction rolled back if any step fails
- Activity Logging: Can be tracked via transaction key
- Idempotent: Cannot seize same lock twice
- Service Tracking: Optional serviceId for categorization
- Commission Support: Optional service commission field
- External Reference: Supports external system correlation
Related Operationsโ
- LockDepositAmountCommand: Create initial amount lock
- DeleteDepositLockAmountCommand: Release lock instead of seizing
- GetLockDepositAmountQuery: Query locks before seizing
Troubleshootingโ
Issue: "Channel not valid"โ
Symptom: INVALID_REQUEST error with channel message
Solution:
- Verify channelEncodedKey exists in TransactionChannel table
- Ensure channel is active
- Use correct channel for service type (BRANCH, CARD, MERCHANT, etc.)
Issue: Lock Already Seizedโ
Symptom: "No existing amount lock" error
Solution:
- Lock may already be seized or deleted
- Use GetLockDepositAmountQuery to check current state
- Verify blockReference is correct
Supportโ
For technical assistance: api-support@banklingo.com