Skip to main content

CreateAddressInformationCommand

Overview

The CreateAddressInformationCommand allows you to create new address records for self-service users in the loan origination system. This command enables manual entry of customer address information required for loan applications.

Handler File: CB.Administration.Api/Commands/BPM/SelfService/SelfServiceserDetailCommandHandlers.cs

Use Cases

  • Recording customer residential address during loan application
  • Manual address entry for customers completing applications offline
  • Updating address information for existing customers
  • Supporting customers without automated address verification

Request Parameters

Required Parameters

ParameterTypeDescription
userIdlongThe ID of the self-service user
addressLine1stringPrimary address line (street, building)
citystringCity name
statestringState or province
countrystringCountry name

Optional Parameters

ParameterTypeDescription
addressLine2stringSecondary address line (apartment, suite)
postalCodestringPostal or ZIP code

Request Example

{
"commandName": "CreateAddressInformationCommand",
"data": {
"userId": 123,
"addressLine1": "123 Main Street",
"addressLine2": "Apt 4B",
"city": "Lagos",
"state": "Lagos State",
"country": "Nigeria",
"postalCode": "100001"
}
}

Response Format

Success Response

{
"isSuccessful": true,
"statusCode": "00",
"message": "Address information created successfully.",
"data": {
"addressId": 789,
"userId": 123,
"addressLine1": "123 Main Street",
"addressLine2": "Apt 4B",
"city": "Lagos",
"state": "Lagos State",
"country": "Nigeria",
"postalCode": "100001",
"verificationStatus": 0,
"verificationStatusDesc": "PENDING",
"createdAt": "2026-01-11T10:35:00Z"
}
}

Error Response

User Not Found

{
"isSuccessful": false,
"statusCode": "04",
"message": "User not found."
}

Validation Rules

  1. User Existence: The userId must reference an existing self-service user
  2. Required Fields: All required parameters must be provided
  3. Data Integrity: Address components should be valid (non-empty strings)

Verification Status

When an address is created, it automatically receives a verification status of PENDING (0). The address must then go through the approval workflow:

  1. Created: Address is created with status = PENDING
  2. Admin Review: Admin uses ApproveCustomerAddressInformationCommand or RejectCustomerAddressInformationCommand
  3. Approved/Rejected: Status changes to APPROVED or REJECTED
  • ApproveCustomerAddressInformationCommand - Approve a pending address
  • RejectCustomerAddressInformationCommand - Reject a pending address
  • GetCustomerAddressDetailsQuery - Retrieve address information for a user

Integration Example

cURL Request

curl -X POST https://api.banklingo.com/execute \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"commandName": "CreateAddressInformationCommand",
"data": {
"userId": 123,
"addressLine1": "123 Main Street",
"addressLine2": "Apt 4B",
"city": "Lagos",
"state": "Lagos State",
"country": "Nigeria",
"postalCode": "100001"
}
}'

JavaScript Example

const response = await fetch('https://api.banklingo.com/execute', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
},
body: JSON.stringify({
commandName: 'CreateAddressInformationCommand',
data: {
userId: 123,
addressLine1: '123 Main Street',
addressLine2: 'Apt 4B',
city: 'Lagos',
state: 'Lagos State',
country: 'Nigeria',
postalCode: '100001'
}
})
});

const result = await response.json();
console.log('Address created:', result.data.addressId);

C# Example

var command = new
{
CommandName = "CreateAddressInformationCommand",
Data = new
{
UserId = 123,
AddressLine1 = "123 Main Street",
AddressLine2 = "Apt 4B",
City = "Lagos",
State = "Lagos State",
Country = "Nigeria",
PostalCode = "100001"
}
};

var result = await _mediator.Send(command);

Best Practices

  1. Address Validation: Validate address components against known formats or postal databases
  2. Geocoding: Consider integrating geocoding services to validate addresses
  3. Standardization: Use consistent address format conventions
  4. Multiple Addresses: A user can have multiple addresses (home, work, mailing)
  5. Privacy: Treat address information as sensitive personal data

Technical Notes

  • Entity: SelfServiceAddressInformation
  • Database Table: BPMLoanSelfService.SelfServiceAddressInformation
  • LoanQuoteId: This field is commented out in the entity - addresses are user-level, not loan-specific
  • User-Level Record: Unlike guarantors, addresses belong to the user, not specific loan applications

Address Verification Flow

See Also