Skip to main content

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​

FieldTypeRequiredDescription
$typestringYesMust be CreateEmployeeReferralCommand
referralCodestringYesThe employee's referral code
customerNamestringYesName of the referred customer
customerAccountNumberstringNoCustomer's account number (if already assigned)
clientIdlongNoThe client record ID (if the customer is already in the system)

Try It Out​

POST/api/bpm/cmdCreateEmployeeReferralCommand
Request 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"
]
}