Skip to main content

Create Employee

Overview​

Creates a new employee record in the system. On creation, a unique referralCode is automatically generated for the employee. This referral code can be shared with potential customers and used to track referrals back to the originating staff member.

Command Details​

  • Command: CreateEmployeeCommand
  • Type: Command (write operation)

API Endpoint​

POST /api/bpm/cmd

Request Structure​

FieldTypeRequiredDescription
$typestringYesMust be CreateEmployeeCommand
staffIdstringYesUnique staff identifier
emailstringYesEmployee email address
titlestringNoTitle (e.g., Mr, Mrs, Dr)
firstNamestringYesEmployee first name
lastNamestringYesEmployee last name
middleNamestringNoEmployee middle name
dateOfBirthstringNoDate of birth (ISO 8601)
branchstringNoBranch name or code
rolestringNoEmployee role or position
isAccountOfficerboolNoWhether the employee is an account officer (default: false)
canReferCustomerboolNoWhether the employee can refer customers (default: true)
isEnabledboolNoWhether the employee is enabled/active for operations (default: true)
notestringNoAdditional notes
contactDetailsobjectNoContact information object
contactDetails.mobilestringNoMobile phone number
contactDetails.addressLine1stringNoAddress line 1
contactDetails.addressLine2stringNoAddress line 2
contactDetails.citystringNoCity
contactDetails.statestringNoState or province
contactDetails.zipCodestringNoZIP or postal code
contactDetails.countrystringNoCountry

Try It Out​

POST/api/bpm/cmdCreateEmployeeCommand
Request Body

Response Structure​

Success:

{
"success": true,
"data": {
"id": 101,
"staffId": "EMP-001234",
"email": "john.doe@company.com",
"firstName": "John",
"lastName": "Doe",
"referralCode": "REF-EMP001234",
"branch": "Lagos Main Branch",
"branchName": "Lagos Main Branch",
"role": "Relationship Manager",
"roleName": "Relationship Manager",
"isAccountOfficer": false,
"canReferCustomer": true,
"isEnabled": true,
"createdAt": "2026-03-09T10:30:00Z"
},
"message": "Employee created successfully"
}

Error:

{
"success": false,
"data": null,
"message": "Validation failed",
"errors": [
"StaffId is required",
"Email is required"
]
}