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

# List a patient's pharmacies

> Pharmacies linked to the patient's chart in the EHR, with their e-prescribing capabilities. ModMed only; other EHRs answer 400 `capability_unsupported`.



## OpenAPI

````yaml /openapi-v4.json get /patients/{patientId}/pharmacies
openapi: 3.0.0
info:
  title: Max AI Public API
  description: API for third-party marketplace apps
  version: '4.0'
  contact: {}
servers:
  - url: https://api.maxcare.ai/v4
security: []
tags: []
paths:
  /patients/{patientId}/pharmacies:
    get:
      tags:
        - Pharmacies
      summary: List a patient's pharmacies
      description: >-
        Pharmacies linked to the patient's chart in the EHR, with their
        e-prescribing capabilities. ModMed only; other EHRs answer 400
        `capability_unsupported`.
      operationId: PharmaciesPublicController_listPatientPharmacies
      parameters:
        - name: patientId
          required: true
          in: path
          description: Patient ID (`pat_…`)
          schema:
            type: string
        - name: X-Organization-Id
          in: header
          required: true
          schema:
            type: string
          description: Target clinic organization ID
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListPatientPharmaciesSuccessResponse'
        '400':
          description: Missing or invalid request parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiBadRequestResponse'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiUnauthorizedResponse'
        '403':
          description: Insufficient scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiForbiddenResponse'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiNotFoundResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiRateLimitResponse'
        '502':
          description: EHR sync failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiBadGatewayResponse'
      security:
        - api-key: []
components:
  schemas:
    ListPatientPharmaciesSuccessResponse:
      type: object
      properties:
        code:
          type: string
          description: Response code
          example: success
        data:
          $ref: '#/components/schemas/ListPatientPharmaciesResponseData'
      required:
        - code
        - data
    PublicApiBadRequestResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: bad_request
        message:
          type: string
          description: Human-readable error message
          example: '''id'' must be a valid UUID'
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    PublicApiUnauthorizedResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: unauthorized
        message:
          type: string
          description: Human-readable error message
          example: Invalid or missing API key
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    PublicApiForbiddenResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: forbidden
        message:
          type: string
          description: Human-readable error message
          example: Insufficient scope
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    PublicApiNotFoundResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: not_found
        message:
          type: string
          description: Human-readable error message
          example: Resource not found
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    PublicApiRateLimitResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: rate_limit_exceeded
        message:
          type: string
          description: Human-readable error message
          example: Rate limit exceeded. Maximum 1000 requests per 60 seconds.
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    PublicApiBadGatewayResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: unexpected_integration_error
        message:
          type: string
          description: Human-readable error message
          example: EHR sync failed
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    ListPatientPharmaciesResponseData:
      type: object
      properties:
        pharmacies:
          type: array
          items:
            $ref: '#/components/schemas/ExternalPatientPharmacyResponse'
      required:
        - pharmacies
    ExternalPatientPharmacyResponse:
      type: object
      properties:
        ncpdpId:
          type: string
          example: '0000002'
        name:
          type: string
          example: Example Mail Order
        mailOrder:
          type: boolean
          example: true
        isDefault:
          type: boolean
          description: The patient's default pharmacy in the EHR
          example: true
        address:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/PharmacyAddressResponse'
        phone:
          type: string
          nullable: true
          example: '8005550100'
        fax:
          type: string
          nullable: true
          example: null
        epcsEnabled:
          type: boolean
          example: false
        newRxEnabled:
          type: boolean
          description: Accepts new prescriptions electronically (NewRx)
          example: true
        refillEnabled:
          type: boolean
          example: true
        maxSigLength:
          type: number
          nullable: true
          description: Longest sig this pharmacy accepts; null when the EHR reports none
          example: 140
      required:
        - ncpdpId
        - name
        - mailOrder
        - isDefault
        - address
        - phone
        - fax
        - epcsEnabled
        - newRxEnabled
        - refillEnabled
        - maxSigLength
    PharmacyAddressResponse:
      type: object
      properties:
        line1:
          type: string
          example: 100 Example St
        line2:
          type: string
          nullable: true
          example: null
        city:
          type: string
          example: Example
        state:
          type: string
          example: MI
        zip:
          type: string
          example: '48500'
      required:
        - line1
        - city
        - state
        - zip
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Marketplace API key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.