This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Sorts staff members using custom business logic for assigning resources to a booking.
Wix calls this method in real time when multiple staff members are available and Wix needs to assign a staff member:
Your implementation must return the resources in your preferred assignment order. Wix assigns the first resource to the booking and uses subsequent resources as fallbacks if the primary choice becomes unavailable before creating the booking.
Your response must contain the exact same resource IDs provided in the request, in your preferred order. Don't add, remove, or duplicate resources. If the response is invalid, Wix falls back to random staff assignment.
Your implementation must respond in under 5 seconds or Wix times out and falls back to random staff assignment. For optimal user experience, we recommend responding in under 500 milliseconds. You can use caching strategies and avoid synchronous external API calls during sorting.