Staff Endpoints
List and read staff members (users with shop_staff role) with appointment-specific fields and product links.
Endpoints
List Staff
GET /wc-appointments/v1/staff
Get a collection of staff members.
Permissions: Authentication required. Intended for admin/store staff; not exposed publicly.
Parameters:
| Parameter | Type | Description |
|---|---|---|
exclude | array<int> | Staff IDs to exclude |
include | array<int> | Staff IDs to include |
order | string | Order direction (asc or desc) |
orderby | string | Order by field (ID, include, name, date) |
per_page | int | Results per page |
offset | int | Offset for pagination |
search | string | Search by name or email |
email | string | Filter by email address |
Response Fields:
id(int)display_name(string)full_name(string)email(string)availability(array): Array of availability rules (per availability schema)products(array): Each entry includes product details and staff-specific cost/qty
Product Entry Fields:
- Product ID, name, and details
- Staff-specific cost override
- Staff-specific quantity/capacity
Notes:
- Pagination headers are set (
X-WP-Total,X-WP-TotalPages) - Aligns with WooCommerce Customers controller permissions
- Staff must have
shop_staffrole
Get Single Staff
GET /wc-appointments/v1/staff/{id}
Get a single staff member by ID.
Permissions: Authentication required.
Response: Same fields as list endpoint, single object.
Example Request:
GET /wp-json/wc-appointments/v1/staff?per_page=10&orderby=name&order=asc
Example Response:
[
{
"id": 5,
"display_name": "Sarah Johnson",
"full_name": "Sarah Johnson",
"email": "sarah@example.com",
"availability": [
{
"id": 12,
"kind": "staff",
"kind_id": 5,
"range_type": "time:range",
"from_range": "09:00",
"to_range": "17:00",
"appointable": true
}
],
"products": [
{
"id": 123,
"name": "Haircut",
"cost": 50.00,
"qty": 1
}
]
}
]
Use Cases
- Staff Selection - Display available staff for appointment booking
- Staff Management - Admin interface for managing staff
- Product Assignment - View which products each staff member can provide
- Availability Overview - Check staff availability rules
Related Documentation
- Availabilities Endpoints - Managing staff availability rules
- Products Endpoints - Products assigned to staff
- Appointments Endpoints - Appointments assigned to staff