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

# Update Organization Custom Drug

> Updates one organization-level custom drug. Send only the fields to change.

Updates one **organization-level** custom drug. Send only the fields to change. Omitted fields are left as they are.

`custom_drug_id` is the `custom_drug_id` from the catalog list or the bulk-create `created[]` array. It must exist in this organization's catalog, or `404` is returned.

## Example Request

```json theme={null}
{
  "item_strength": "250mg",
  "quantity": "30"
}
```

## Example Response

```json theme={null}
{
  "success": true,
  "statusCode": 200,
  "message": "Custom drug updated successfully",
  "code": "SUCCESS",
  "data": {
    "custom_drug_id": "3b99ce35-844c-4925-93ff-5b8ec13be5f5",
    "item_generic_name": "Amoxicillin",
    "item_strength": "250mg",
    "item_form": "Capsule",
    "route_of_administration": "Oral",
    "quantity": "30",
    "max_repeats": "2",
    "poison_class": "S4",
    "custom_product_id": "EK-12345"
  },
  "timestamp": "2024-01-15T10:30:00.000Z",
  "requestId": "req_1705312200000_abc123"
}
```

## Status Codes

| Code | Meaning                                                                          |
| ---- | -------------------------------------------------------------------------------- |
| 200  | Updated — `data` is the full drug                                                |
| 400  | Body has no updatable fields                                                     |
| 401  | Authentication failed, or the token's user is not an organization owner or admin |
| 404  | No drug with this `custom_drug_id` in this organization's catalog                |
| 422  | Validation failed — see `error.validation`                                       |
| 500  | Unexpected server error                                                          |

## Notes

* Requires the `update:custom_drug` scope.
* Organization-level only. Use the user-level endpoint for a prescriber's personal drugs.
* Fields not set on the drug are omitted from `data`.


## OpenAPI

````yaml PUT /v1/organizations/{organization_id}/custom-drugs/{custom_drug_id}
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}/custom-drugs/{custom_drug_id}:
    put:
      description: >-
        Updates one organization-level custom drug. Send only the fields to
        change.
      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: custom_drug_id
          in: path
          required: true
          description: custom_drug_id from the catalog or bulk-create response
          schema:
            type: string
      requestBody:
        description: Partial custom drug fields to update
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomDrugUpdate'
      responses:
        '200':
          description: Custom drug updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomDrugResponse'
        '400':
          description: No updatable fields provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalApiErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalApiErrorResponse'
        '404':
          description: Custom drug not found for this organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalApiErrorResponse'
        '422':
          description: Validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalApiErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalApiErrorResponse'
components:
  schemas:
    CustomDrugUpdate:
      type: object
      description: Partial custom drug fields to update. Send only the fields to change.
      properties:
        item_generic_name:
          type: string
          maxLength: 280
        item_trade_name:
          type: string
          maxLength: 280
        brand_name:
          type: string
          maxLength: 100
        item_strength:
          type: string
          maxLength: 100
        item_form:
          type: string
          maxLength: 50
        route_of_administration:
          type: string
          maxLength: 50
        quantity:
          type: string
        max_repeats:
          type: string
        poison_class:
          type: string
          maxLength: 2
          pattern: ^S[2-9]$
          description: Schedule with the S prefix, S2 to S9. A bare digit is rejected.
          example: S4
        custom_product_id:
          type: string
          maxLength: 50
          description: >-
            Your own identifier for this drug. Never generated by Parchment. Not
            checked for uniqueness.
          example: EK-12345
        description:
          type: string
          maxLength: 280
        patient_instructions:
          type: string
          maxLength: 250
        doctor_instructions:
          type: string
          maxLength: 50
    CustomDrugResponse:
      type: object
      properties:
        success:
          type: boolean
        statusCode:
          type: integer
        message:
          type: string
        code:
          type: string
          example: SUCCESS
        data:
          $ref: '#/components/schemas/ExternalCustomDrug'
        timestamp:
          type: string
        requestId:
          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'
    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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````