> ## Documentation Index
> Fetch the complete documentation index at: https://docs.junction.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PSC Appointment Availability

> Create or submit order psc appointment availability via the Junction API. Requires authentication with your team API key.

<Tip>
  Use the `allow_stale` parameter for faster responses via the Availability Cache. This feature is currently in closed beta. See [PSC Appointment Scheduling](/lab/walk-in/psc-appointment-scheduling#availability-cache) for more info.
</Tip>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
       --url '{{BASE_URL}}/v3/order/psc/appointment/availability' \
       --header 'accept: application/json' \
       --header 'x-vital-api-key: {YOUR_KEY}' \
       --data '
  {
      "lab": "quest",
      "zip_code": "85004",
      "radius": "25"
  }
  '
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
      "slots": [
          {
              "location": {
                  "location": {
                      "lng": -112.0568538,
                      "lat": 33.4631386
                  },
                  "address": {
                      "first_line": "1300 N 12th St",
                      "second_line": "Ste 300",
                      "city": "Phoenix",
                      "state": "AZ",
                      "zip_code": "85006",
                  },
                  "code": "23070",
                  "name": "QUEST",
                  "iana_timezone": "America/Los_Angeles"
              },
              "date":"2023-05-09",
              "slots": [
                  {
                      "booking_key": "foo123",
                      "start": "2023-05-09T17:00:00+00:00",
                      "end": "2023-05-09T19:00:00+00:00",
                      "expires_at": "2023-05-09T12:39:57.827000+00:00",
                      "price": 0.0,
                      "is_priority": true,
                      "num_appointments_available": 1
                  },
                  ...
              ],
          },
          {
              "location": {
                  "location": {
                      "lng": -112.0568538,
                      "lat": 33.4631386
                  },
                  "address": {
                      "first_line": "1300 N 12th St",
                      "second_line": "Ste 300",
                      "city": "Phoenix",
                      "state": "AZ",
                      "zip_code": "85006",
                  },
                  "code": "23070",
                  "name": "QUEST"
              },
              "date":"2023-05-10",
              "slots": [
                  {
                      "booking_key": "bar456",
                      "start": "2023-05-10T12:00:00+00:00",
                      "end": "2023-05-10T14:00:00+00:00",
                      "expires_at": "2023-05-09T12:39:57.852000+00:00",
                      "price": 0.0,
                      "is_priority": true,
                      "num_appointments_available": 1
                  },
                  ...
              ],
          },
      ],
      "timezone": null
  }
  ```
</ResponseExample>


## OpenAPI

````yaml POST /v3/order/psc/appointment/availability
openapi: 3.1.0
info:
  title: Junction API
  description: https://docs.junction.com/
  version: 0.4.483
servers:
  - url: https://api.us.junction.com
    x-fern-server-name: Production
  - url: https://api.eu.junction.com
    x-fern-server-name: ProductionEU
  - url: https://api.sandbox.us.junction.com
    x-fern-server-name: Sandbox
  - url: https://api.sandbox.eu.junction.com
    x-fern-server-name: SandboxEU
security:
  - apiKeyAuth: []
paths:
  /v3/order/psc/appointment/availability:
    post:
      tags:
        - order
      summary: Get Psc Appointment Availability
      operationId: >-
        get_psc_appointment_availability_v3_order_psc_appointment_availability_post
      parameters:
        - name: lab
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/AppointmentPSCLabs'
            description: Lab to check for availability
          description: Lab to check for availability
        - name: start_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
            description: Start date for appointment availability
            title: Start Date
          description: Start date for appointment availability
        - name: site_codes
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: List of site codes to fetch availability for
            title: Site Codes
          description: List of site codes to fetch availability for
        - name: zip_code
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                pattern: ^\d{5}$
              - type: 'null'
            description: Zip code of the area to check
            title: Zip Code
          description: Zip code of the area to check
        - name: radius
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/AllowedRadius'
              - type: 'null'
            description: Radius in which to search in miles
            default: '25'
            title: Radius
          description: Radius in which to search in miles
        - name: allow_stale
          in: query
          required: false
          schema:
            type: boolean
            description: If true, allows cached availability data to be returned.
            default: false
            title: Allow Stale
          description: If true, allows cached availability data to be returned.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppointmentAvailabilitySlots'
        '404':
          description: >-
            No slots found. Not all PSCs support scheduling appointments and
            some included in your query were filtered out because of this.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: >-
                      No slots found. Not all PSCs support scheduling
                      appointments and some included in your query were filtered
                      out because of this. Please try again with different site
                      codes or a different zip code, or see the PSC info
                      endpoints to see which locations support scheduling.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AppointmentPSCLabs:
      type: string
      enum:
        - quest
        - sonora_quest
      title: AppointmentPSCLabs
      description: ℹ️ This enum is non-exhaustive.
    AllowedRadius:
      type: string
      enum:
        - '10'
        - '20'
        - '25'
        - '50'
        - '100'
      title: AllowedRadius
      description: ℹ️ This enum is non-exhaustive.
    AppointmentAvailabilitySlots:
      properties:
        slots:
          items:
            $ref: '#/components/schemas/DaySlots'
          type: array
          title: Slots
        timezone:
          anyOf:
            - type: string
              pattern: >-
                ^(?:(?:[A-Za-z_\-]+\/[A-Za-z_\-]+(?:\/[A-Za-z_\-]+)?)|(?:Etc\/[A-Za-z0-9+\-]+(?:\/[A-Za-z0-9]+)?|(?:CET|CST6CDT|EET|EST|EST5EDT|MET|MST|MST7MDT|PST8PDT|HST)))$
            - type: 'null'
          title: Timezone
      type: object
      required:
        - slots
      title: AppointmentAvailabilitySlots
    HTTPValidationError:
      properties:
        detail:
          title: Detail
      type: object
      title: HTTPValidationError
    DaySlots:
      properties:
        location:
          anyOf:
            - $ref: '#/components/schemas/AppointmentLocation'
            - type: 'null'
        date:
          type: string
          format: date
          title: Date
        slots:
          items:
            $ref: '#/components/schemas/TimeSlot'
          type: array
          title: Slots
      type: object
      required:
        - date
        - slots
      title: DaySlots
    AppointmentLocation:
      properties:
        location:
          $ref: '#/components/schemas/LngLat'
        distance:
          anyOf:
            - type: integer
            - type: 'null'
          title: Distance
        address:
          $ref: '#/components/schemas/USAddress'
        code:
          type: string
          title: Code
        name:
          type: string
          title: Name
        iana_timezone:
          anyOf:
            - type: string
              pattern: >-
                ^(?:(?:[A-Za-z_\-]+\/[A-Za-z_\-]+(?:\/[A-Za-z_\-]+)?)|(?:Etc\/[A-Za-z0-9+\-]+(?:\/[A-Za-z0-9]+)?|(?:CET|CST6CDT|EET|EST|EST5EDT|MET|MST|MST7MDT|PST8PDT|HST)))$
            - type: 'null'
          title: Iana Timezone
      type: object
      required:
        - location
        - address
        - code
        - name
      title: AppointmentLocation
    TimeSlot:
      properties:
        booking_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Booking Key
        start:
          type: string
          format: date-time
          title: Start
          description: Time is in UTC
        end:
          type: string
          format: date-time
          title: End
          description: Time is in UTC
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
        price:
          type: number
          title: Price
        is_priority:
          type: boolean
          title: Is Priority
        num_appointments_available:
          type: integer
          title: Num Appointments Available
      type: object
      required:
        - start
        - end
        - price
        - is_priority
        - num_appointments_available
      title: TimeSlot
    LngLat:
      properties:
        lng:
          type: number
          maximum: 180
          minimum: -180
          title: Lng
        lat:
          type: number
          maximum: 90
          minimum: -90
          title: Lat
      type: object
      required:
        - lng
        - lat
      title: LngLat
    USAddress:
      properties:
        first_line:
          type: string
          title: First Line
        second_line:
          anyOf:
            - type: string
            - type: 'null'
          title: Second Line
        city:
          type: string
          title: City
        state:
          type: string
          title: State
        zip_code:
          type: string
          pattern: ^\d{5}(-\d{4})?$
          title: Zip Code
        unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Unit
          description: >-
            Deprecated. Use `second_line` instead to provide the unit number.
            Subject to removal after 20 Nov 2023.
          deprecated: true
        access_notes:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Access Notes
      type: object
      required:
        - first_line
        - city
        - state
        - zip_code
      title: USAddress
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-vital-api-key
      description: Vital Team API Key

````