Slot availability
Appointment availability can change between searching and booking. When a slot is no longer available, ask the patient to select another time and request fresh availability. Sandbox and production can return different status codes for a slot conflict:
Handle both
400 and 404 as possible slot-unavailability responses when the message indicates a slot conflict.
Invalid requests
Several invalid requests return
400. If the response does not include a machine-readable error code, inspect the message to distinguish errors that require different corrective actions.
Order-state errors
Appointment-state errors
Authentication and feature availability
Testing error handling
- Use sandbox to test validation and incompatible-order scenarios.
- Do not rely on sandbox to reproduce every real-time slot conflict.
- In production, do not create speculative appointments solely to test failure handling.
- Always fetch fresh availability after a slot conflict.