Skip to main content

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:

ParameterTypeDescription
excludearray<int>Staff IDs to exclude
includearray<int>Staff IDs to include
orderstringOrder direction (asc or desc)
orderbystringOrder by field (ID, include, name, date)
per_pageintResults per page
offsetintOffset for pagination
searchstringSearch by name or email
emailstringFilter 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_staff role

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

  1. Staff Selection - Display available staff for appointment booking
  2. Staff Management - Admin interface for managing staff
  3. Product Assignment - View which products each staff member can provide
  4. Availability Overview - Check staff availability rules