Send Referral Code
Overview​
Sends the employee's unique referral code to their registered email address. This allows employees to easily share their referral code with potential customers.
Command Details​
- Command:
SendEmployeeReferralCodeCommand - Type: Command (write operation)
API Endpoint​
POST /api/bpm/cmd
Request Structure​
| Field | Type | Required | Description |
|---|---|---|---|
id | long | Yes | The employee record ID |
Try It Out​
POST
/api/bpm/cmdSendEmployeeReferralCodeCommandRequest Body
Response Structure​
Success:
{
"success": true,
"data": {
"id": 101,
"staffId": "EMP-001234",
"referralCode": "A3X9K2",
"sentTo": "john.doe@company.com"
},
"message": "Referral code has been sent to john.doe@company.com."
}
Error — Employee not found:
{
"success": false,
"data": null,
"message": "Employee with ID 999 not found."
}
Error — No email:
{
"success": false,
"data": null,
"message": "Employee does not have an email address configured."
}
Related Operations​
- Create Employee — Create a new employee (referral code is auto-generated)
- Retrieve Employee by ID — Get employee details including referral code
- Create Referral — Record a customer referral using the code