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​
| Field | Type | Required | Description |
|---|---|---|---|
$type | string | Yes | Must be CreateEmployeeCommand |
staffId | string | Yes | Unique staff identifier |
email | string | Yes | Employee email address |
title | string | No | Title (e.g., Mr, Mrs, Dr) |
firstName | string | Yes | Employee first name |
lastName | string | Yes | Employee last name |
middleName | string | No | Employee middle name |
dateOfBirth | string | No | Date of birth (ISO 8601) |
branch | string | No | Branch name or code |
role | string | No | Employee role or position |
isAccountOfficer | bool | No | Whether the employee is an account officer (default: false) |
canReferCustomer | bool | No | Whether the employee can refer customers (default: true) |
isEnabled | bool | No | Whether the employee is enabled/active for operations (default: true) |
note | string | No | Additional notes |
contactDetails | object | No | Contact information object |
contactDetails.mobile | string | No | Mobile phone number |
contactDetails.addressLine1 | string | No | Address line 1 |
contactDetails.addressLine2 | string | No | Address line 2 |
contactDetails.city | string | No | City |
contactDetails.state | string | No | State or province |
contactDetails.zipCode | string | No | ZIP or postal code |
contactDetails.country | string | No | Country |
Try It Out​
POST
/api/bpm/cmdCreateEmployeeCommandRequest 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"
]
}
Related Operations​
- Update Employee — Modify this employee record
- Retrieve Employees — List all employees
- Upload Employees — Bulk import from Excel