Create Employee Referral
Overview​
Links a customer registration to an employee via their referral code. This creates a referral record that tracks which employee referred the customer, enabling performance reporting and incentive calculations.
Command Details​
- Command:
CreateEmployeeReferralCommand - Type: Command (write operation)
API Endpoint​
POST /api/bpm/cmd
Request Structure​
| Field | Type | Required | Description |
|---|---|---|---|
$type | string | Yes | Must be CreateEmployeeReferralCommand |
referralCode | string | Yes | The employee's referral code |
customerName | string | Yes | Name of the referred customer |
customerAccountNumber | string | No | Customer's account number (if already assigned) |
clientId | long | No | The client record ID (if the customer is already in the system) |
Try It Out​
POST
/api/bpm/cmdCreateEmployeeReferralCommandRequest Body
Response Structure​
Success:
{
"success": true,
"data": {
"referralId": 301,
"employeeId": 101,
"referralCode": "REF-EMP001234",
"customerName": "Jane Smith",
"customerAccountNumber": "0098765432",
"clientId": 2001,
"createdAt": "2026-03-09T10:30:00Z"
},
"message": "Referral created successfully"
}
Error:
{
"success": false,
"data": null,
"message": "Referral creation failed",
"errors": [
"Invalid referral code",
"No employee found with the specified referral code"
]
}
Related Operations​
- Retrieve Referrals — List referrals for an employee
- Retrieve Employee by ID — Get details of the referring employee
- Retrieve Employees — List all employees