Skip to main content
Interested in this feature? Get in touch with your Customer Success Manager.
These options help integrations manage provider latency and safely retry appointment requests. Availability depends on your Team configuration.

Cached availability

Junction maintains an availability cache containing the next 21 days of availability for supported locations. Each location is refreshed every five minutes on average. Set allow_stale on the PSC Appointment Availability request to use the cache when:
  1. Every requested location has a cache entry.
  2. Each entry is less than 15 minutes old.
If the cache cannot fulfill the request, Junction requests availability from the PSC appointment provider. Use cached availability when you need a faster initial response and can tolerate the possibility that a displayed slot has recently changed. Always handle slot conflicts when the patient books.

Idempotent booking

Provide an X-Idempotency-Key header when calling Book PSC Appointment. Requests with the same key within the 14-day retention window return the response saved for the original request. Use an idempotency key when retrying after a connection error or timeout. The original request may have reached Junction even when your system did not receive its response.
The saved response does not change when the appointment changes later. If the original response contains a pending appointment that later becomes confirmed, a retry with the same key still returns the original pending response. Retrieve the appointment or process its webhooks to obtain the current state.

Asynchronous confirmation

By default, booking returns an error when the PSC appointment provider does not acknowledge the request within the synchronous request window. With asynchronous confirmation enabled, Junction waits for sync_confirmation_timeout_millisecond and then:
  • Returns a reserved or confirmed appointment if the provider responds in time.
  • Creates and returns a pending appointment if the provider has not responded.
For a pending appointment, Junction retries in the background until async_confirmation_timeout_millisecond elapses. The appointment then transitions to confirmed or cancelled, depending on the provider response. Subscribe to labtest.appointment.updated to receive these transitions. Do not present a pending appointment to the patient as confirmed. The supported configuration ranges are: