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

# Read custom drugs

> Retrieves the custom drug list (organization-level and user-level) for a user from Parchment

## Response Examples

### Success Response (200 OK)

```json theme={null}
{
  "success": true,
  "statusCode": 200,
  "message": "Retrieved 2 custom drugs successfully",
  "code": "SUCCESS",
  "data": [
    {
      "custom_drug_id": "fc37ba32-8837-4c4b-9e5d-ef2d4f15c9ea",
      "item_generic_name": "Semaglutide 1.34 mg/mL injection, 1 x 1.5 mL pen device",
      "item_trade_name": "Wegovy 0.5 mg Multidose Flextouch 1.34 mg/mL injection, 1.5 mL pen device",
      "brand_name": "Wegovy Flextouch",
      "item_strength": "1.34 mg/mL",
      "item_form": "Solution for injection",
      "route_of_administration": "Subcutaneous",
      "quantity": "1",
      "max_repeats": "5",
      "poison_class": "S4"
    },
    {
      "custom_drug_id": "1b9358d7-6576-46dd-9770-3047fb1916c0",
      "item_generic_name": "Custom Drug with product ID",
      "item_strength": "100mg",
      "item_form": "Capsule",
      "route_of_administration": "Oral",
      "quantity": "40",
      "max_repeats": "1",
      "poison_class": "S2",
      "custom_product_id": "12345",
      "patient_instructions": "Take one capsule twice daily",
      "doctor_instructions": "Review after course"
    }
  ],
  "timestamp": "2024-01-25T09:15:00.000Z",
  "requestId": "req_1706171700000_abc123"
}
```

### No Custom Drugs (200 OK)

```json theme={null}
{
  "success": true,
  "statusCode": 200,
  "message": "Retrieved 0 custom drugs successfully",
  "code": "SUCCESS",
  "data": [],
  "timestamp": "2024-01-25T09:15:00.000Z",
  "requestId": "req_1706171700000_def456"
}
```

### Invalid Parameters (400 Bad Request)

```json theme={null}
{
  "success": false,
  "statusCode": 400,
  "error": {
    "type": "https://parchment.health/errors/bad-request",
    "title": "Bad Request",
    "detail": "Organization ID is required"
  },
  "timestamp": "2024-01-25T09:15:00.000Z",
  "requestId": "req_1706171700000_ghi789"
}
```

### Unauthorized (401)

```json theme={null}
{
  "success": false,
  "statusCode": 401,
  "error": {
    "type": "https://parchment.health/errors/authentication-required",
    "title": "Unauthorized",
    "detail": "Insufficient scope"
  },
  "timestamp": "2024-01-25T09:15:00.000Z",
  "requestId": "req_1706171700000_jkl012"
}
```

## Response Fields

### Success Response Data

The response returns an array of custom drug objects. Optional fields are omitted when not set on the drug.

| Field                     | Type   | Description                                                        |
| ------------------------- | ------ | ------------------------------------------------------------------ |
| `custom_drug_id`          | string | Unique identifier for the custom drug (use this to prefill a form) |
| `item_generic_name`       | string | Generic name of the drug                                           |
| `item_trade_name`         | string | Trade name of the drug (optional)                                  |
| `brand_name`              | string | Brand name (optional)                                              |
| `item_strength`           | string | Strength, e.g. `500mg`                                             |
| `item_form`               | string | Dosage form, e.g. `Capsule`                                        |
| `route_of_administration` | string | Route, e.g. `Oral`                                                 |
| `quantity`                | string | Default quantity                                                   |
| `max_repeats`             | string | Maximum repeats                                                    |
| `poison_class`            | string | Poison schedule, e.g. `S4`                                         |
| `custom_product_id`       | string | Partner-supplied product identifier (optional)                     |
| `description`             | string | Free-text description (optional)                                   |
| `patient_instructions`    | string | Default patient instructions (optional)                            |
| `doctor_instructions`     | string | Default doctor instructions (optional)                             |

### Common Response Fields

All responses include these standard fields:

| Field        | Type    | Description                             |
| ------------ | ------- | --------------------------------------- |
| `success`    | boolean | Indicates if the request was successful |
| `statusCode` | number  | HTTP status code                        |
| `message`    | string  | Human-readable status message           |
| `code`       | string  | Operation code (`SUCCESS` on 200)       |
| `timestamp`  | string  | ISO 8601 timestamp of the response      |
| `requestId`  | string  | Unique identifier for debugging         |

## Path Parameters

| Parameter         | Type   | Required | Description             |
| ----------------- | ------ | -------- | ----------------------- |
| `organization_id` | string | Yes      | Organization identifier |
| `user_id`         | string | Yes      | User identifier         |

## Status Codes

| Code  | Status                | Description                                                |
| ----- | --------------------- | ---------------------------------------------------------- |
| `200` | OK                    | Custom drugs retrieved successfully (including empty list) |
| `400` | Bad Request           | Invalid request format or missing parameters               |
| `401` | Unauthorized          | Authentication required, token invalid, or scope invalid   |
| `500` | Internal Server Error | Unexpected server error                                    |

## Integration Notes

1. **Scope Requirement**: Your API token must include the `read:custom_drug` scope.
2. **Combined List**: Returns both organization-level and user-level custom drugs for the user.
3. **Prefill**: Use `custom_drug_id` to prefill the prescription form via query parameters.
4. **Optional Fields**: Fields that are not set on a drug are omitted from the response.
5. **Store Request ID**: Always log the `requestId` for debugging support requests.


## OpenAPI

````yaml GET /v1/organizations/{organization_id}/users/{user_id}/custom-drugs
openapi: 3.0.1
info:
  title: Parchment APIs
  description: >-
    Parchments API documentation for partner integrations, enabling secure
    e-prescription services
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.sandbox.parchmenthealth.io/external
  - url: https://api.parchmenthealth.io/external
security:
  - bearerAuth: []
paths:
  /v1/organizations/{organization_id}/users/{user_id}/custom-drugs:
    get:
      description: >-
        Retrieves the custom drug list (organization-level and user-level) for a
        user from Parchment
      parameters:
        - name: x-organization-secret
          in: header
          required: true
          description: Organization secret for authentication - provided by Parchment
          schema:
            type: string
        - name: organization_id
          in: path
          required: true
          description: Organization ID
          schema:
            type: string
            format: uuid
        - name: user_id
          in: path
          required: true
          description: User ID
          schema:
            type: string
      responses:
        '200':
          description: Custom drugs retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  statusCode:
                    type: integer
                  message:
                    type: string
                  code:
                    type: string
                    example: SUCCESS
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ExternalCustomDrug'
                  timestamp:
                    type: string
                  requestId:
                    type: string
              example:
                success: true
                statusCode: 200
                message: Retrieved 2 custom drugs successfully
                code: SUCCESS
                data:
                  - custom_drug_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                    item_generic_name: Amoxicillin
                    item_trade_name: Amoxil
                    brand_name: Amoxil
                    item_strength: 500mg
                    item_form: Capsule
                    route_of_administration: Oral
                    quantity: '20'
                    max_repeats: '2'
                    poison_class: S4
                    custom_product_id: EK-12345
                    description: Antibiotic
                    patient_instructions: Take one capsule twice daily
                    doctor_instructions: Review after course
                timestamp: '2024-01-15T10:30:00.000Z'
                requestId: req_1705312200000_abc123
        '400':
          description: Bad Request - Invalid request format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalApiErrorResponse'
        '401':
          description: Unauthorized - Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalApiErrorResponse'
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalApiErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalApiErrorResponse'
components:
  schemas:
    ExternalCustomDrug:
      type: object
      description: >-
        A custom drug as exposed to partners. custom_drug_id is the unique
        identifier used to prefill the prescription form.
      properties:
        custom_drug_id:
          type: string
          description: Unique identifier for the custom drug
        item_generic_name:
          type: string
        item_trade_name:
          type: string
        brand_name:
          type: string
        item_strength:
          type: string
        item_form:
          type: string
        route_of_administration:
          type: string
        quantity:
          type: string
        max_repeats:
          type: string
        poison_class:
          type: string
        custom_product_id:
          type: string
        description:
          type: string
        patient_instructions:
          type: string
        doctor_instructions:
          type: string
    ExternalApiErrorResponse:
      type: object
      required:
        - success
        - statusCode
        - error
        - timestamp
        - requestId
      properties:
        success:
          type: boolean
          description: Indicates if the request was successful
          example: false
        statusCode:
          type: integer
          description: HTTP status code
          example: 400
        code:
          type: string
          description: Machine-readable operation code identifying the error
          example: RESOURCE_NOT_FOUND
        error:
          type: object
          description: RFC 7807 compliant error details
          required:
            - type
            - title
            - detail
          properties:
            type:
              type: string
              format: uri
              description: URI identifying the problem type
              example: https://parchment.health/errors/validation-error
            title:
              type: string
              description: Human-readable summary of the problem
              example: Validation failed
            detail:
              type: string
              description: Human-readable explanation of the problem
              example: There were some problems with your input.
            instance:
              type: string
              format: uri
              description: URI reference to the specific occurrence
              example: /patients/123
            validation:
              type: array
              description: Field-level validation errors (for 422 responses)
              items:
                type: object
                properties:
                  field:
                    type: string
                    description: Field name that failed validation
                  message:
                    type: string
                    description: Validation error message
                  code:
                    type: string
                    description: Error code for programmatic handling
        timestamp:
          type: string
          format: date-time
          description: ISO 8601 timestamp of the response
          example: '2024-01-15T10:30:00.000Z'
        requestId:
          type: string
          description: Unique identifier for request tracing
          example: req_1705312200000_def456
        meta:
          type: object
          description: Additional response metadata
          properties:
            apiVersion:
              type: string
              description: API version used
              example: '1.0'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````