Retrieve Employee Referrals
Overview​
Retrieves a paginated list of referrals for a specific employee. Each referral represents a customer registration that was linked to the employee via their referral code. Supports date range filtering for performance tracking over specific periods.
Command Details​
- Command:
RetrieveEmployeeReferralsQuery - Type: Query (read operation)
API Endpoint​
POST /api/bpm/cmd
Request Structure​
| Field | Type | Required | Description |
|---|---|---|---|
$type | string | Yes | Must be RetrieveEmployeeReferralsQuery |
employeeId | long | No | Filter by a specific employee record ID |
pageNumber | int | No | Page number (default: 1) |
pageSize | int | No | Items per page (default: 10) |
startDate | string | No | Filter referrals on or after this date (ISO 8601) |
endDate | string | No | Filter referrals on or before this date (ISO 8601) |
filters | array | No | Dynamic predicate filters (see below) |
Dynamic Filter Fields​
The filters array supports dot-notation property paths on the EmployeeReferral entity. Use the exact field paths below — incorrect paths will be silently ignored.
| Filter goal | Correct field value | Example |
|---|---|---|
| Filter by employee email | Employee.EmployeeContact.Email | {"field": "Employee.EmployeeContact.Email", "operator": "equals", "value": "john@example.com"} |
| Filter by employee staff ID | Employee.StaffId | {"field": "Employee.StaffId", "operator": "equals", "value": "EMP-001"} |
| Filter by date range | Use startDate / endDate params | Do not use DateReferred in filters — use the top-level startDate/endDate fields instead |
warning
Do not use EmployeeEmail or EmployeeStaffId as filter field names — those are output-only fields in the response, not query-able entity properties. Always use the full navigation property path (Employee.EmployeeContact.Email, Employee.StaffId).
Try It Out​
POST
/api/bpm/cmdRetrieveEmployeeReferralsQueryRequest Body
Response Structure​
Success:
{
"success": true,
"data": {
"items": [
{
"referralId": 301,
"employeeId": 101,
"referralCode": "REF-EMP001234",
"customerName": "Jane Smith",
"customerAccountNumber": "0098765432",
"createdAt": "2026-02-20T09:15:00Z"
}
],
"pageNumber": 1,
"pageSize": 10,
"totalCount": 1,
"totalPages": 1
},
"message": "Referrals retrieved successfully"
}
Error:
{
"success": false,
"data": null,
"message": "Failed to retrieve referrals",
"errors": [
"Employee not found"
]
}
Related Operations​
- Create Referral — Link a customer to an employee referral
- Retrieve Employee by ID — Get details of the referring employee