> ## 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.

# Get a prescription

> One prescription, read live from the EHR. Its `erx` block moves `initiated` → `sent` → `pharmacy_verified`, or to `error`.



## OpenAPI

````yaml /openapi-v4.json get /prescriptions/{id}
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:
  /prescriptions/{id}:
    get:
      tags:
        - Prescriptions
      summary: Get a prescription
      description: >-
        One prescription, read live from the EHR. Its `erx` block moves
        `initiated` → `sent` → `pharmacy_verified`, or to `error`.
      operationId: PrescriptionsPublicController_getPrescription
      parameters:
        - name: id
          required: true
          in: path
          description: Prescription ID (`rxp_…`)
          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/GetPrescriptionSuccessResponse'
        '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:
    GetPrescriptionSuccessResponse:
      type: object
      properties:
        code:
          type: string
          description: Response code
          example: success
        data:
          $ref: '#/components/schemas/ExternalPrescriptionResponse'
      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
    ExternalPrescriptionResponse:
      type: object
      properties:
        id:
          type: string
          example: rxp_5f1c0000000040000000000000000001
        ehrPrescriptionId:
          type: string
          description: EHR-native rx id
          example: '40000001'
        patientId:
          type: string
          example: pat_8de0303900004000a000000000000001
        status:
          type: string
          enum:
            - pending
            - printed
            - erx
            - voided
            - canceled
            - unrecognized
          description: >-
            Closed vocabulary. `unrecognized` carries the EHR's raw text in
            `ehrStatusText`.
          example: erx
        ehrStatusText:
          type: string
          nullable: true
          example: ERX
        writtenOn:
          type: string
          nullable: true
          description: Facility-local date
          example: '2026-09-12'
        writtenBy:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/PrescriptionStaffResponse'
        createdBy:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/PrescriptionStaffResponse'
        facilityId:
          type: string
          nullable: true
          example: fac_b2c3d4e5f6a74b8c9d0e1f2a3b4c5d6e
        drug:
          $ref: '#/components/schemas/PrescriptionDrugResponse'
        sig:
          type: string
          nullable: true
          example: Inject 1 mL under the skin every 4 weeks
        quantity:
          type: string
          nullable: true
          description: Decimal string, never a float
          example: '1'
        quantityQualifier:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/PrescriptionQuantityQualifierResponse'
        refills:
          type: number
          nullable: true
          example: 11
        daysSupply:
          type: number
          nullable: true
          example: 28
        substitutionAllowed:
          type: boolean
          nullable: true
          example: true
        diagnosisCodes:
          example:
            - L40.0
          type: array
          items:
            type: string
        sourcePrescriptionId:
          type: string
          nullable: true
          description: >-
            The prescription this draft was copied from, when it was created
            through this API
          example: null
        erx:
          nullable: true
          description: Null while never released
          allOf:
            - $ref: '#/components/schemas/PrescriptionErxResponse'
      required:
        - id
        - ehrPrescriptionId
        - patientId
        - status
        - ehrStatusText
        - writtenOn
        - writtenBy
        - createdBy
        - facilityId
        - drug
        - sig
        - quantity
        - quantityQualifier
        - refills
        - daysSupply
        - substitutionAllowed
        - diagnosisCodes
        - sourcePrescriptionId
        - erx
    PrescriptionStaffResponse:
      type: object
      properties:
        providerId:
          type: string
          nullable: true
          description: >-
            Provider id, or null when the EHR staff member has no Max AI
            provider record
          example: prv_1a2b000000004000a000000000000001
        ehrStaffId:
          type: string
          description: EHR-native staff id
          example: '222'
        name:
          type: string
          nullable: true
          example: Jane Example, MD
      required:
        - providerId
        - ehrStaffId
        - name
    PrescriptionDrugResponse:
      type: object
      properties:
        dispensableId:
          type: string
          nullable: true
          description: FDB dispensable drug id
          example: '900001'
        description:
          type: string
          nullable: true
          example: Examplumab 150 mg/mL subcutaneous syringe
        drugName:
          type: string
          nullable: true
          example: Examplumab
        ndc:
          type: string
          nullable: true
          description: NDC-11
          example: '00000000001'
        controlledSubstance:
          type: boolean
          nullable: true
          description: >-
            Null when the EHR did not say. Writes treat null as unknown and
            check the drug schedule themselves.
          example: false
        deaSchedule:
          type: string
          nullable: true
          example: null
      required:
        - dispensableId
        - description
        - drugName
        - ndc
        - controlledSubstance
        - deaSchedule
    PrescriptionQuantityQualifierResponse:
      type: object
      properties:
        code:
          type: string
          nullable: true
          example: ML
        name:
          type: string
          nullable: true
          example: Milliliter
      required:
        - code
        - name
    PrescriptionErxResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - initiated
            - sent
            - pharmacy_verified
            - error
            - unrecognized
          example: pharmacy_verified
        ehrStatusText:
          type: string
          nullable: true
          description: The EHR's raw status text
          example: Pharmacy received and verified
        errorMessage:
          type: string
          nullable: true
          description: Plain text; set only when status is `error`
          example: null
        releasedAt:
          type: string
          nullable: true
          example: '2026-09-12T15:04:05.000Z'
        releasedBy:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/PrescriptionStaffResponse'
        pharmacy:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/PrescriptionPharmacyRefResponse'
        messageId:
          type: string
          nullable: true
          description: Surescripts NewRx message id
          example: EMA00000000000000000000000000000000
        remainingRefills:
          type: number
          nullable: true
          example: 11
      required:
        - status
        - ehrStatusText
        - errorMessage
        - releasedAt
        - releasedBy
        - pharmacy
        - messageId
        - remainingRefills
    PrescriptionPharmacyRefResponse:
      type: object
      properties:
        ncpdpId:
          type: string
          nullable: true
          example: '0000001'
        name:
          type: string
          nullable: true
          example: Example Clinic Pharmacy
      required:
        - ncpdpId
        - name
  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.