GetCustomerAddressDetailsQuery
Overview
Retrieves address information for a customer. This includes residential address, verification status, and approval history. Used to verify customer location details during loan processing.
Command Structure
{
"cmd": "GetCustomerAddressDetailsQuery",
"data": "{\"userId\":\"129\"}"
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
userId | long | Yes | The ID of the customer |
Response Structure
Success Response
{
"ok": true,
"statusCode": "00",
"message": "Address details retrieved successfully",
"outData": {
"addresses": [
{
"id": 45,
"userId": 129,
"addressLine1": "15 Adeola Odeku Street",
"addressLine2": "Victoria Island",
"city": "Lagos",
"state": "Lagos State",
"country": "Nigeria",
"postalCode": "101241",
"verificationStatus": "APPROVED",
"verifiedBy": "John Doe",
"verifiedAt": "2024-01-10T14:30:00Z",
"comments": "Address verified via utility bill",
"createdAt": "2024-01-05T09:00:00Z"
}
],
"totalCount": 1
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
id | long | Address record ID |
userId | long | Customer ID |
addressLine1 | string | Primary address line (required) |
addressLine2 | string | Secondary address line (optional) |
city | string | City name |
state | string | State/Province |
country | string | Country name |
postalCode | string | Postal/ZIP code (optional) |
verificationStatus | string | PENDING, APPROVED, REJECTED |
verifiedBy | string | Name of verifier (if approved/rejected) |
verifiedAt | DateTime | Verification timestamp |
comments | string | Verification notes |
createdAt | DateTime | When address was added |
Verification Status Values
| Status | Description | Actions Available |
|---|---|---|
PENDING | Awaiting verification | Approve or Reject |
APPROVED | Address verified and approved | View only |
REJECTED | Address verification failed | Update and resubmit |
Authorization
Admin Access
- User Classification:
BACKOFFICE_ADMINISTRATORS - Access Level: Can query any user's address
Organization Access
- User Classification: Organization users
- Access Level: Can only query their own organization's users
Integration Examples
cURL
curl -X POST https://api.yourbank.com/commands \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"cmd": "GetCustomerAddressDetailsQuery",
"data": "{\"userId\":\"129\"}"
}'
JavaScript (Fetch API)
const response = await fetch('https://api.yourbank.com/commands', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
},
body: JSON.stringify({
cmd: 'GetCustomerAddressDetailsQuery',
data: JSON.stringify({ userId: '129' })
})
});
const result = await response.json();
console.log('Addresses:', result.outData.addresses);
C# (MediatR)
var command = new GetCustomerAddressDetailsQuery
{
Data = JsonConvert.SerializeObject(new { userId = "129" })
};
var response = await _mediator.Send(command);
if (response.Ok)
{
var addresses = response.OutData.addresses;
// Process address information
}
Use Cases
- Loan Application Review: Verify customer's residential address during loan processing
- KYC Verification: Confirm address matches government-issued ID
- Contact Verification: Ensure address is accurate for correspondence
- Risk Assessment: Assess location-based risk factors
- Collateral Location: Verify address for collateral inspection
Error Scenarios
| Error | Status Code | Cause | Solution |
|---|---|---|---|
| User not found | 04 | Invalid userId or no access | Verify user exists and you have permission |
| Unauthorized | 04 | Organization mismatch | Can only access users in your organization |
| No addresses | 00 (success) | User has no address records | Returns empty array |
Best Practices
- Check Verification Status: Ensure address is APPROVED before loan disbursement
- Validate Format: Check all required fields are present
- Cross-Reference: Compare address with identity document address
- Update When Needed: If address is outdated, use CreateAddressInformationCommand to add new one
- Document Verification: Keep record of verification method (utility bill, letter, etc.)
Technical Notes
- Entity:
SelfServiceAddressInformation(table:[BPMSelfService].[SelfServiceAddressInformation]) - Returns: Array of addresses (customer can have multiple historical addresses)
- Most Recent First: Addresses are ordered by
createdAt DESC - Soft Delete: Deleted addresses are filtered out
- Verification Workflow: PENDING → Approve/Reject (handled by ApproveCustomerAddressInformationCommand/RejectCustomerAddressInformationCommand)
Related Commands
- CreateAddressInformationCommand - Add a new address for the customer
- ApproveCustomerAddressInformationCommand - Approve address verification
- RejectCustomerAddressInformationCommand - Reject address verification
- GetCustomerBasicDetailsQuery - Get complete customer profile including address
- GetCustomerKycInformationQuery - Get KYC status including address verification