Skip to main content

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

ParameterTypeRequiredDescription
userIdlongYesThe 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

FieldTypeDescription
idlongAddress record ID
userIdlongCustomer ID
addressLine1stringPrimary address line (required)
addressLine2stringSecondary address line (optional)
citystringCity name
statestringState/Province
countrystringCountry name
postalCodestringPostal/ZIP code (optional)
verificationStatusstringPENDING, APPROVED, REJECTED
verifiedBystringName of verifier (if approved/rejected)
verifiedAtDateTimeVerification timestamp
commentsstringVerification notes
createdAtDateTimeWhen address was added

Verification Status Values

StatusDescriptionActions Available
PENDINGAwaiting verificationApprove or Reject
APPROVEDAddress verified and approvedView only
REJECTEDAddress verification failedUpdate 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

  1. Loan Application Review: Verify customer's residential address during loan processing
  2. KYC Verification: Confirm address matches government-issued ID
  3. Contact Verification: Ensure address is accurate for correspondence
  4. Risk Assessment: Assess location-based risk factors
  5. Collateral Location: Verify address for collateral inspection

Error Scenarios

ErrorStatus CodeCauseSolution
User not found04Invalid userId or no accessVerify user exists and you have permission
Unauthorized04Organization mismatchCan only access users in your organization
No addresses00 (success)User has no address recordsReturns empty array

Best Practices

  1. Check Verification Status: Ensure address is APPROVED before loan disbursement
  2. Validate Format: Check all required fields are present
  3. Cross-Reference: Compare address with identity document address
  4. Update When Needed: If address is outdated, use CreateAddressInformationCommand to add new one
  5. 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)
  • 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

See Also