Skip to main content

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​

FieldTypeRequiredDescription
$typestringYesMust be RetrieveEmployeeReferralsQuery
employeeIdlongNoFilter by a specific employee record ID
pageNumberintNoPage number (default: 1)
pageSizeintNoItems per page (default: 10)
startDatestringNoFilter referrals on or after this date (ISO 8601)
endDatestringNoFilter referrals on or before this date (ISO 8601)
filtersarrayNoDynamic 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 goalCorrect field valueExample
Filter by employee emailEmployee.EmployeeContact.Email{"field": "Employee.EmployeeContact.Email", "operator": "equals", "value": "john@example.com"}
Filter by employee staff IDEmployee.StaffId{"field": "Employee.StaffId", "operator": "equals", "value": "EMP-001"}
Filter by date rangeUse startDate / endDate paramsDo 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/cmdRetrieveEmployeeReferralsQuery
Request 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"
]
}