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

# Create new invoice

> Creates a new invoice.



## OpenAPI

````yaml POST /invoice
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:
  /invoice:
    post:
      tags:
        - Invoice
      summary: Create new invoice
      description: Creates a new invoice.
      operationId: addInvoice
      requestBody:
        $ref: '#/components/requestBodies/Invoice'
      responses:
        '200':
          description: Successful operation
        '405':
          description: Invalid input
components:
  requestBodies:
    Invoice:
      description: Object that contains invoice data
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Invoice'
        application/xml:
          schema:
            $ref: '#/components/schemas/Invoice'
      required: true
  schemas:
    Invoice:
      description: Billing statement for a patient's prescription or hospital services.
      required:
        - isAvailable
        - medicine
        - patientId
      type: object
      properties:
        patientId:
          type: integer
          description: Unique identifier for the patient being invoiced.
          format: int64
          example: 234796
        name:
          type: string
          description: Full or registered name of the patient.
          example: Subin
        age:
          type: integer
          description: Current age of the patient in years.
          format: int64
          example: 100
        invoiceDate:
          type: string
          description: Date when the invoice was generated (DD/MM/YYYY).
          example: 01/03/2024
        gender:
          type: string
          description: Gender of the patient.
          example: Male
        phone:
          type: integer
          description: Primary contact phone number for the patient.
          format: int64
          example: 9876543210
        email:
          type: string
          description: Primary email address for the patient.
          example: abc@example.com
        companyaddress:
          type: string
          description: Registered address of the issuing healthcare facility.
          example: Bangalore, India
        medicine:
          type: string
          description: Name of the billed medicine.
          example: Dolo 650
        dosage:
          type: string
          description: Billed dosage of the medicine.
          example: 650 mg
        price:
          type: integer
          description: Total billed amount for the medicine.
          example: 1000
        currency:
          type: string
          description: Currency code for the billed amount.
          example: INR
      xml:
        name: Invoice
  securitySchemes:
    api_key:
      type: apiKey
      name: api_key
      in: header

````