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

# Update medicine stock

> Updates a patient's existing prescription.



## OpenAPI

````yaml PUT /inventory/{medicine}
openapi: 3.0.0
info:
  title: Subin Health API
  description: >

    # Overview

    Subin Health API lets you manage patient data, prescriptions, and inventory.
    You can view, edit, delete patient profiles, history, visits, and medical
    records. You can also track the medicine inventory based on new
    prescriptions. <br>This API is REST-based and is documented in OpenAPI
    format. <br><br>    Base URL for all requests:
    `https://virtserver.swaggerhub.com/SUBIN23K/Subin_Health/1.0.0`.

    # Authentication

    Subin Health API uses API Key authentication. Click `Authorize` and enter a
    string to generate a new API key.

    # Use Case

    ## Prescription and Invoicing

    You can use Subin Health API to generate prescription after a doctor's
    consultation and invoice for payment. The endpoints related to inventory
    check the real-time availability of medicines in your inventory. With the
    help of historic data from prescriptions, you can proactively restock
    medicines that are in demand. <br> <br> The following diagram outlines the
    process flow: <br> ![Flow
    diagram](https://raw.githubusercontent.com/subin23k/apidocs/main/flow_diagram.png
    "Flow diagram") <br> When the flow is complete, the system automatically
    updates the patient's history.
  version: 1.0.0
servers:
  - url: https://virtserver.swaggerhub.com/SUBIN23K/Subin_Health/1.0.0
    description: Subin Health API
security:
  - api_key: []
tags:
  - name: Patient
    description: Manage patient data
  - name: History
    description: Manage patient's history
  - name: Prescriptions
    description: Manage prescriptions
  - name: Inventory
    description: Manage inventory
  - name: Invoice
    description: Manage invoices
paths:
  /inventory/{medicine}:
    put:
      tags:
        - Inventory
      summary: Update stock of medicine
      description: Updates a patient's existing prescription.
      operationId: updateMedicine
      parameters:
        - name: medicine
          in: path
          description: Medicine's name
          required: true
          style: simple
          explode: false
          schema:
            type: string
            example: Dolo 650
      requestBody:
        $ref: '#/components/requestBodies/Inventory'
      responses:
        '200':
          description: Successful operation
        '400':
          description: Invalid medicine name
        '404':
          description: Medicine not found
        '405':
          description: Validation exception
components:
  requestBodies:
    Inventory:
      description: Object that contains inventory data
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Inventory'
        application/xml:
          schema:
            $ref: '#/components/schemas/Inventory'
      required: true
  schemas:
    Inventory:
      description: Availability and pricing details of a specific medicine in stock.
      required:
        - isAvailable
        - medicine
      type: object
      properties:
        medicine:
          type: string
          description: Name of the stocked medicine.
          example: Dolo 650
        dosage:
          type: string
          description: Dosage formulation of the medicine.
          example: 650 mg
        isRegular:
          type: boolean
          description: >-
            Indicates whether the medicine is available for regular recurring
            subscriptions.
        isAvailable:
          type: boolean
          description: Indicates whether the medicine is currently in stock.
        price:
          type: integer
          description: Unit price of the medicine in inventory.
          example: 1000
        currency:
          type: string
          description: Currency code for the medicine's price.
          example: INR
      xml:
        name: Inventory
  securitySchemes:
    api_key:
      type: apiKey
      name: api_key
      in: header

````