# API - powered by eVitalRx

eVitalRx is a cloud-based platform for pharmacy stores in India, providing APIs that enable seamless integration with various applications for managing stock, orders, and other pharmacy operations.

## Introduction

🚀 **eVitalRx** provides the **API product** to empower the **Patient and Doctor Apps** where one can search Medicines or OTCs and get an updated price, stock, and alternatives from the inventory of linked Pharmacy in real-time. Also, one can **Place the Order** or **Push the Prescription** to the pharmacy and various other smart and integrated features.  🩺🌐[ (Watch Video)](https://youtu.be/ZTnMWageP_M?si=Qj_HEhBkv5A34wKb)

## Scope of API

The scope of integration is to maintain syncing of the data between two platforms. The integration would act as a bridge to reduce the complexity and optimize the business processes. 🌐🔗

* **Available Inventory** would be reflected in the Apps with all the updated details of the medicines and OTCs. 💊📦
* **Place the order** or **Push the Prescription** to the Pharmacy from the Patient or Doctor App and it will reflect the same in the eVitalRx. 🛒📲💊
* **Generated orders** would be reflected on all the platforms with customers and payment status. 💳💻
* **Order status** would be updated to the respected app too. 📱🔄
* **Patients added** from Apps to eVitalRx would be reflected in eVitalRx with the past order history. 🏥📜

## Getting Started

* [Register](https://www.evitalrx.in/login?type=signup) on eVitalRx and make sure you have an active eVitalRx subscription to get started 💊
* Subscribe to the [API subscription](https://www.evitalrx.in/api-pricing/?utm_source=www.google.com\&utm_medium=paid_search\&utm_campaign=referrer_www_google_com)  💳✨
* After subscribing to the API subscription heead to your Profile and request your API key 🔑👤
* Once your key is ready, start making your API requests 🚀

## Contact Us

📞 **+91 90330 71737**\
📧 <support@evital.in>


# Getting Started with eVitalRx

## Explore Our Dashboard

💻 To explore and test the features of our platform, including browsing products 👀, making purchases 💸, and managing sales 📈 , you can access our staging environment. This is a safe space where you can get familiar with how everything works before using the live platform. 🌟

**🔑 Use the link & credentials below to access the staging portal:**

Portal Link 🔗: <https://api-staging.evitalrx.in/dashboard>

```
mobile: 7777777777
password: test@api
```

***

## API Endpoint & Key(s)

**Base URL for testing our API's (staging)**&#xD83D;&#xDD17;**:**  [**https://ews-staging-api-product.portal-evital.com/v1**](https://ews-staging-api-product.portal-evital.com/v1)[**/**](https://dev-api.evitalrx.in/v1/)

**Base URL for testing our API's (production)** �&#xDD17;**:**  [**https://api.evitalrx.in/v1/**](https://api.evitalrx.in/v1/)

**Use the following API keys for different applications in the staging environment:**&#x20;

| Bundle            | API Key                          |
| ----------------- | -------------------------------- |
| Product Catalogue | NAQ5XNukAVMPGdbJkjJcMUK9DyYBeTpu |
| Patient App       | I8JElvKBFFg8rMpOteYljU7w5nqH5dKP |
| EMR/HMIS Software | oORbgJ9u006PfjHQ8ICtFH4mNcwBWBZj |
| Master Reports    | 6afjX4VSKeX3Pi82KYgy5ad7sm0CrWDK |
| B2B               | QcT3NNYpLrGrPFvpgpYspTzk5esuM6R9 |
| Fulfillment       | xhIxP75eG1sQEh8vVAdXykgzF4mLhDw3 |

***

### Available API Bundles for Different Use Case&#x73;**. 🔗**

⚕️Explore the diverse set of APIs designed for different use cases across our platform. 🔗 Below are the API bundles that can help you integrate and manage key functionalities:

<table data-view="cards"><thead><tr><th align="center"></th><th data-hidden></th><th data-hidden></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td align="center"><a href="/pages/7LFnXSiuPCz5XUcBXY6R"><strong>API for Product Catalogue</strong></a></td><td></td><td></td><td><a href="/pages/7LFnXSiuPCz5XUcBXY6R">/pages/7LFnXSiuPCz5XUcBXY6R</a></td><td><a href="/files/Ded524e661G5xMaEhBl7">/files/Ded524e661G5xMaEhBl7</a></td></tr><tr><td align="center"><a href="/pages/-MkMeV3z2eoSkPDWWSpy"><strong>API for Patient App</strong></a></td><td></td><td></td><td><a href="/pages/-MkMeV3z2eoSkPDWWSpy">/pages/-MkMeV3z2eoSkPDWWSpy</a></td><td><a href="/files/SGj5cBPChJO68pXmMr5e">/files/SGj5cBPChJO68pXmMr5e</a></td></tr><tr><td align="center"><a href="/pages/-MkMieU8ax-Kq0MIYwOA"><strong>API for EMR/HMIS Software</strong></a></td><td></td><td></td><td><a href="/pages/-MkMieU8ax-Kq0MIYwOA">/pages/-MkMieU8ax-Kq0MIYwOA</a></td><td><a href="/files/EsoYVuAXFUciTfIy8vfR">/files/EsoYVuAXFUciTfIy8vfR</a></td></tr><tr><td align="center"><a href="/pages/8Zwrut5iUBPEY6XRxzsJ"><strong>API for Master</strong></a></td><td></td><td></td><td><a href="/pages/8Zwrut5iUBPEY6XRxzsJ">/pages/8Zwrut5iUBPEY6XRxzsJ</a></td><td><a href="/files/6Dcld076ALvnLyTCfmcu">/files/6Dcld076ALvnLyTCfmcu</a></td></tr><tr><td align="center"><a href="/pages/x5T98cNtQhPn56YY98ht"><strong>API for Fulfillment</strong></a></td><td></td><td></td><td><a href="/pages/x5T98cNtQhPn56YY98ht">/pages/x5T98cNtQhPn56YY98ht</a></td><td><a href="/files/kgvFSuNmwvjsyqNGKzBG">/files/kgvFSuNmwvjsyqNGKzBG</a></td></tr><tr><td align="center"><a href="/pages/QO61DJE2lF0SEL1tSDQE"><strong>API for B2B</strong></a></td><td></td><td></td><td><a href="/pages/QO61DJE2lF0SEL1tSDQE">/pages/QO61DJE2lF0SEL1tSDQE</a></td><td><a href="/files/AHRUV2LiYk4sd0GXmEur">/files/AHRUV2LiYk4sd0GXmEur</a></td></tr></tbody></table>

### Utility API(s)

⚙️ The following utility APIs provide flexibility and additional configuration options to enhance your platform integration:

<table data-view="cards"><thead><tr><th align="center"></th><th data-hidden></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td align="center"><a href="/pages/Ykw1etZbvohzJPZ1S7R3"><strong>API for Custom Fields</strong></a></td><td></td><td><a href="/files/yea2UDMDlano7DhaNGBq">/files/yea2UDMDlano7DhaNGBq</a></td></tr><tr><td align="center"><a href="/pages/tubhQM1xzELZyjSyDp3b"><strong>Webhooks &#x26; Responses</strong></a></td><td></td><td><a href="/files/T80hWT3pII05ikF0tT5v">/files/T80hWT3pII05ikF0tT5v</a></td></tr></tbody></table>

***

## Explore Medicine's & Dosage Type's Available in Staging

📄 Here's a list of all the medicines & dosage types currently available in our staging environment. Use this file to review and explore the products that are supported and ready for testing on the platform. 💊📋

{% file src="/files/wHF4xVvM8zOXodnTUPT7" %}

{% file src="/files/0FiAjmhdxyd5dgh2wgZ0" %}


# Introduction

This bundle provides APIs for managing and retrieving product information, including searching for medicines, viewing product details, exploring categories, and requesting products. It helps to smooth the product catalog management.

**Here is the Postman Collection of APIs**

{% file src="/files/GajXpUODpaBcAjmcfivO" %}

## Sequence Diagram

<figure><img src="/files/VW4kAz8shzwIZDdCfemr" alt=""><figcaption><p><mark style="background-color:yellow;"><strong><code>This flowchart illustrates the process of interacting with a product catalog API bundle. The user selects an action (such as searching for products, viewing product details, or browsing categories), and the system calls the corresponding API to fetch the relevant data. Once the API responds, the system returns the results to the user. This flow ensures efficient product catalog management by handling different user requests like searching, viewing, or requesting products.</code></strong></mark></p></figcaption></figure>

**Watch a video.**

{% embed url="<https://www.loom.com/share/01db903b50724aceb4440b498bc33528>" %}


# Medicines


# Search Product

To search items in your inventory with the Item Name (string), GTIN number of the product, or Salt-Composition(content).

#### [Explore Medicines Available in Staging](/getting-started-with-evitalrx#explore-medicines-available-in-staging)

## Search Products

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}catalog/medicines/search`](https://api.evitalrx.in/v1/catalog/medicines/search)

If the Item is present in your inventory, then it will appear first.

#### Request Body

| Name                                           | Type   | Description                                                                                                                                                                                                                                                                              |
| ---------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>       | String | Authentication token                                                                                                                                                                                                                                                                     |
| searchstring<mark style="color:red;">\*</mark> | String | <p>Search String input</p><p>It can be used in following ways.</p><p>By Item Name</p><p><code>"searchstring":"dolo"</code></p><p></p><p>By Content</p><p><code>"searchstring":"c,paraceta"</code></p><p></p><p>By GTIN Number</p><p><code>"searchstring":"89080034169"</code></p><p></p> |

{% tabs %}
{% tab title="200: OK Products Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-06 15:16:32",
    "data": {
        "did_you_mean_result": [], // if medicine not found then suggestions
        "result": [
            {
                "dosage_type": "drop",
                "medicine_name": "Spasmex 20 mg/500 mg Drop",
                "content": "Dicyclomine (20mg) + Paracetamol (500mg)",
                "mrp": "22.5",
                "medicine_id": "5V9jvbzLGKcIwCOnnt5E/w==",
                "packing_size": "10 ml in 1 packet",
                "size": "1",
                "manufacturer_name": "Hema Laboratories",
                "medicine_type": "drug"
            },
            {
                "dosage_type": "drop",
                "medicine_name": "Lanol 100 Mg/ml Drop",
                "content": "Paracetamol (100mg/ml)",
                "mrp": "18",
                "medicine_id": "mvwaFPrEdzOHMTd9V9zsQg==",
                "packing_size": "1 Bottle of  15 Ml",
                "size": "1",
                "manufacturer_name": "Hetero Drugs Ltd",
                "medicine_type": "drug"
            }
        ]
    }    
}
```

{% endtab %}

{% tab title="200: OK Products not found" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-06 15:21:25",
    "data": {
        "did_you_mean_result": [],
        "result": []
    }
}
```

{% endtab %}

{% tab title="200: OK Validation error" %}

```json
{
    "status_code": "0",
    "status_message": "\"Medicine Name\" length must be less than or equal to 20 characters long",
    "datetime": "2022-12-06 15:19:58",
    "data": null
}
```

{% endtab %}
{% endtabs %}

**List of available medicines in the staging environment:**

{% file src="/files/wHF4xVvM8zOXodnTUPT7" %}


# Product Details

To get item details in your inventory by unique medicine Id.

## Product Details

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}catalog/medicines/view`](https://api.evitalrx.in/v1/catalog/medicines/view)

#### Request Body

| Name                                           | Type   | Description                                                                                                                                                                                                                                                                                                           |
| ---------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>       | String | Authentication Token                                                                                                                                                                                                                                                                                                  |
| medicine\_id<mark style="color:red;">\*</mark> | String | Unique id of the product                                                                                                                                                                                                                                                                                              |
| medicine\_ids                                  | String | <p>Stringified Array of medicine\_ids.</p><p></p><p><strong>medicine\_id</strong> param is optional, if <strong>medicine\_ids</strong> param is passed.</p><p></p><p>medicine\_ids should contain at least 2 medicine\_ids.</p><p></p><p>Example:</p><p>\["z5s5a+e/Cj4ip7sUl2zJFQ==", "otUfMtG4nIpWSc+oWoX7Lw=="]</p> |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-06 15:46:28",
    "data": {
        "content": "",
        "how_medicine_works": "",
        "how_to_use": "",
        "id": "8Oq/U+AVxuCWtncoxUgtEg==", // medicine_id
        "medicine_image": "https://d2ffmswuyj0h1d.cloudfront.net/storage/medicines/5f056fbc83c8c.jpg",
        "is_rx_required": 0,
        "dosage_type": "",
        "medicine_name": "Organic Harvest Under Eye Gel",
        "mrp": 595,
        "packing_size": "1 Tube of 15gm",
        "size": 1,
        "manufacturer_name": "Organic Harvest",
        "side_effects": "",
        "alcohol": "",
        "driving": "",
        "kidney": "",
        "lactation": "",
        "liver": "",
        "pregnancy": "",
        "medicine_category": "generic",
        "alternative_results": {
            "in_stock_count": 0,
            "results": [
                {
                    "dosage_type": "",
                    "medicine_name": "Azithral XL 200 Liquid",
                    "content": "Azithromycin  (200mg/5ml)",
                    "mrp": "202.87",
                    "medicine_id": "m7IrSmX+8aSwf1QsTNQwxA==",
                    "packing_size": "1 Bottle of  60 Ml",
                    "size": "1",
                    "manufacturer_name": "Alembic Pharmaceuticals Ltd",
                    "medicine_type": "drug"
                },
                {
                    "dosage_type": "",
                    "medicine_name": "Grocapix M Serum",
                    "content": "Minoxidil (5%w/v)",
                    "mrp": "995",
                    "medicine_id": "PwV4BmXVlNv38hazbjPZog==",
                    "packing_size": "1 Bottle of  60 Ml",
                    "size": "1",
                    "manufacturer_name": "Alembic Pharmaceuticals Ltd",
                    "medicine_type": "drug"
                },
                {
                    "dosage_type": "",
                    "medicine_name": "Lamiwin 500 mg Infusion",
                    "content": "Levofloxacin (500mg)",
                    "mrp": "120",
                    "medicine_id": "FH8RZwkCHnVoLQ17auLIjg==",
                    "packing_size": "100 ml in 1 bottle",
                    "size": "1",
                    "manufacturer_name": "Alembic Pharmaceuticals Ltd",
                    "medicine_type": "drug",
                    "schedule_type": "H1"
                }
            ]
        },
        "medicine_images": [
            {
                "medicine_image": "https://d2ffmswuyj0h1d.cloudfront.net/storage/medicines/5f056fbc83c8c.jpg",
                "default": "no"
            }
        ]
    }
}
```

{% endtab %}

{% tab title="200: OK No Product found according to request params" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid medicine key",
    "datetime": "2022-12-06 16:42:59",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Search Content

To search content

## Search Contents

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}catalog/medicines/content_search`](https://api.evitalrx.in/v1/catalog/medicines/content_search)

#### Request Body

| Name                                      | Type   | Description             |
| ----------------------------------------- | ------ | ----------------------- |
| content<mark style="color:red;">\*</mark> | String | Content to be searched. |
| apikey<mark style="color:red;">\*</mark>  | String | Authentication token    |

{% tabs %}
{% tab title="200 Products Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-05-15 18:54:34",
    "data": {
        "results": [
            {
                "content": "Paradichlorobenzene (4gm)", // content from product_details
                "id": "TmOVsxtb5BlFs4px88ReRQ==" // it's unique ID
            },
            {
                "content": "Paradichlorobenzene (162.5mg)",
                "id": "c7OJPXkeXCg/8pa130GbTg=="
            },
            {
                "content": "Paradichlorobenzene (320mg)",
                "id": "VcelI1X0zp2urnxD6sbnJw=="
            },
            {
                "content": "Propyl Paraben (180mcg)",
                "id": "vY/1wcav8EcVHA0otFK67Q=="
            },
            {
                "content": "Propyl Paraben (850.0mg)",
                "id": "0K50lD2ZYe6ZCitNDtfJZQ=="
            },
            {
                "content": "Paradichlorobenzene (0.38%w/w)",
                "id": "+Du4PAgn4slRMnpBsqaYPw=="
            },
            {
                "content": "Para Amino Benzoic Acid (500mg)",
                "id": "Ez+RTplCJoRJpyEHzxaAPQ=="
            },
            {
                "content": "Propyl Paraben (1.5gm)",
                "id": "6UPouwJuJnDVRDEHz5Zjyw=="
            },
            {
                "content": "Propyl Paraben (600000iu)",
                "id": "TRTCy6rIpJjr3JprQmITZA=="
            },
            {
                "content": "Propyl Paraben (0.31mg)",
                "id": "I3XKPhvcLdUgojwrUhlMuw=="
            }
        ]
    }
}
```

{% endtab %}

{% tab title="200: OK No Products found" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-05-15 18:54:46",
    "data": {
        "results": []
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "content is required",
    "datetime": "2023-05-15 18:54:59",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Request Product

To request a product, which is not available at eVitalRx.

## Request Product

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}catalog/medicines/request_medicine`](https://api.evitalrx.in/v1/catalog/medicines/request_medicine)

#### Request Body

| Name                                                 | Type   | Description                                                                                                                                                                                       |
| ---------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>             | String | Authentication Token                                                                                                                                                                              |
| medicine\_name<mark style="color:red;">\*</mark>     | String | Product Name                                                                                                                                                                                      |
| gtin\_number                                         | String | Product's GTIN Number                                                                                                                                                                             |
| hsn\_code                                            | String | <p>Product's HSN Number</p><p>Min Length: 3</p><p>Max Length: 8</p>                                                                                                                               |
| manufacturer\_name<mark style="color:red;">\*</mark> | String | Product's Manufacturer Name                                                                                                                                                                       |
| packaging<mark style="color:red;">\*</mark>          | String | <p>Product's Packaging</p><p></p><p>Packaging: strip, bottle, packet, piece, tube, etc.</p><p></p><p>Examples: Himalaya Cream is 100gm.</p><p>Then pass <strong>"packaging":  "tube"</strong></p> |
| mrp<mark style="color:red;">\*</mark>                | Number | Price of the Product                                                                                                                                                                              |
| unit                                                 | String | <p>Unit for the measurement of the Product</p><p></p><p>Units: gm, ml, tablets, capsules, etc.</p><p></p><p>Examples: Himalaya Cream is 100gm.</p><p>Then pass <strong>"unit":  "gm"</strong></p> |
| weightage                                            | Number | <p>Weightage of the Product:</p><p></p><p>Examples: Himalaya Cream is 100gm.</p><p>pass <strong>"weightage":  100</strong></p>                                                                    |
| gst\_percentage                                      | Number | <p>GST Percentage of the Product:</p><p>Valid values: 0, 5, 12, 18, 28</p>                                                                                                                        |
| os                                                   | String | web                                                                                                                                                                                               |
| image<mark style="color:red;">\*</mark>              | File   | Back photo of the Product.                                                                                                                                                                        |
| image<mark style="color:red;">\*</mark>              | File   | Front photo of the Product.                                                                                                                                                                       |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-06 17:30:56",
    "data": {
        "medicine_id": "sWCoyp2jvgEx9ul1CBOuFA==",
        "medicine_type": "",
        "packing_size": "1 Tube of 100 Gm",
        "pack_size": "100 Gm",
        "manufacturer_name": "",
        "hsn_code": "",
        "gst_percentage": 0,
        "gtin_number": "",
        "mrp": 100,
        "medicine_name": "Himalaya Fairness Cream"
    }
}
```

{% endtab %}

{% tab title="200: OK Images not found" %}

```json
{
    "status_code": "0",
    "status_message": "Medicine images not found",
    "datetime": "2022-12-06 17:31:17",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "\"manufacturer_name\" is not allowed to be empty",
    "datetime": "2022-12-06 17:32:05",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Get Categories

Get the Product categories list.

## Get Categories

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}catalog/medicines/get_categories`](https://api.evitalrx.in/v1/catalog/medicines/get_categories)

#### Request Body

| Name                                     | Type   | Description                                                                                                   |
| ---------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark> | String | Authentication token                                                                                          |
| searchstring                             | String | <p>If searchstring passed, it will fetch relevant categories. </p><p>Min len: 3 </p><p>Max len: 20</p><p></p> |
| page                                     | Number | Default: 1                                                                                                    |

{% tabs %}
{% tab title="200: OK Categories Retrieved Successfully" %}

```json

{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-10-03 17:34:23",
    "data": {
        "current_page": 1,
        "rpp": 5,
        "results": [
            {
                "id": "mB3b+VF0xsD9XnRkj0evHQ==", // Unique ID of Category
                "category_name": "Personal Care",
                "category_picture": "https://d2ffmswuyj0h1d.cloudfront.net/storage/extra/cosmetic/default.jpg"
            },
            {
                "id": "x+hOdgFr9YalM4JTGrgOhg==",
                "category_name": "Fitness & Supplements",
                "category_picture": "https://d2ffmswuyj0h1d.cloudfront.net/storage/extra/cosmetic/default.jpg"
            },
            {
                "id": "ibqdoR3lz+/fQXQnibWPCA==",
                "category_name": "Health Devices",
                "category_picture": "https://d2ffmswuyj0h1d.cloudfront.net/storage/extra/cosmetic/default.jpg"
            },
            {
                "id": "q7dxGR/3f2J95UbkkQniNA==",
                "category_name": "Pet Care",
                "category_picture": "https://d2ffmswuyj0h1d.cloudfront.net/storage/extra/cosmetic/default.jpg"
            },
            {
                "id": "lCLRl5M5V0FsPEy0b37WUQ==",
                "category_name": "Healthcare Devices",
                "category_picture": "https://d2ffmswuyj0h1d.cloudfront.net/storage/extra/cosmetic/default.jpg"
            }
        ]
    }
}
```

{% endtab %}

{% tab title="200: OK Categories not found" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-10-03 17:57:39",
    "data": {
        "current_page": 1,
        "rpp": 5,
        "results": []
    }
}
```

{% endtab %}

{% tab title="200: OK Validation error" %}

```json

{
    "status_code": "0",
    "status_message": "searchstring length must be at least 3 characters long",
    "datetime": "2023-10-03 17:58:07",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Get Category Products

Get the Products of a particular category.

## Get Category Products

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}catalog/medicines/get_category_items`](https://api.evitalrx.in/v1/catalog/medicines/get_category_items)

#### Request Body

| Name                                           | Type   | Description          |
| ---------------------------------------------- | ------ | -------------------- |
| apikey<mark style="color:red;">\*</mark>       | String | Authentication token |
| category\_id<mark style="color:red;">\*</mark> | String | Category ID          |
| page                                           | Number | Default: 1           |

{% tabs %}
{% tab title="200: OK Products Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-10-03 17:50:28",
    "data": {
        "current_page": 1,
        "rpp": 10,
        "results": [
            {
                "dosage_type": "",
                "salt_content_id": "",
                "medicine_name": "MamyPoko Standard Pants L",
                "content": "",
                "mrp": 195,
                "medicine_id": "PUe/q5mC00cuci4cVAgiWg==",
                "packing_size": "1 Packet of  17 Piece",
                "size": 1,
                "manufacturer_name": "Unicharm India",
                "medicine_type": "otc",
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/6286077028b09.jpg"
            },
            {
                "dosage_type": "",
                "salt_content_id": "",
                "medicine_name": "MamyPoko Standard Pants L",
                "content": "",
                "mrp": 195,
                "medicine_id": "PUe/q5mC00cuci4cVAgiWg==",
                "packing_size": "1 Packet of  17 Piece",
                "size": 1,
                "manufacturer_name": "Unicharm India",
                "medicine_type": "otc",
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/6286077028b09.jpg"
            },
            {
                "dosage_type": "",
                "salt_content_id": "",
                "medicine_name": "MamyPoko Extra Absorb Pants L",
                "content": "",
                "mrp": 30,
                "medicine_id": "8orluEHZ13mtYr/kNuhTlA==",
                "packing_size": "1 Packet of  2 Piece",
                "size": 1,
                "manufacturer_name": "Unicharm India",
                "medicine_type": "otc",
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/62a87226034ff.jpg"
            },
            {
                "dosage_type": "",
                "salt_content_id": "",
                "medicine_name": "MamyPoko Extra Absorb Pants L",
                "content": "",
                "mrp": 30,
                "medicine_id": "8orluEHZ13mtYr/kNuhTlA==",
                "packing_size": "1 Packet of  2 Piece",
                "size": 1,
                "manufacturer_name": "Unicharm India",
                "medicine_type": "otc",
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/62a87226034ff.jpg"
            },
            {
                "dosage_type": "",
                "salt_content_id": "",
                "medicine_name": "Dove Baby Lotion Rich Moisture",
                "content": "",
                "mrp": 65,
                "medicine_id": "SfplmQsHVjJsp3tv4qlMIQ==",
                "packing_size": "1 Bottle of  1 Gm",
                "size": 1,
                "manufacturer_name": "Unilever India",
                "medicine_type": "otc",
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/63be802b49ab8.jpg"
            },
            {
                "dosage_type": "",
                "salt_content_id": "",
                "medicine_name": "Dove Baby Lotion Rich Moisture",
                "content": "",
                "mrp": 65,
                "medicine_id": "SfplmQsHVjJsp3tv4qlMIQ==",
                "packing_size": "1 Bottle of  1 Gm",
                "size": 1,
                "manufacturer_name": "Unilever India",
                "medicine_type": "otc",
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/63be802b49ab8.jpg"
            }
        ]
    }
}
```

{% endtab %}

{% tab title="200: OK Products not found" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-10-03 18:03:06",
    "data": {
        "current_page": 4,
        "rpp": 10,
        "results": []
    }
}
```

{% endtab %}

{% tab title="200: OK Validation error" %}

```json
{
    "status_code": "0",
    "status_message": "category_id is required",
    "datetime": "2023-10-03 18:03:24",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Introduction

This bundle provides APIs for managing patient accounts, medicines, addresses, and orders. It includes features for user authentication (login/signup), patient management, address handling, product searches, and order placements. It enables a smooth experience for patients interacting with healthcare services.

**Here is the Postman Collection of APIs**

{% file src="/files/2vJMNlkhDs1TWV40FgfF" %}

## Sequence Diagram

<figure><img src="/files/j6XdHklM7B1IZ4rLChzB" alt=""><figcaption><p><mark style="background-color:yellow;"><strong><code>This sequence diagram represents the core functionality of the patient app, covering user authentication (login/signup), patient and address management (add/update/set default), product search, and order management (place/cancel). It outlines the flow of interactions between the user and the eVitalRx API, ensuring smooth handling of patient-related tasks, product searches, and order processing.</code></strong></mark></p></figcaption></figure>


# Login/Signup

APIs for signup & login for patients.

**Watch a video.**

{% embed url="<https://www.loom.com/share/e1278f28abd94a71a618e2b3bec15963>" %}


# Signup send OTP

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/login/signup_sendotp`](https://api.evitalrx.in/v1/patient/login/signup_sendotp)

API to check whether the patient should sign up or log in.&#x20;

#### Request Body

| Name                                        | Type   | Description              |
| ------------------------------------------- | ------ | ------------------------ |
| apikey<mark style="color:red;">\*</mark>    | String | Authentication token     |
| mobile<mark style="color:red;">\*</mark>    | String | Mobile number of Patient |
| firstname<mark style="color:red;">\*</mark> | String | First name of Patient    |
| lastname                                    | String | Last name of Patient     |

{% tabs %}
{% tab title="200 OTP send successfully." %}

```json
{
    "status_code": "1",
    "status_message": "OTP sent successfully to your mobile number",
    "datetime": "2023-10-25 17:04:47",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK Patient already exists, kindly login." %}

```json
{
    "status_code": "0",
    "status_message": "This Mobile is already exist.",
    "datetime": "2023-10-25 17:46:24",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Please enter valid mobile",
    "datetime": "2022-12-06 18:09:55",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Signup

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/login/signup`](https://api.evitalrx.in/v1/patient/login/signup)

Register the Patient in the system.&#x20;

#### Request Body

| Name                                        | Type   | Description                                                     |           |                                                                                                       |
| ------------------------------------------- | ------ | --------------------------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>    | String | Authentication token                                            |           |                                                                                                       |
| mobile<mark style="color:red;">\*</mark>    | String | Mobile number of Patient                                        |           |                                                                                                       |
| firstname<mark style="color:red;">\*</mark> | String | First name of Patient                                           |           |                                                                                                       |
| lastname                                    | String | Last name of Patient                                            |           |                                                                                                       |
| otp<mark style="color:red;">\*</mark>       | String | Verification OTP sent to customer mobile in Signup send OTP API |           |                                                                                                       |
| password<mark style="color:red;">\*</mark>  | String | Password set by patient                                         |           |                                                                                                       |
| os                                          | String | <p>"web"                                                        | "android" | "ios"</p><p></p><p>default: "android"</p><p></p><p>Operating system of mobile patients are using.</p> |
| zipcode                                     | String | <p>Length: 6</p><p></p><p>Patient's pincode</p>                 |           |                                                                                                       |

{% tabs %}
{% tab title="200 OTP send successfully." %}

```json
{
    "status_code": "1",
    "status_message": "Registered Successfully",
    "datetime": "2023-10-27 18:17:36",
    "data": {
        "profile_picture": "https://d1tu4pmhr82np8.cloudfront.net/storage/users/placeholder_a.png",
        "patient_id": "+FEWdxQs/6ciAyINkc430A==", // Unique ID of the Patient
        "firstname": "Aman",
        "lastname": "Shukla",
        "mobile": "9033071756",
        "patient_code": "P0001P3",
        "status": "active",
        "zipcode": "380008"
    }
}
```

{% endtab %}

{% tab title="200: OK Patient already exists, kindly login." %}

```json
{
    "status_code": "0",
    "status_message": "This Mobile is already exist.",
    "datetime": "2023-10-27 18:18:19",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "mobile length must be at least 10 characters long",
    "datetime": "2023-10-27 18:18:36",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Login

Login with mobile & password

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/login`](https://api.evitalrx.in/v1/patient/login)

#### Request Body

| Name                                       | Type   | Description          |
| ------------------------------------------ | ------ | -------------------- |
| apikey<mark style="color:red;">\*</mark>   | String | Authentication token |
| mobile<mark style="color:red;">\*</mark>   | String | Patient's mobile     |
| password<mark style="color:red;">\*</mark> | String | Patient's password   |

{% tabs %}
{% tab title="200 Logged In Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Logged In Successfully",
    "datetime": "2023-10-27 18:19:12",
    "data": {
        "patient_id": "8aBVYpYlBc13aSmG4vTJTQ==",
        "status": "active",
        "accesstoken": "vTjMEeTh3ZOMFEPp",
        "profile_picture": "https://d1tu4pmhr82np8.cloudfront.net/storage/users/placeholder_a.png",
        "firstname": "Aman",
        "lastname": "Shukla",
        "patient_code": "P0001P0",
        "zipcode": "380008"
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid Mobile or Password.",
    "datetime": "2023-10-27 18:21:50",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Forgot password send OTP

This API sends verification code to register mobile number to reset password.

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/login/forgotpassword_sendotp`](https://api.evitalrx.in/v1/patient/login/forgotpassword_sendotp)

#### Request Body

| Name                                     | Type   | Description                 |
| ---------------------------------------- | ------ | --------------------------- |
| apikey<mark style="color:red;">\*</mark> | String | Authentication token        |
| mobile<mark style="color:red;">\*</mark> | String | Patient's registered mobile |

{% tabs %}
{% tab title="200 OTP sent successfully" %}

```json
{
    "status_code": "1",
    "status_message": "OTP sent successfully to your mobile number",
    "datetime": "2023-10-27 18:25:19",
    "data": 1
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "mobile length must be at least 10 characters long",
    "datetime": "2023-10-27 18:25:47",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Reset password

To reset password with mobile OTP

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/login/reset_password`](https://api.evitalrx.in/v1/patient/login/reset_password)

#### Request Body

| Name                                       | Type   | Description                              |
| ------------------------------------------ | ------ | ---------------------------------------- |
| apikey<mark style="color:red;">\*</mark>   | String | Authentication token                     |
| mobile<mark style="color:red;">\*</mark>   | Number | Patient's registered mobile              |
| otp<mark style="color:red;">\*</mark>      | String | OTP sent in Forget password send OTP API |
| password<mark style="color:red;">\*</mark> | String | New password                             |

{% tabs %}
{% tab title="200: OK Password Updated Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Password Updated Successfully",
    "datetime": "2023-10-27 18:35:45",
    "data": 1
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid OTP",
    "datetime": "2023-10-27 18:34:13",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Change password

To change password

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/login/change_password`](https://api.evitalrx.in/v1/patient/login/change_password)

#### Request Body

| Name                                            | Type   | Description          |
| ----------------------------------------------- | ------ | -------------------- |
| apikey<mark style="color:red;">\*</mark>        | String | Authentication token |
| patient\_id<mark style="color:red;">\*</mark>   | String | Unique ID of patient |
| new\_password<mark style="color:red;">\*</mark> | String | New password         |
| old\_password<mark style="color:red;">\*</mark> | String | Existing password    |

{% tabs %}
{% tab title="200: OK Password Updated Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Password Updated Successfully",
    "datetime": "2023-10-27 18:35:45",
    "data": 1
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Old Password is Incorrect",
    "datetime": "2023-10-27 20:11:05",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Patients

APIs for addupdate and list patients.

**Watch a video.**

{% embed url="<https://www.loom.com/share/b3a7c660652e4eecb7f8eba67517d93c>" %}

{% embed url="<https://www.loom.com/share/c77fbcb08e064700a2b4d12fc2981967>" %}


# Add Patient

To add patients with mobile number, name and address.

### &#x20;<img src="https://static.vecteezy.com/system/resources/thumbnails/018/930/572/small/youtube-logo-youtube-icon-transparent-free-png.png" alt="" data-size="line"> [Learn How to Add a Patient or Family Member](https://youtu.be/voc4bcyhZ_8?si=Nf_SpvsQX9vVo26v)

### Add Patient

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/patients/add`](https://api.evitalrx.in/v1/patient/patients/add)

#### Request Body

| Name                                          | Type   | Description                                                                                                                               |
| --------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>      | String | Authentication token                                                                                                                      |
| zipcode                                       | Number | Zip code of the Patient                                                                                                                   |
| mobile<mark style="color:red;">\*</mark>      | String | Mobile number of Patient                                                                                                                  |
| first\_name<mark style="color:red;">\*</mark> | String | First name of Patient                                                                                                                     |
| last\_name                                    | String | Last name of Patient                                                                                                                      |
| dob                                           | String | <p>Date of Birth of the Patient</p><p>Format: YYYY-MM-DD</p>                                                                              |
| gender                                        | String | <p>Gender of the Patient.</p><p>Must be one of <strong>male, female, other</strong>.</p>                                                  |
| blood\_group                                  | String | Blood Group of the Patient                                                                                                                |
| custom\_fields                                | Object | <p>Key value pairs of attribute\_key and it's value.<br>For ex:<br>{"patient\_ipd\_id": "IPD1234", "patient\_mapped\_id": "PMID9876"}</p> |

{% tabs %}
{% tab title="200 Patient added successfully." %}

```json
{
    "status_code": "1",
    "status_message": "Patient registered successfully.",
    "datetime": "2022-12-06 18:07:04",
    "data": {
        "patient_id": "qAj4hhwefVxwuZX9nFxHkQ==" // Unique Patient ID
    }
}
```

{% endtab %}

{% tab title="200: OK Patient added Failed" %}

```
{
    "status_code": "0",
    "status_message": "This Mobile is already exist.",
    "datetime": "2022-12-07 12:23:41",
    "data": {
        "patient_id": "qAj4hhwefVxwuZX9nFxHkQ=="
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Please enter valid zipcode",
    "datetime": "2022-12-06 18:09:55",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Update Patient

To add patients with mobile number, name and address.

## Update Patient &#x20;

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/patients/update`](https://api.evitalrx.in/v1/patient/patients/update)

#### Request Body

| Name                                          | Type   | Description                                                                              |
| --------------------------------------------- | ------ | ---------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>      | String | Authentication token                                                                     |
| zipcode                                       | Number | Zip code of the Patient                                                                  |
| first\_name<mark style="color:red;">\*</mark> | String | First name of Patient                                                                    |
| last\_name<mark style="color:red;">\*</mark>  | String | Last name of Patient                                                                     |
| dob                                           | String | <p>Date of Birth of the Patient</p><p>Format: YYYY-MM-DD</p>                             |
| gender                                        | String | <p>Gender of the Patient.</p><p>Must be one of <strong>male, female, other</strong>.</p> |
| blood\_group                                  | String | Blood Group of the Patient                                                               |
| patient\_id<mark style="color:red;">\*</mark> | String | Unique ID of Patient                                                                     |

{% tabs %}
{% tab title="200 Patient updated successfully." %}

```
{
    "status_code": "1",
    "status_message": "Patient updated successfully",
    "datetime": "2022-12-06 18:29:42",
    "data": {
        "patient_id": "qAj4hhwefVxwuZX9nFxHkQ=="
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid Patient Key",
    "datetime": "2022-12-06 18:32:59",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Get Patient

To get the patient details

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/patients/view`](https://api.evitalrx.in/v1/patient/patients/view)

#### Request Body <a href="#request-body" id="request-body"></a>

| Name                                          | Type   | Description                                    |
| --------------------------------------------- | ------ | ---------------------------------------------- |
| patient\_id<mark style="color:red;">\*</mark> | String | Unique id of the Patient                       |
| apikey<mark style="color:red;">\*</mark>      | String | Authentication token                           |
| mobile<mark style="color:red;">\*</mark>      | String | Either patient\_id or mobile should be passed. |

{% tabs %}
{% tab title="200 Patient details retrieved successfully." %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-06 18:11:54",
    "data": [
        {
            "firstname": "Manav",
            "lastname": "Patel",
            "zipcode": "380008",
            "mobile": "9787998785",
            "patient_id": "qAj4hhwefVxwuZX9nFxHkQ==",
            "custom_fields": { // addtional fields related to patients
                "patient_ipd_id": "IPD1234",
                "patient_mapped_id": "PMID9876"
            }
        }
    ]
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "\"patient_id\" is required",
    "datetime": "2022-12-06 18:12:45",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Add Patient family member

To add family member of the patient

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/patients/add_family_member`](https://api.evitalrx.in/v1/patient/patients/add_family_member)

#### Request Body

| Name                                                      | Type   | Description                                                                                                                                                                                                                                        |
| --------------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>                  | String | Authentication token                                                                                                                                                                                                                               |
| mobile                                                    | Number | Mobile number of Patient's family member                                                                                                                                                                                                           |
| first\_name<mark style="color:red;">\*</mark>             | String | First name of Patient's family member                                                                                                                                                                                                              |
| last\_name<mark style="color:red;">\*</mark>              | String | Last name of Patient's family member                                                                                                                                                                                                               |
| dob<mark style="color:red;">\*</mark>                     | String | <p>Date of Birth of the Patient</p><p>Format: YYYY-MM-DD</p>                                                                                                                                                                                       |
| patient\_id<mark style="color:red;">\*</mark>             | String | Key of the Patient whose family member is going to be added.                                                                                                                                                                                       |
| blood\_group                                              | String | Blood Group of the Patient                                                                                                                                                                                                                         |
| relation<mark style="color:red;">\*</mark>                | String | <p>Relation with the Parent Patient. Possible values are: </p><p>\[ "Brother", "Sister", "Father", "Mother", "Son", "Daughter", "Grand\_Father", "Grand\_Mother", "Uncle", "Aunt", "Wife", "Husband", "Grand\_Daughter", "Grand\_Son" ]</p><p></p> |
| parent\_patient\_mobile<mark style="color:red;">\*</mark> | String | Either pass the Parent patient's Mobile Or Patient ID                                                                                                                                                                                              |

{% tabs %}
{% tab title="200 Patient added successfully." %}

```json
{
    "status_code": "1",
    "status_message": "Family member added successfully",
    "datetime": "2022-12-23 11:36:23",
    "data": {
        "relation": "Brother", // relation with the patient
        "firstname": "Manav",
        "lastname": "Chauhan",
        "mobile": "",
        "patient_family_member_id": "jtyjX7EP2GPrTdF+bFGBww==",
        "blood_group": "B+",
        "dob": "2001-10-14",
        "id": "m3nc908treoPV7VLHehTAA==",
        "profile_picture": ""
    }
}
```

{% endtab %}

{% tab title="200: OK Patient added Failed" %}

```
{
    "status_code": "0",
    "status_message": "This mobile number is already exist as a patient",
    "datetime": "2022-12-23 11:39:53",
    "data": {}
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "\"first_name\" is required",
    "datetime": "2022-12-23 11:40:24",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Addresses

APIs for add/update and list addresses.

**Watch a video.**

{% embed url="<https://www.loom.com/share/212d717fae244e14810e909f4c57fe79>" %}


# List Addresses

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/addresses`](https://api.evitalrx.in/v1/patient/addresses)

#### Request Body

| Name                                          | Type   | Description          |
| --------------------------------------------- | ------ | -------------------- |
| apikey<mark style="color:red;">\*</mark>      | String | Authentication token |
| patient\_id<mark style="color:red;">\*</mark> | String | Unique ID of patient |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-10-31 10:56:17",
    "data": {
        "results": [
            {
                "id": "1NaBJ+MBG9iGjRzCHAMQkA==",
                "address_name": "home", // home or work
                "address": "Kurubarahalli",
                "address_line2": "Bengaluru, Karnataka 562162",
                "city": "Bangalore",
                "state": "Karnataka",
                "country": "India",
                "zipcode": "562130",
                "latitude": "13.002850494898789",
                "longitude": "77.52918554865722",
                "is_default": "yes", // default address
                "created_date": "2023-07-24 16:02:03",
                "updated_date": "2023-09-18 17:53:16"
            },
            {
                "id": "N2RmoMcZ4KBD61jT06Tc9w==",
                "address_name": "home",
                "address": "Cambridge Road",
                "address_line2": "Halasuru",
                "city": "Bangalore",
                "state": "Karnataka",
                "country": "India",
                "zipcode": "560008",
                "latitude": "12.9715979",
                "longitude": "77.6275356",
                "is_default": "no",
                "created_date": "2023-08-25 15:59:22",
                "updated_date": "2023-09-18 17:52:27"
            },
            {
                "id": "76M0+Kteb7onM2/zAPnnSg==",
                "address_name": "home",
                "address": "C-32, Pushpak City",
                "address_line2": "Hathijan",
                "city": "Ahmedabad",
                "state": "Gujarat",
                "country": "India",
                "zipcode": "382445",
                "latitude": "22.95148617583943",
                "longitude": "72.66486683544312",
                "is_default": "no",
                "created_date": "2023-01-11 18:30:49",
                "updated_date": "2023-09-18 17:54:19"
            }
        ]
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid Patient Key",
    "datetime": "2023-10-31 10:57:03",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Add-Update Address

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/addresses/add_update`](https://api.evitalrx.in/v1/patient/addresses/add_update)

#### Request Body

| Name                                            | Type   | Description                                                                                                                                                                 |                                              |
| ----------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>        | String | Authentication token                                                                                                                                                        |                                              |
| patient\_id<mark style="color:red;">\*</mark>   | String | Unique ID of patient                                                                                                                                                        |                                              |
| address\_name<mark style="color:red;">\*</mark> | String | <p>Valid Values: "home"                                                                                                                                                     | "work" </p><p></p><p>Address type</p><p></p> |
| address\_id                                     | String | <p>Unique ID of address, If provided, it will update the address associated with this ID. </p><p></p><p>If this ID is not provided, then new address will be inserted. </p> |                                              |
| address<mark style="color:red;">\*</mark>       | String | Address of the patient                                                                                                                                                      |                                              |
| address\_line2                                  | String | Area, street or Landmark of the patient address.                                                                                                                            |                                              |
| city                                            | String | City of the patient                                                                                                                                                         |                                              |
| state                                           | String | State of the patient                                                                                                                                                        |                                              |
| zipcode                                         | String | Pincode of the patient's address.                                                                                                                                           |                                              |
| latitude                                        | Number | GPS co-ordinate of the patient's address.                                                                                                                                   |                                              |
| longitude                                       | Number | GPS co-ordinate of the patient's address.                                                                                                                                   |                                              |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Address updated successfully",
    "datetime": "2023-10-31 11:50:05",
    "data": {
        "address_name": "home",
        "address": "Kurubarahalli",
        "address_line2": "Bengaluru, Karnataka 562162",
        "city": "Bangalore",
        "state": "Karnataka",
        "country": "India",
        "zipcode": "562130",
        "latitude": "11",
        "longitude": "72",
        "is_default": "no",
        "id": "r6ISwkWxJLDDhxprrJ0D8w==" // Unique Address ID
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid Patient Key",
    "datetime": "2023-10-31 10:57:03",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Set Default Address

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/addresses/set_default`](https://api.evitalrx.in/v1/patient/addresses/set_default)

#### Request Body

| Name                                          | Type   | Description          |
| --------------------------------------------- | ------ | -------------------- |
| apikey<mark style="color:red;">\*</mark>      | String | Authentication token |
| patient\_id<mark style="color:red;">\*</mark> | String | Unique ID of patient |
| address\_id<mark style="color:red;">\*</mark> | String | Unique ID of address |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Set as Default successfully",
    "datetime": "2023-10-31 11:55:36",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid Patient Key",
    "datetime": "2023-10-31 10:57:03",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Delete Address

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/addresses/delete`](https://api.evitalrx.in/v1/patient/addresses/delete)

#### Request Body

| Name                                          | Type   | Description          |
| --------------------------------------------- | ------ | -------------------- |
| apikey<mark style="color:red;">\*</mark>      | String | Authentication token |
| patient\_id<mark style="color:red;">\*</mark> | String | Unique ID of patient |
| address\_id<mark style="color:red;">\*</mark> | String | Unique ID of address |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Address deleted successfully",
    "datetime": "2023-10-31 12:16:39",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid Patient Key",
    "datetime": "2023-10-31 10:57:03",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Medicines

APIs for medicines.

**Watch a demo.**

{% embed url="<https://www.loom.com/share/44f82a02bce14e5c9aea66966ce66f42>" %}


# Search Products

To search items with the Item Name (string), GTIN number of the product, or Salt-Composition(content).

#### [Explore Medicines Available in Staging](/getting-started-with-evitalrx#explore-medicines-available-in-staging)

## Search Products

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/medicines/search`](https://api.evitalrx.in/v1/patient/medicines/search)

If the Item is present in your inventory, then it will appear first.

#### Request Body

| Name                                           | Type    | Description                                                                                                                                                                                                                                                                       |                                        |                                          |
| ---------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | ---------------------------------------- |
| searchstring<mark style="color:red;">\*</mark> | String  | <p>Search String input</p><p>It can be used in following ways.</p><p>By Item Name</p><p><code>"searchstring":"dolo"</code></p><p></p><p>By Content</p><p><code>"searchstring":"c,paraceta"</code></p><p></p><p>By GTIN Number</p><p><code>"searchstring":"89080034169"</code></p> |                                        |                                          |
| apikey<mark style="color:red;">\*</mark>       | String  | Authentication token                                                                                                                                                                                                                                                              |                                        |                                          |
| show\_sale\_rate                               | yes\|no | <p>To show the medicines on discounted rate. </p><p></p><p>yes                                                                                                                                                                                                                    | price = mrp - discount</p><p></p><p>no | price = mrp</p><p></p><p>Default: no</p> |

{% tabs %}
{% tab title="200 Products Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-06 17:49:55",
    "data": {
        "did_you_mean_result": [], // if medicine not found then suggestions
        "result": [
            {
                "dosage_type": "",
                "medicine_name": "LTK-H Tablet 5",
                "content": "",
                "mrp": 24,
                "price": "32.9",
                "medicine_id": "otUfMtG4nIpWSc+oWoX7Lw==",
                "packing_size": "1 Strip of  15 Tablet",
                "size": "15",
                "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
                "medicine_type": "otc",
                "gst_percentage": "12",
                "available_for_patient": "yes",
                "discontinued": "no",
                "loose_quantity": 1305,
                "sale_discount": 0,
                "strip_quantity": 87,
                "is_inventory_available": "yes",
                "sell_in_loose": "yes"
            },
            {
                "dosage_type": "",
                "medicine_name": "Ltk 50 Tablet",
                "content": "Losartan (50mg)",
                "mrp": 115,
                "price": "23.5",
                "medicine_id": "ZnsQl586DmR/ANT3aLdM4g==",
                "packing_size": "10 tablets in 1 strip",
                "size": "10",
                "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
                "medicine_type": "drug",
                "gst_percentage": "5",
                "available_for_patient": "yes",
                "discontinued": "no",
                "loose_quantity": 100,
                "sale_discount": 0,
                "strip_quantity": 10,
                "is_inventory_available": "yes",
                "sell_in_loose": "yes"
            }
        ]
    }
}
```

{% endtab %}

{% tab title="200: OK No Products found" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-06 15:21:25",
    "data": {
        "did_you_mean_result": [],
        "result": []
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "\"Medicine Name\" length must be less than or equal to 20 characters long",
    "datetime": "2022-12-06 15:19:58",
    "data": null
}
```

{% endtab %}
{% endtabs %}

**List of available medicines in the staging environment:**

{% file src="/files/wHF4xVvM8zOXodnTUPT7" %}


# Search Manufacturer

To search manufacturer by name.

## Search Manufacturer

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/medicines/manufacturer/search`](https://api.evitalrx.in/v1/patient/medicines/manufacturer/search)

#### Request Body

| Name                                           | Type   | Description                     |
| ---------------------------------------------- | ------ | ------------------------------- |
| apikey<mark style="color:red;">\*</mark>       | String | Authentication token            |
| searchstring<mark style="color:red;">\*</mark> | String | Min: 3 char required i.e. Cipla |

{% tabs %}
{% tab title="200 Records Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2024-04-27 10:51:14",
    "data": {
        "results": [
            {
                "id": "YDyrP7SQyRGUkTN1WEwkDA==", // Unique ID of the Manufacturer
                "title": "Cipla Ganric"
            },
            {
                "id": "+QFIphi6M09I9yDfowOCDQ==",
                "title": "Cipla Ltd"
            }
        ]
    }
}

```

{% endtab %}

{% tab title="200: OK No Products found" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-06 15:21:25",
    "data": {
        "results": []
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "\"searchstring\" length must be greater than or equal to 3 characters long",
    "datetime": "2022-12-06 15:19:58",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Product Details

To get item details in your inventory by unique medicine Id.

## Product Details

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/medicines/view`](https://api.evitalrx.in/v1/patient/medicines/view)

#### Request Body

| Name                                           | Type    | Description                                                                                                                                                                                                                                                                                                           |                                        |                                          |
| ---------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | ---------------------------------------- |
| apikey<mark style="color:red;">\*</mark>       | String  | Authentication Token                                                                                                                                                                                                                                                                                                  |                                        |                                          |
| medicine\_id<mark style="color:red;">\*</mark> | String  | Unique id of the product                                                                                                                                                                                                                                                                                              |                                        |                                          |
| medicine\_ids                                  | String  | <p>Stringified Array of medicine\_ids.</p><p></p><p><strong>medicine\_id</strong> param is optional, if <strong>medicine\_ids</strong> param is passed.</p><p></p><p>medicine\_ids should contain at least 2 medicine\_ids.</p><p></p><p>Example:</p><p>\["z5s5a+e/Cj4ip7sUl2zJFQ==", "otUfMtG4nIpWSc+oWoX7Lw=="]</p> |                                        |                                          |
| show\_sale\_rate                               | yes\|no | <p>To show the medicines on discounted rate. </p><p></p><p>yes                                                                                                                                                                                                                                                        | price = mrp - discount</p><p></p><p>no | price = mrp</p><p></p><p>Default: no</p> |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-03-09 19:01:02",
    "data": [
        {
            "content": "Losartan (50mg)",
            "how_medicine_works": "Ltk 50 Tablet is an angiotensin receptor blocker (ARB). It relaxes blood vessel by blocking the action of a chemical that usually makes blood vessels tighter. This lowers the blood pressure, allowing the blood to flow more smoothly to different organs and the heart to pump more efficiently.",
            "how_to_use": "Take this medicine in the dose and duration as advised by your doctor. Swallow it as a whole. Do not chew, crush or break it. Ltk 50 Tablet may be taken with or without food, but it is better to take it at a fixed time.",
            "id": "y8P5ElKQqfn/Dkb0uhE9Sg==", // medicine_id
            "medicine_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/default.jpg",
            "is_rx_required": 0,
            "dosage_type": "tablet",
            "medicine_name": "Ltk 50 Tablet",
            "mrp": 23.5,
            "packing_size": "1 Strip of  10 Tablet",
            "pack_size": "10 Tablet",
            "packing": "Strip",
            "size": 10,
            "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
            "side_effects": " Common   Dizziness  Back pain  Sinus inflammation  Increased potassium level in blood  ",
            "medicine_category": "drug",
            "loose_quantity": 1022,
            "sale_discount": 15,
            "strip_quantity": 102,
            "is_inventory_available": "yes",
            "price": 23.5,
            "sell_in_loose": "yes",
            "warning_details": [
                {
                    "liver": "Ltk 50 Tablet should be used with caution in patients with liver disease. Dose adjustment of Ltk 50 Tablet may be needed. Please consult your doctor.<br>Use of Ltk 50 Tablet is not recommended in patients with severe liver disease."
                },
                {
                    "alcohol": "Taking Losartan with alcohol may excessively lower the blood pressure."
                },
                {
                    "driving": "It is not known whether Ltk 50 Tablet alters the ability to drive. Do not drive if you experience any symptoms that affect your ability to concentrate and react."
                },
                {
                    "kidney": "Ltk 50 Tablet is safe to use in patients with kidney disease. No dose adjustment of Ltk 50 Tablet is recommended.<br>However, talk to your doctor if you have any underlying kidney disease. Regular monitoring of blood pressure is recommended for better dose adjustment."
                },
                {
                    "lactation": "Ltk 50 Tablet is probably safe to use during lactation.  Limited human data suggests that the drug does not represent a significant risk to the baby."
                },
                {
                    "pregnancy": "Ltk 50 Tablet is unsafe to use during pregnancy.<br>There is positive evidence of human fetal risk, but the benefits from use in pregnant women may be acceptable despite the risk, for example in life-threatening situations. Please consult your doctor."
                }
            ],
            "salt_content_id": "KOKzk7o+BiY7KaYIIL5JDg=="
        }
    ]
}
```

{% endtab %}

{% tab title="200: OK No Product found according to request params" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid medicine key",
    "datetime": "2022-12-06 16:42:59",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK Multiple Medicines" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-03-09 19:02:40",
    "data": [
        {
            "content": "Hydrochlorothiazide (12.5mg) + Losartan (50mg)",
            "how_medicine_works": "LTK-H Tablet is a combination of two medicines: Losartan and Hydrochlorothiazide, which lowers the blood pressure effectively. Losartan is an angiotensin receptor blocker (ARB). It works by blocking the hormone angiotensin thereby relaxing blood vessels. This allows the blood to flow more smoothly and the heart to pump more efficiently. Hydrochlorothiazide is a diuretic that removes extra water and certain electrolytes from the body. Over time it also relaxes blood vessels and improves blood flow.",
            "how_to_use": "Take this medicine in the dose and duration as advised by your doctor. Swallow it as a whole. Do not chew, crush or break it. LTK-H Tablet may be taken with or without food, but it is better to take it at a fixed time.",
            "id": "vjalpzMV0E33BLwzzLR6fQ==",
            "medicine_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/default.jpg",
            "is_rx_required": 1,
            "dosage_type": "tablet",
            "medicine_name": "LTK-H Tablet",
            "mrp": 36.1,
            "packing_size": "1 Strip of  10 Tablet",
            "pack_size": "10 Tablet",
            "packing": "Strip",
            "size": 10,
            "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
            "side_effects": " Common   Nausea  Taste change  Stomach upset  Diarrhea  Headache  Dizziness  Weakness  Decreased blood pressure  Increased blood uric acid  Increased blood lipid level  Glucose intolerance  Electrolyte imbalance  ",
            "medicine_category": "drug",
            "loose_quantity": 344,
            "sale_discount": 0,
            "strip_quantity": 34,
            "is_inventory_available": "yes",
            "price": 36.1,
            "sell_in_loose": "yes",
            "warning_details": [
                {
                    "liver": "LTK-H Tablet should be used with caution in patients with liver disease. Dose adjustment of LTK-H Tablet may be needed. Please consult your doctor."
                },
                {
                    "alcohol": "Taking Hydrochlorothiazide with alcohol may have additive effects in lowering blood pressure. You may experience headache, dizziness, lightheadedness, fainting, and/or changes in pulse or heart rate."
                },
                {
                    "driving": "LTK-H Tablet may make you feel dizzy, sleepy, tired, or decrease alertness. If this happens, do not drive."
                },
                {
                    "kidney": "LTK-H Tablet should be used with caution in patients with severe kidney disease. Dose adjustment of LTK-H Tablet may be needed. Please consult your doctor.<br>Use of LTK-H Tablet is not recommended in patients with severe kidney disease."
                },
                {
                    "lactation": "LTK-H Tablet is probably safe to use during lactation.  Limited human data suggests that the drug does not represent a significant risk to the baby."
                },
                {
                    "pregnancy": "LTK-H Tablet is unsafe to use during pregnancy.<br>There is positive evidence of human fetal risk, but the benefits from use in pregnant women may be acceptable despite the risk, for example in life-threatening situations. Please consult your doctor."
                }
            ],
            "salt_content_id": "KOKzk7o+BiY7KaYIIL5JDg=="
        },
        {
            "content": "Losartan (50mg)",
            "how_medicine_works": "Ltk 50 Tablet is an angiotensin receptor blocker (ARB). It relaxes blood vessel by blocking the action of a chemical that usually makes blood vessels tighter. This lowers the blood pressure, allowing the blood to flow more smoothly to different organs and the heart to pump more efficiently.",
            "how_to_use": "Take this medicine in the dose and duration as advised by your doctor. Swallow it as a whole. Do not chew, crush or break it. Ltk 50 Tablet may be taken with or without food, but it is better to take it at a fixed time.",
            "id": "y8P5ElKQqfn/Dkb0uhE9Sg==",
            "medicine_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/default.jpg",
            "is_rx_required": 0,
            "dosage_type": "tablet",
            "medicine_name": "Ltk 50 Tablet",
            "mrp": 23.5,
            "packing_size": "1 Strip of  10 Tablet",
            "pack_size": "10 Tablet",
            "packing": "Strip",
            "size": 10,
            "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
            "side_effects": " Common   Dizziness  Back pain  Sinus inflammation  Increased potassium level in blood  ",
            "medicine_category": "drug",
            "loose_quantity": 1022,
            "sale_discount": 15,
            "strip_quantity": 102,
            "is_inventory_available": "yes",
            "price": 23.5,
            "sell_in_loose": "yes",
            "warning_details": [
                {
                    "liver": "Ltk 50 Tablet should be used with caution in patients with liver disease. Dose adjustment of Ltk 50 Tablet may be needed. Please consult your doctor.<br>Use of Ltk 50 Tablet is not recommended in patients with severe liver disease."
                },
                {
                    "alcohol": "Taking Losartan with alcohol may excessively lower the blood pressure."
                },
                {
                    "driving": "It is not known whether Ltk 50 Tablet alters the ability to drive. Do not drive if you experience any symptoms that affect your ability to concentrate and react."
                },
                {
                    "kidney": "Ltk 50 Tablet is safe to use in patients with kidney disease. No dose adjustment of Ltk 50 Tablet is recommended.<br>However, talk to your doctor if you have any underlying kidney disease. Regular monitoring of blood pressure is recommended for better dose adjustment."
                },
                {
                    "lactation": "Ltk 50 Tablet is probably safe to use during lactation.  Limited human data suggests that the drug does not represent a significant risk to the baby."
                },
                {
                    "pregnancy": "Ltk 50 Tablet is unsafe to use during pregnancy.<br>There is positive evidence of human fetal risk, but the benefits from use in pregnant women may be acceptable despite the risk, for example in life-threatening situations. Please consult your doctor."
                }
            ],
            "salt_content_id": "KOKzk7o+BiY7KaYIIL5JDg=="
        }
    ]
}
```

{% endtab %}
{% endtabs %}


# Get Stock details

To get item details in your inventory by unique medicine Id.

### <img src="https://static.vecteezy.com/system/resources/thumbnails/018/930/572/small/youtube-logo-youtube-icon-transparent-free-png.png" alt="" data-size="line"> [Before Fetching Stock Details, Add Medicines to Your Inventory](https://youtu.be/v29o6YEsocc?si=WM0nJ2BmAuye7tNE)

### Product Details

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/medicines/get_inventory_status`](https://api.evitalrx.in/v1/patient/medicines/get_inventory_status)

#### Request Body

| Name                                     | Type   | Description                                                                                                                                                                                          |
| ---------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark> | String | Authentication Token                                                                                                                                                                                 |
| medicine\_ids\*                          | String | <p>Stringified Array of medicine\_ids.</p><p></p><p>medicine\_ids should contain at least 1 medicine\_ids.</p><p></p><p>Example:</p><p>\["z5s5a+e/Cj4ip7sUl2zJFQ==", "otUfMtG4nIpWSc+oWoX7Lw=="]</p> |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
  "status_code": "1",
  "status_message": "Success",
  "datetime": "2024-04-25 12:53:46",
  "data": {
    "results": [
      {
        "medicine_id": "TF7Wm49nceLV+NmoM6HJYw==",
        "loose_quantity": 2010,   // quantity at parent chemist or HO
        "strip_quantity": 201,
        "availability": [
          {
            "chemist_id": "qgOgKbBh6UrMJfLyTMtEOw==",
            "chemist_code": "C0065",
            "loose_quantity": 1158,  // quantity at child chemist or Branch
            "strip_quantity": 115
          },
          {
            "chemist_id": "Rzraa93BrrDK9KEVXmPHEQ==",
            "chemist_code": "C0065",
            "loose_quantity": 1160,
            "strip_quantity": 116
          },
          {
            "chemist_id": "M3FvgrgA14Rr2SGTeY7Icw==",
            "chemist_code": "C0065",
            "loose_quantity": 1980,
            "strip_quantity": 198
          },
          {
            "chemist_id": "81PuG89qeGla7moarByvUA==",
            "chemist_code": "C0065",
            "loose_quantity": 1000,
            "strip_quantity": 100
          },
          {
            "chemist_id": "4mtv5aog/Bi0+0q7IsEcRg==",
            "chemist_code": "C0065",
            "loose_quantity": 100,
            "strip_quantity": 10
          }
        ]
      },
      {
        "medicine_id": "iLlokdPAdebp7RYKR5WpnQ==",
        "loose_quantity": 20,
        "strip_quantity": 2,
        "availability": []
      },
      {
        "medicine_id": "M6rdmJ2RYkfkgk+6tEtJmg==",
        "loose_quantity": 1,
        "strip_quantity": 1,
        "availability": []
      }
    ]
  }
}
```

{% endtab %}

{% tab title="200: OK No Product found according to request params" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid medicine key",
    "datetime": "2022-12-06 16:42:59",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Get Product Batch

To get item batches in your inventory by unique medicine Id.

## Product Batches

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/medicines/search_medicine_by_batch`](https://api.evitalrx.in/v1/patient/medicines/search_medicine_by_batch)

Get Product Batches available in your inventory by Medicine Key.

#### Request Body

| Name                                           | Type   | Description                                                                                                             |
| ---------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>       | String | Authentication Token                                                                                                    |
| medicine\_id<mark style="color:red;">\*</mark> | String | Unique id of the Product                                                                                                |
| batch\_name                                    | String | <p>Batch Name of the Product. </p><p></p><p>If batch\_name is provided, then only that batch information will come.</p> |

{% tabs %}
{% tab title="200: OK Batches Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-06-05 14:10:19",
    "data": [
        {
            "medicine_id": "buuFcMkpKTXqj7rxexDKew==",
            "id": "ApDrCEwcuRDrKJbu5dD5ww==", // Uniuqe ID of Batch
            "batch": "BG015",
            "expiry": "2024-05-01",
            "mrp": 30.91,
            "price_to_retailer": 18,
            "quantity": 185,
            "cess_percentage": 0,
            "gst_percentage": 5,
            "margin": 10.75,
            "landing_price": 19.86,
            "expiry_label": "05/24",
            "margin_amount": 11.05,
            "margin_percentage": 35.75
        }
    ]
}
```

{% endtab %}

{% tab title="200: OK No Batches found" %}

```json
{
    "status_code": "0",
    "status_message": "No batches found for medicine",
    "datetime": "2022-12-07 11:23:46",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid medicine key",
    "datetime": "2022-12-07 11:24:25",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Search Content

To search content

## Search Contents

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/medicines/content_search`](https://api.evitalrx.in/v1/patient/medicines/content_search)

#### Request Body

| Name                                      | Type   | Description             |
| ----------------------------------------- | ------ | ----------------------- |
| content<mark style="color:red;">\*</mark> | String | Content to be searched. |
| apikey<mark style="color:red;">\*</mark>  | String | Authentication token    |

{% tabs %}
{% tab title="200 Products Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-05-15 18:54:34",
    "data": {
        "results": [
            {
                "content": "Paradichlorobenzene (4gm)", // Content from product details response
                "id": "TmOVsxtb5BlFs4px88ReRQ==" // Unique ID of the Content
            },
            {
                "content": "Paradichlorobenzene (162.5mg)",
                "id": "c7OJPXkeXCg/8pa130GbTg=="
            },
            {
                "content": "Paradichlorobenzene (320mg)",
                "id": "VcelI1X0zp2urnxD6sbnJw=="
            },
            {
                "content": "Propyl Paraben (180mcg)",
                "id": "vY/1wcav8EcVHA0otFK67Q=="
            },
            {
                "content": "Propyl Paraben (850.0mg)",
                "id": "0K50lD2ZYe6ZCitNDtfJZQ=="
            },
            {
                "content": "Paradichlorobenzene (0.38%w/w)",
                "id": "+Du4PAgn4slRMnpBsqaYPw=="
            },
            {
                "content": "Para Amino Benzoic Acid (500mg)",
                "id": "Ez+RTplCJoRJpyEHzxaAPQ=="
            },
            {
                "content": "Propyl Paraben (1.5gm)",
                "id": "6UPouwJuJnDVRDEHz5Zjyw=="
            },
            {
                "content": "Propyl Paraben (600000iu)",
                "id": "TRTCy6rIpJjr3JprQmITZA=="
            },
            {
                "content": "Propyl Paraben (0.31mg)",
                "id": "I3XKPhvcLdUgojwrUhlMuw=="
            }
        ]
    }
}
```

{% endtab %}

{% tab title="200: OK No Products found" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-05-15 18:54:46",
    "data": {
        "results": []
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "content is required",
    "datetime": "2023-05-15 18:54:59",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Branded to Generic

To get alternate products by unique medicine Id.

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/medicines/branded_to_generic`](https://api.evitalrx.in/v1/patient/medicines/branded_to_generic)

Get Alternate medicines with the best in terms of Expiry, Margin, and Price.

#### Request Body

| Name                                            | Type              | Description                                                                                                                                                                                                                   |
| ----------------------------------------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>        | String            | Authentication Token                                                                                                                                                                                                          |
| medicine\_ids<mark style="color:red;">\*</mark> | Stringified Array | <p>Array of medicine\_ids in the form data</p><p></p><p>\["eGMwtMdst4OkfNrNoAFxRw",  "77eruTI3h1JUg4RqaV20JQ=="]</p>                                                                                                          |
| order\_by                                       | String            | <p>must be one of <strong>epm, mep, pem</strong></p><p></p><p><strong>epm</strong>: Expiry -> Price -> Margin</p><p><strong>mep</strong>: Margin -> Expiry -> Price</p><p><strong>pem</strong>: Price -> Expiry -> Margin</p> |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-11-17 10:30:42",
    "data": {
        "eGMwtMdst4OkfNrNoAFxRw==": { // medicine_id
            "data": [],
            "message": "alternative not found",
            "status": 0
        },
        "77eruTI3h1JUg4RqaV20JQ==": {
            "data": [
                {
                    "mrp": 204.97,
                    "batch": "C2VAV19",
                    "expiry": "11-23",
                    "packing_size": "1 Bottle of  5 Ml",
                    "medicine_name": "Moxicip D Eye Drop",
                    "manufacturer_name": "Cipla Ltd",
                    "margin_percentage": "23.20",
                    "medicine_id": "M1AGVZYv89bWlk7/oWbG4Q=="
                }
            ],
            "message": "success",
            "status": 1
        }
    }
}
```

{% endtab %}

{% tab title="200: OK No Medicines found" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-08 16:20:45",
    "data": {
        "1iFlObGAoedKDQW27+2EQw==": {
            "data": [],
            "message": "alternative not found",
            "status": 0
        }
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid medicine key",
    "datetime": "2022-12-07 11:24:25",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Get Categories

Get the Product categories list.

## Get Categories

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/medicines/get_categories`](https://api.evitalrx.in/v1/patient/medicines/get_categories)

#### Request Body

| Name                                     | Type   | Description                                                                                                   |
| ---------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark> | String | Authentication token                                                                                          |
| searchstring                             | String | <p>If searchstring passed, it will fetch relevant categories. </p><p>Min len: 3 </p><p>Max len: 20</p><p></p> |
| page                                     | Number | Default: 1                                                                                                    |

{% tabs %}
{% tab title="200: OK Categories Retrieved Successfully" %}

```json

{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-10-03 17:34:23",
    "data": {
        "current_page": 1,
        "rpp": 5,
        "results": [
            {
                "id": "mB3b+VF0xsD9XnRkj0evHQ==", // Unique ID of the Category
                "category_name": "Personal Care",
                "category_picture": "https://d2ffmswuyj0h1d.cloudfront.net/storage/extra/cosmetic/default.jpg"
            },
            {
                "id": "x+hOdgFr9YalM4JTGrgOhg==",
                "category_name": "Fitness & Supplements",
                "category_picture": "https://d2ffmswuyj0h1d.cloudfront.net/storage/extra/cosmetic/default.jpg"
            },
            {
                "id": "ibqdoR3lz+/fQXQnibWPCA==",
                "category_name": "Health Devices",
                "category_picture": "https://d2ffmswuyj0h1d.cloudfront.net/storage/extra/cosmetic/default.jpg"
            },
            {
                "id": "q7dxGR/3f2J95UbkkQniNA==",
                "category_name": "Pet Care",
                "category_picture": "https://d2ffmswuyj0h1d.cloudfront.net/storage/extra/cosmetic/default.jpg"
            },
            {
                "id": "lCLRl5M5V0FsPEy0b37WUQ==",
                "category_name": "Healthcare Devices",
                "category_picture": "https://d2ffmswuyj0h1d.cloudfront.net/storage/extra/cosmetic/default.jpg"
            }
        ]
    }
}
```

{% endtab %}

{% tab title="200: OK Categories not found" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-10-03 17:57:39",
    "data": {
        "current_page": 1,
        "rpp": 5,
        "results": []
    }
}
```

{% endtab %}

{% tab title="200: OK Validation error" %}

```json

{
    "status_code": "0",
    "status_message": "searchstring length must be at least 3 characters long",
    "datetime": "2023-10-03 17:58:07",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Get Category Products

Get the Products of a particular category.

## Get Category Products

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/medicines/get_category_items`](https://api.evitalrx.in/v1/patient/medicines/get_category_items)

#### Request Body

| Name                                           | Type   | Description          |                                                                                                                                    |
| ---------------------------------------------- | ------ | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>       | String | Authentication token |                                                                                                                                    |
| category\_id<mark style="color:red;">\*</mark> | String | Category ID          |                                                                                                                                    |
| page                                           | Number | Default: 1           |                                                                                                                                    |
| show\_sale\_rate                               | String | <p>yes               | no</p><p></p><p>Show the product at discounted rate in price attribute, where price = MRP - Discount.</p><p></p><p>Default: no</p> |

{% tabs %}
{% tab title="200: OK Products Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2024-02-08 11:42:55",
    "data": {
        "current_page": 1,
        "rpp": 10,
        "results": [
            {
                "dosage_type": "cream",
                "salt_content_id": "",
                "medicine_name": "Parth Hair Remover Cream",
                "content": "",
                "mrp": 72,
                "medicine_id": "XtZt2tSiOXhZioJZFtbmIQ==",
                "packing_size": "1 Tube of  50 Gm",
                "size": 1,
                "manufacturer_name": "Parth Remedies",
                "medicine_type": "otc",
                "image": "https://d2ffmswuyj0h1d.cloudfront.net/storage/medicines/627b4e20dfae2.jpg",
                "is_inventory_available": "yes",
                "sale_discount": 5,
                "price": 68.4,
                "discount_percentage": 5
            },
            {
                "dosage_type": "cream",
                "salt_content_id": "",
                "medicine_name": "Pediguard Foot Care Cream",
                "content": "",
                "mrp": 85,
                "medicine_id": "PncCV8JIb+BX+U6LGgLwgA==",
                "packing_size": "1 Jar of  30 Gm",
                "size": 1,
                "manufacturer_name": "Ek-Tek Pharma",
                "medicine_type": "otc",
                "image": "https://d2ffmswuyj0h1d.cloudfront.net/storage/medicines/621c9cdeaea85.jpg",
                "is_inventory_available": "no",
                "sale_discount": null,
                "price": 85,
                "discount_percentage": 0
            },
            {
                "dosage_type": "cream",
                "salt_content_id": "",
                "medicine_name": "Olay Natural Aura Glowing Radiance Cream SPF 15",
                "content": "",
                "mrp": 399,
                "medicine_id": "hxNLBwKwDviN/suzsgQldw==",
                "packing_size": "1 Jar of  50 Gm",
                "size": 1,
                "manufacturer_name": "Procter & Gamble Hygiene and Health Care Ltd",
                "medicine_type": "otc",
                "image": "https://d2ffmswuyj0h1d.cloudfront.net/storage/medicines/62186bdce0538.jpg",
                "is_inventory_available": "no",
                "sale_discount": null,
                "price": 399,
                "discount_percentage": 0
            },
            {
                "dosage_type": "",
                "salt_content_id": "",
                "medicine_name": "Dry-Safe Eco Unisex Adult Pants XL",
                "content": "",
                "mrp": 650,
                "medicine_id": "gUsymFemV/3f93L33tdRiw==",
                "packing_size": "1 Packet of  10 Piece",
                "size": 1,
                "manufacturer_name": "Tataria Hygiene",
                "medicine_type": "otc",
                "image": "https://d2ffmswuyj0h1d.cloudfront.net/storage/medicines/6218847788a13.jpg",
                "is_inventory_available": "no",
                "sale_discount": null,
                "price": 650,
                "discount_percentage": 0
            },
            {
                "dosage_type": "powder",
                "salt_content_id": "",
                "medicine_name": "Candid Dusting Powder",
                "content": "",
                "mrp": 26.3,
                "medicine_id": "MrIBe+BRfKjBFeadWzkVMw==",
                "packing_size": "1 Bottle of  30 Gm",
                "size": 1,
                "manufacturer_name": "Glenmark Pharmaceuticals Ltd",
                "medicine_type": "otc",
                "image": "https://d2ffmswuyj0h1d.cloudfront.net/storage/medicines/62395c80da364.jpg",
                "is_inventory_available": "no",
                "sale_discount": null,
                "price": 26.3,
                "discount_percentage": 0
            },
            {
                "dosage_type": "tablet",
                "salt_content_id": "",
                "medicine_name": "Chirivilwadi Kashayam Tablet",
                "content": "",
                "mrp": 47,
                "medicine_id": "zGj3PhY/v6ahX3Oh1qLyog==",
                "packing_size": "1 Strip of  10 Tablet",
                "size": 10,
                "manufacturer_name": "Avn Ayurveda Formulations Pvt Ltd",
                "medicine_type": "otc",
                "image": "https://d2ffmswuyj0h1d.cloudfront.net/storage/medicines/6242dbcd22746.jpg",
                "is_inventory_available": "no",
                "sale_discount": null,
                "price": 47,
                "discount_percentage": 0
            },
            {
                "dosage_type": "",
                "salt_content_id": "",
                "medicine_name": "V Clean Everyday Feminine Hygiene Wash",
                "content": "",
                "mrp": 195,
                "medicine_id": "UalUHpRsQmNHqGcCfnblyg==",
                "packing_size": "1 Bottle of  100 Ml",
                "size": 1,
                "manufacturer_name": "Nukind Healthcare Pvt Ltd",
                "medicine_type": "otc",
                "image": "https://d2ffmswuyj0h1d.cloudfront.net/storage/medicines/622ef1d048b2a.jpg",
                "is_inventory_available": "no",
                "sale_discount": null,
                "price": 195,
                "discount_percentage": 0
            },
            {
                "dosage_type": "",
                "salt_content_id": "",
                "medicine_name": "Huda Beauty Wax Strips With Charcoal Extracts",
                "content": "",
                "mrp": 170,
                "medicine_id": "yBG5nH6HYTK7xW9vTuawWA==",
                "packing_size": "1 Box of  20 Piece",
                "size": 1,
                "manufacturer_name": "Huda Beauty",
                "medicine_type": "otc",
                "image": "https://d2ffmswuyj0h1d.cloudfront.net/storage/medicines/62877ae67ff4e.jpg",
                "is_inventory_available": "no",
                "sale_discount": null,
                "price": 170,
                "discount_percentage": 0
            },
            {
                "dosage_type": "",
                "salt_content_id": "",
                "medicine_name": "Pcreek Vaginal Wash",
                "content": "",
                "mrp": 165,
                "medicine_id": "epw9A/S2n6A3hl3Fzb2+qQ==",
                "packing_size": "1 Bottle of  100 Ml",
                "size": 1,
                "manufacturer_name": "Cubit Healthcare",
                "medicine_type": "otc",
                "image": "https://d2ffmswuyj0h1d.cloudfront.net/storage/medicines/6381dc5fc89c4.jpg",
                "is_inventory_available": "no",
                "sale_discount": null,
                "price": 165,
                "discount_percentage": 0
            },
            {
                "dosage_type": "cream",
                "salt_content_id": "",
                "medicine_name": "Twinkle Hair Remover Cream",
                "content": "",
                "mrp": 60,
                "medicine_id": "NjVsVtPpvjCNRIlz8wSRtg==",
                "packing_size": "1 Tube of  30 Gm",
                "size": 1,
                "manufacturer_name": "Austro Labs Ltd",
                "medicine_type": "otc",
                "image": "https://d2ffmswuyj0h1d.cloudfront.net/storage/medicines/default.jpg",
                "is_inventory_available": "no",
                "sale_discount": null,
                "price": 60,
                "discount_percentage": 0
            }
        ]
    }
}
```

{% endtab %}

{% tab title="200: OK Products not found" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-10-03 18:03:06",
    "data": {
        "current_page": 4,
        "rpp": 10,
        "results": []
    }
}
```

{% endtab %}

{% tab title="200: OK Validation error" %}

```json
{
    "status_code": "0",
    "status_message": "category_id is required",
    "datetime": "2023-10-03 18:03:24",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Get Entity Categories

Get the Product categories list.

## Get Entity Categories

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/medicines/get_entity_categories`](https://api.evitalrx.in/v1/patient/medicines/get_entity_categories)

#### Request Body

| Name                                     | Type   | Description          |
| ---------------------------------------- | ------ | -------------------- |
| apikey<mark style="color:red;">\*</mark> | String | Authentication token |

{% tabs %}
{% tab title="200: OK Categories Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-12-06 11:38:23",
    "data": {
        "results": [
            {
                "id": "BPuoYPiBInH/hiFVTaXQ3Q==", // id of Categories a entity have
                "category_name": "Ayurvedic"
            },
            {
                "id": "ptl5OssDd8T9t0WhP7Ku/A==",
                "category_name": "Cosmetic"
            },
            {
                "id": "ROA4bs2F/srPmDmekG6UWQ==",
                "category_name": "Drug"
            },
            {
                "id": "b+mbNHcQX3D95IhpKB8yfQ==",
                "category_name": "Generic"
            },
            {
                "id": "qzT86Go+4cYCJi6FS62LTg==",
                "category_name": "Nutraceuticals"
            },
            {
                "id": "ErCEsS9EooYCSZL+R+fU/g==",
                "category_name": "Otc"
            },
            {
                "id": "nLa7ultHvZaKwyETDWDYpw==",
                "category_name": "Surgical"
            }
        ]
    }
```

{% endtab %}
{% endtabs %}


# Get Entity Category Products

Get the Products of a particular category.

## Get Entity Category Products

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/medicines/get_entity_category_items`](https://api.evitalrx.in/v1/patient/medicines/get_entity_category_items)

#### Request Body

| Name                                           | Type    | Description                                                          |
| ---------------------------------------------- | ------- | -------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>       | String  | Authentication token                                                 |
| category\_id<mark style="color:red;">\*</mark> | String  | Category ID                                                          |
| page                                           | Number  | Default: 1                                                           |
| in\_stock                                      | Boolean | <p>Fetch products which quantity > 0</p><p></p><p>Default: False</p> |

{% tabs %}
{% tab title="200: OK Products Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-12-06 11:32:16",
    "data": {
        "rpp": 20,
        "page": 1,
        "results": [
            {
                "medicine_id": "eigAkZJoGSieolaaX3NQyw==",
                "medicine_name": "Abhyarishta",
                "dosage_type": "",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/default.jpg",
                "content": "",
                "mrp": 145,
                "size": 1,
                "manufacturer_name": "Dabur India Ltd",
                "packing_size": "1 Bottle of  450 Ml",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 0,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/default.jpg"
            },
            {
                "medicine_id": "tlHmYY/hZedugQ3z5HDqJg==",
                "medicine_name": "Adliv Syrup",
                "dosage_type": "syrup",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/60267df21f7f3.jpg",
                "content": "",
                "mrp": 141.47,
                "size": 1,
                "manufacturer_name": "Albert David Ltd",
                "packing_size": "1 Bottle of  200 Ml",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 2,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/60267df21f7f3.jpg"
            },
            {
                "medicine_id": "1V+aarul264irQjsWrdxKQ==",
                "medicine_name": "Amla Aloevera With Wheat Grass Juice",
                "dosage_type": "",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/default.jpg",
                "content": "",
                "mrp": 100,
                "size": 1,
                "manufacturer_name": "Patanjali Ayurved Limited",
                "packing_size": "1 Bottle of  500 Ml",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 0,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/default.jpg"
            },
            {
                "medicine_id": "kGa0jbMBLLwXE5vChNMU0Q==",
                "medicine_name": "Amla Juice",
                "dosage_type": "",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/63737ef84ba35.jpg",
                "content": "",
                "mrp": 130,
                "size": 1,
                "manufacturer_name": "Patanjali Ayurved Limited",
                "packing_size": "1 Bottle of  1 Ltr",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 1,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/63737ef84ba35.jpg"
            },
            {
                "medicine_id": "vqhY4vd+iRFVDCojGdzRAQ==",
                "medicine_name": "Amritarishta",
                "dosage_type": "syrup",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/6172a3ff68a65.jpg",
                "content": "",
                "mrp": 195,
                "size": 1,
                "manufacturer_name": "Shree Baidyanath Ayurved Bhawan Pvt Ltd",
                "packing_size": "1 Bottle of  450 Ml",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 0,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/6172a3ff68a65.jpg"
            },
            {
                "medicine_id": "t1POz3Z1zg5YFEnCq0ra5g==",
                "medicine_name": "Amritdhara",
                "dosage_type": "",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/623994706c650.jpg",
                "content": "",
                "mrp": 40,
                "size": 1,
                "manufacturer_name": "Amritdhara Pharmacy Pvt Ltd",
                "packing_size": "1 Bottle of  6 Ml",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 0,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/623994706c650.jpg"
            },
            {
                "medicine_id": "nbKM7Lz4E3vKcpUTMZjNcA==",
                "medicine_name": "Amroid Tablet",
                "dosage_type": "tablet",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/default.jpg",
                "content": "",
                "mrp": 237,
                "size": 30,
                "manufacturer_name": "Aimil Pharmaceuticals India Ltd",
                "packing_size": "1 Strip of  30 Tablet",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 60,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/default.jpg"
            },
            {
                "medicine_id": "BK3MnOw+EWsuqZKXCsRxjw==",
                "medicine_name": "Amrutanjan Advanced Back Pain Roll-ON",
                "dosage_type": "",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/64def3d405908.jpg",
                "content": "",
                "mrp": 100,
                "size": 1,
                "manufacturer_name": "Amrutanjan Health Care Ltd",
                "packing_size": "1 Bottle of  50 Ml",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 0,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/64def3d405908.jpg"
            },
            {
                "medicine_id": "pV7oEAMhNTbNPcHoGGVRFA==",
                "medicine_name": "Amrutanjan Extra Power Pain Balm",
                "dosage_type": "",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/6481896859bc5.jpg",
                "content": "",
                "mrp": 40,
                "size": 1,
                "manufacturer_name": "Amrutanjan Health Care Ltd",
                "packing_size": "1 Bottle of  8 Ml",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 0,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/6481896859bc5.jpg"
            },
            {
                "medicine_id": "6wplHt5TTl/+UDDGXQLHWQ==",
                "medicine_name": "Amyron Syrup",
                "dosage_type": "syrup",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/5fa0e59499fad.jpg",
                "content": "",
                "mrp": 198,
                "size": 1,
                "manufacturer_name": "Aimil Pharmaceuticals India Ltd",
                "packing_size": "1 Bottle of  200 Ml",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 7,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/5fa0e59499fad.jpg"
            },
            {
                "medicine_id": "r8hEggxoKadqpGmsH/mgoA==",
                "medicine_name": "Aptiheal Syrup",
                "dosage_type": "syrup",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/6374d57966790.jpg",
                "content": "",
                "mrp": 145,
                "size": 1,
                "manufacturer_name": "Vigilant Life Sciences Pvt Ltd",
                "packing_size": "1 Bottle of  200 Ml",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 1,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/6374d57966790.jpg"
            },
            {
                "medicine_id": "7epdtl6d4YmiDqXsmrVUlA==",
                "medicine_name": "Arodent Gum & Dental Paste",
                "dosage_type": "",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/617d2764cce0c.jpg",
                "content": "",
                "mrp": 223,
                "size": 1,
                "manufacturer_name": "Ipsa Labs Pvt Ltd",
                "packing_size": "1 Tube of  200 Gm",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 1,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/617d2764cce0c.jpg"
            },
            {
                "medicine_id": "WcAssStbXxQj5wwt/Hj6xA==",
                "medicine_name": "Ashokarishta",
                "dosage_type": "syrup",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/6229d29ec6c31.jpg",
                "content": "",
                "mrp": 137,
                "size": 1,
                "manufacturer_name": "Shree Baidyanath Ayurved Bhawan Pvt Ltd",
                "packing_size": "1 Bottle of  450 Ml",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 0,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/6229d29ec6c31.jpg"
            },
            {
                "medicine_id": "gLVl1BbBQmu+ZIGPCqndWA==",
                "medicine_name": "Ashokarishta",
                "dosage_type": "",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/62d68c820e9dc.jpg",
                "content": "",
                "mrp": 115,
                "size": 1,
                "manufacturer_name": "Dabur India Ltd",
                "packing_size": "1 Bottle of  450 Ml",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 2,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/62d68c820e9dc.jpg"
            },
            {
                "medicine_id": "+4jNNVc3rdvT5XlzXMizow==",
                "medicine_name": "Ayush Kwath Tablet",
                "dosage_type": "tablet",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/63a5c2c2469fc.jpg",
                "content": "",
                "mrp": 200,
                "size": 60,
                "manufacturer_name": "Shree Baidyanath Ayurved Bhawan Pvt Ltd",
                "packing_size": "1 Bottle of  60 Tablet",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 120,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/63a5c2c2469fc.jpg"
            },
            {
                "medicine_id": "NdOF1yXYndq22dDVwzXfNQ==",
                "medicine_name": "Baidyanath Chandraprabha Bati",
                "dosage_type": "tablet",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/608296c17badf.jpg",
                "content": "",
                "mrp": 100,
                "size": 50,
                "manufacturer_name": "Shree Baidyanath Ayurved Bhawan Pvt Ltd",
                "packing_size": "1 Bottle of  50 Tablet",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 50,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/608296c17badf.jpg"
            },
            {
                "medicine_id": "vssohCb7WxCDolgcHguo/w==",
                "medicine_name": "Baidyanath (Jhansi) Bilva Tail",
                "dosage_type": "",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/60c73865b7bb6.jpg",
                "content": "",
                "mrp": 120,
                "size": 1,
                "manufacturer_name": "Baidyanath Ayurved Bpvtltd",
                "packing_size": "1 Bottle of  25 Ml",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 1,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/60c73865b7bb6.jpg"
            },
            {
                "medicine_id": "/BgA059dxxbgWgV3hfrJ3w==",
                "medicine_name": "Baidyanath Rogan Badam Shirin",
                "dosage_type": "",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/616408099645b.jpg",
                "content": "",
                "mrp": 385,
                "size": 1,
                "manufacturer_name": "Shree Baidyanath Ayurved Bhawan Pvt Ltd",
                "packing_size": "1 Bottle of  100 Ml",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 0,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/616408099645b.jpg"
            },
            {
                "medicine_id": "EJohZPYdCh1E4c0FEWq6BQ==",
                "medicine_name": "Bonnisan Drop",
                "dosage_type": "drop",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/601a949fed957.jpg",
                "content": "",
                "mrp": 65,
                "size": 1,
                "manufacturer_name": "Himalaya Drug Company",
                "packing_size": "1 Bottle of  30 Ml",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 2,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/601a949fed957.jpg"
            },
            {
                "medicine_id": "1tsVU6T2DUrWLmZ3t93LkA==",
                "medicine_name": "Bonnisan Liquid",
                "dosage_type": "syrup",
                "is_rx_required": 0,
                "image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/6527947559b95.jpg",
                "content": "",
                "mrp": 55,
                "size": 1,
                "manufacturer_name": "Himalaya Drug Company",
                "packing_size": "1 Bottle of  100 Ml",
                "medicine_type": "otc",
                "salt_content_id": "",
                "loose_quantity": 5,
                "is_inventory_available": "yes",
                "watermark_free_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/itemoriginalcopy/medicines/6527947559b95.jpg"
            }
        ]
    }
}
```

{% endtab %}

{% tab title="200: OK Products not found" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-12-06 11:44:01",
    "data": {
        "rpp": 20,
        "current_page": 10,
        "results": []
    }
}
```

{% endtab %}

{% tab title="200: OK Validation error" %}

```json
{
    "status_code": "0",
    "status_message": "category_id is required",
    "datetime": "2023-10-03 18:03:24",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Orders

APIs for orders i.e. placing, cancelling, saving and more.

**Watch a video.**

{% embed url="<https://www.loom.com/share/92d924515dfd477cb21b99d778559301>" %}


# Place Order

To place order with items and its quantity.

## <img src="https://static.vecteezy.com/system/resources/thumbnails/018/930/572/small/youtube-logo-youtube-icon-transparent-free-png.png" alt="" data-size="line"> [Placing Orders with Ease: A Step-by-Step Guide](https://youtu.be/1TlUVPaWolI?si=2ybv22QYp_P3w994)

## Place Order

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/orders/place_order`](https://api.evitalrx.in/v1/patient/orders/place_order)

Here is the sample cURL request to place a pick-up online order with prescriptions. Use form data to call the place order API, and push prescriptions in the **image** param:

{% file src="/files/pWruxFCsTFJqDPUCYVZk" %}

#### Request Body

| Name                                             | Type   | Description                                                                                                                                                                               |
| ------------------------------------------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| patient\_id<mark style="color:red;">\*</mark>    | String | Id to uniquely identify the patient for whom the order is placed                                                                                                                          |
| items<mark style="color:red;">\*</mark>          | String | <p>Stringified Array of items with quantity (in pills) and medicine\_id.</p><p><em>i.e.</em> \[{"medicine\_id":"Eli4pMFfzobV63G67jtjZw==","quantity": 10, "discount\_percentage": 5}]</p> |
| apikey<mark style="color:red;">\*</mark>         | String | Authentication token                                                                                                                                                                      |
| delivery\_type<mark style="color:red;">\*</mark> | String | Order Delivery type can be **pickup** or **delivery**                                                                                                                                     |
| address\_id<mark style="color:red;">\*</mark>    | String | Address ID from the address/list API.  required in case of the delivery\_type is "delivery"                                                                                               |
| parent\_patient\_id                              | String | If billing for family member, then pass parent patient's ID here.                                                                                                                         |
| order\_status                                    | String | It will save the order in the "draft" status.                                                                                                                                             |
| image                                            | File   | <p>Pass one or more prescription images in FormData.</p><p></p><p>allowed formats (png/jpg/jpeg)</p>                                                                                      |
| custom\_fields                                   | Object | <p>Key value pairs of attribute\_key and it's value.<br>For ex: <br>{"prescription\_id": "879", "appointment\_id": "123"}</p>                                                             |
| shipping                                         | Number | <p>Shipping charge for delivery<br>(Will round up the given value<br>For ex: </p><p>20.5 => 21</p><p>20.2 => 20 )</p>                                                                     |
| remark                                           | String | Optional field to include any specific notes or instructions associated with the order.                                                                                                   |

{% tabs %}
{% tab title="200 Order Placed successfully." %}

```
{
    "status_code": "1",
    "status_message": "Order placed successfully",
    "datetime": "2022-12-06 18:46:31",
    "data": {
        "order_id": "/6vMKQj0JOB9GvN+6I27zg==",
        "order_number": "OJLBC8WC1I"
    }
}
```

{% endtab %}

{% tab title="200: OK Order failed." %}

```json
{
    "status_code": "0",
    "status_message": "Something went wrong",
    "datetime": "2022-12-06 18:47:41",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Cancel Order

The patient can cancel the order with this API.

## Push the Order in Cancelled state

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/orders/cancel_order`](https://api.evitalrx.in/v1/patient/orders/cancel_order)

The orders in the "assigned", "accepted" and "shipped" states, can be canceled with this API.

#### Request Body

| Name                                             | Type   | Description                                        |                                                               |
| ------------------------------------------------ | ------ | -------------------------------------------------- | ------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>         | String | Authentication token                               |                                                               |
| order\_id<mark style="color:red;">\*</mark>      | String | Order ID from the response of Place Order API.     |                                                               |
| reason\_source<mark style="color:red;">\*</mark> | String | <p>"pickup"                                        | "delivery"</p><p></p><p>pass order is pickup or delivery.</p> |
| reason\_id<mark style="color:red;">\*</mark>     | Number | ID of the reasons got from Get Reject Reasons API. |                                                               |
| patient\_id                                      | String | ID of the patient to cancel the order              |                                                               |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Your order cancelled successfully.",
    "datetime": "2023-03-21 16:05:47",
    "ng_version": "0.0.378",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "order_id is required",
    "datetime": "2023-03-09 17:03:38",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Save

This API is used to Save the draft orders.

## Complete the order.

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/orders/save`](https://api.evitalrx.in/v1/patient/orders/save)

If the order is made in a draft state, It can be saved by this API. This removes the headache of the integration partners, who don't want their chemists to switch 2 portals. Their portal to place orders, and eVitalRx portal to save the order.

#### Request Body

| Name                                              | Type              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------------------------------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| patient\_id<mark style="color:red;">\*</mark>     | String            | Id to uniquely identify the patient for whom the order is placed                                                                                                                                                                                                                                                                                                                                                                                                |
| items<mark style="color:red;">\*</mark>           | Stringified Array | <p>List of items with quantity (default in pills). You can change the quantity\_type to consider them as strip. </p><p></p><p>All  the params are required shown below. </p><p>Medicine Id and batch should have unique combination. </p><p></p><p><em>i.e.</em> \[{ "medicine\_id": "vjalpzMV0E33BLwzzLR6fQ==", "batch": "FRESH", "expiry": "2025-12-01", "mrp": 36.1, "quantity": 2, "discount": 0, "gst\_percentage": 12, "cess\_percentage": 0}]</p><p></p> |
| quantity\_type                                    | strip \| loose    | <p>\[strip]: The quantity you are passing will considered as strip </p><p>\[loose]: The quantity you are passing will considered as pills</p>                                                                                                                                                                                                                                                                                                                   |
| apikey<mark style="color:red;">\*</mark>          | String            | Authentication token                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| patient\_name<mark style="color:red;">\*</mark>   | String            | Name of the Patient                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| shipping                                          | String            | Extra charges in the order.                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| delivery\_type                                    | String            | Must be one of **pickup** or **delivery**. default is **pickup.**                                                                                                                                                                                                                                                                                                                                                                                               |
| remark                                            | String            | Note for the Prescription. This param is also available in the Order Details.                                                                                                                                                                                                                                                                                                                                                                                   |
| order\_id<mark style="color:red;">\*</mark>       | String            | Order ID from the response of Place Order API.                                                                                                                                                                                                                                                                                                                                                                                                                  |
| order\_date<mark style="color:red;">\*</mark>     | String            | <p>Date of the bill. </p><p>Format: YYYY-MM-DD</p><p></p>                                                                                                                                                                                                                                                                                                                                                                                                       |
| parent\_patient\_id                               | String            | If billing for family member, then pass parent patient's ID here.                                                                                                                                                                                                                                                                                                                                                                                               |
| doctor\_id                                        | String            | Encrypted Doctor ID. This ID is available in the Order Details.                                                                                                                                                                                                                                                                                                                                                                                                 |
| payment\_status<mark style="color:red;">\*</mark> | Number            | <p>To choose payment mode of the order. </p><p>1: CASH </p><p>2: CREDIT </p><p>3: UPI </p><p>4: CHEQUE </p><p>5: PAYTM </p><p>6: CC/DC </p><p>7: RTGS/NEFT</p>                                                                                                                                                                                                                                                                                                  |

{% tabs %}
{% tab title="200: OK Order shipped successfully." %}

```json
{
    "status_code": "1",
    "status_message": "New sales bill created successfully.",
    "datetime": "2023-03-09 17:01:32",
    "ng_version": "0.0.371",
    "data": {
        "order_id": "LcNx52qfdGlw0aHcqmgsRg==",
        "bill_no": "141",
        "order_number": "OKLF112H59",
        "amount": "29",
        "print_url": "http://www.evital.in/invoice/T0tMRjExMkg1OQ==/print/",
        "share_message": "Hi%20Aagam%20Shah%2C%0AThank%20you%20for%20your%20purchase%20at%20*Manav%20Medical%20GJ*.%20We%20hope%20to%20serve%20you%20again.%0AClick%20to%20make%20Payment%20or%20view%20Invoice%3A%20http%3A%2F%2Flocalhost%2Fevital%2Finvoice%2FT0tMRjExMkg1OQ%3D%3D%2F%3Fsource%3DWhatsApp%26medium%3DManual%0A%0AIf%20the%20link%20is%20not%20clickable%2C%20please%20save%20this%20number%20and%20try%20again.%0A%0AYour%20trusted%20pharmacist%2C%0AManav%20Medical%20GJ",
        "invoice_url": "Hi%20Aagam%20Shah%2C%0AThank%20you%20for%20your%20purchase%20at%20*Manav%20Medical%20GJ*.%20We%20hope%20to%20serve%20you%20again.%0AClick%20to%20make%20Payment%20or%20view%20Invoice%3A%20http%3A%2F%2Flocalhost%2Fevital%2Finvoice%2FT0tMRjExMkg1OQ%3D%3D%2F%3Fsource%3DWhatsApp%26medium%3DManual%0A%0AIf%20the%20link%20is%20not%20clickable%2C%20please%20save%20this%20number%20and%20try%20again.%0A%0AYour%20trusted%20pharmacist%2C%0AManav%20Medical%20GJ"
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "order_id is required",
    "datetime": "2023-03-09 17:03:38",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Order Details

To get the order details

## Order View

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/orders/view`](https://api.evitalrx.in/v1/patient/orders/view)

#### Request Body

| Name                                        | Type   | Description            |
| ------------------------------------------- | ------ | ---------------------- |
| order\_id<mark style="color:red;">\*</mark> | String | Unique id of the Order |
| apikey<mark style="color:red;">\*</mark>    | String | Authentication token   |

{% tabs %}
{% tab title="200 Order successfully retrieved." %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-06 19:09:07",
    "data": {
        "id": "/6vMKQj0JOB9GvN+6I27zg==", // Order ID
        "order_number": "OJLBC8WC1I",
        "amount": 10000,
        "discount": 0,
        "total": 10000,
        "address_name": "home",
        "address": "Cambridge Road, Halasuru",
        "address_line2": "",
        "city": "Banglore",
        "state": "Karnataka",
        "zipcode": "560008",
        "order_status": "assigned",
        "created_date": "2022-12-06 18:46:30",
        "order_delivery_datetime": "2022-12-06 18:46:30",
        "pharmacy_name": "Manav Pharmacy",
        "chemist_mobile": "7043120038",
        "chemist_address": "Cambridge Road",
        "chemist_city": "Bengaluru",
        "chemist_latitude": 12.970622,
        "chemist_longitude": 77.6281433,
        "chemist_state": "Karnataka",
        "chemist_zipcode": "560008",
        "order_patient_name": "Jay Patel",
        "pharmacist_name": "Manav",
        "delivery_note": "",
        "payment_status": 2,
        "patient_id": "KFb7duiHDJAXqKUJc2poVw==",
        "delivery_pin": "U2FsdGVkX1/ChV2gPONI9ava2S0tZ8h9Hf7LAV2E6WA=",
        "payment_ref_id": "",
        "custom_fields": { // addtional fields for order/patient
                "prescription_id": "879",
                "appointment_id": "123"
            }
        "medicine_details": [
            {
                "medicine_id": "Eli4pMFfzobV63G67jtjZw==",
                "medicine_name": "Ltk AM Tablet 569",
                "size": 10,
                "medicine_type": "drug",
                "packing_size": "1 Strip of  10 Tablet",
                "gst_percentage": 12,
                "quantity": 10,
                "mrp": 1000,
                "amount": 10000,
                "price": 1000,
                "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
                "order_details_id": "ai79ZnBDqmAibtajMJfCcQ==",
                "discount_percentage": 0,
                "batch": "",
                "discount": 0,
                "expiry": "1900-01-01",
                "gst": 0,
                "hsn_code": "",
                "cess": 0,
                "cess_percentage": 0,
                "loose_quantity": 100
            }
        ],
        "prescription_details": [],
        "payment_url": "http://evital.in/invoice/T0pMQkM4V0MxSQ==/"
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid Order Key",
    "datetime": "2022-12-06 18:57:35",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Order List

To fetch order history of patient.

## Order List

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/orders/list`](https://api.evitalrx.in/v1/patient/orders/list)

#### Request Body

| Name                                     | Type   | Description                                                                               |          |                                                                                                                                                                                                                                                                                                                                               |
| ---------------------------------------- | ------ | ----------------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| patient\_id                              | String | Id to uniquely identify the Patient to fetch the list of orders of the particular patient |          |                                                                                                                                                                                                                                                                                                                                               |
| apikey<mark style="color:red;">\*</mark> | String | Authentication token                                                                      |          |                                                                                                                                                                                                                                                                                                                                               |
| page                                     | Number | To view orders on the next page. 20 Records will show at a time. The default page is 1.   |          |                                                                                                                                                                                                                                                                                                                                               |
| order\_mode                              | String | <p>''                                                                                     | 'online' | 'offline'</p><p></p><p>Default: ''</p><p></p><p>If it is online, then only online orders will be fetched of the patients. </p><p></p><p>If provided offline, then only offline orders will be fetched from patients. </p><p></p><p>If not provided, or provided as '' then, it will fetch both online and offline orders of the patient. </p> |

{% tabs %}
{% tab title="200 Orders successfully retrieved." %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2024-02-08 12:20:04",
    "data": {
        "results": [
            {
                "id": "bMLgI5pkJQJrKUqANIyVAA==",
                "bill_no": "",
                "order_number": "O9LQOT1C7C",
                "order_delivery_datetime": "2024-02-07 16:13:30",
                "delivery_type": "pickup",
                "order_status": "accepted",
                "created_date": "2023-12-28 11:39:06",
                "amount": 75.03,
                "delivery_id": 0,
                "order_mode": "online"
            },
            {
                "id": "PP3WmbSH7C0jUKdLohRgOg==",
                "bill_no": "",
                "order_number": "OHLQOSZ7XK",
                "order_delivery_datetime": "2023-12-28 11:37:27",
                "delivery_type": "pickup",
                "order_status": "assigned",
                "created_date": "2023-12-28 11:37:27",
                "amount": 26,
                "delivery_id": 0,
                "order_mode": "online"
            },
            {
                "id": "F09UGz9S343HaQaiqvaeeg==",
                "bill_no": "B00892",
                "order_number": "O8LQGO0LAJ",
                "order_delivery_datetime": "2023-12-22 18:57:32",
                "delivery_type": "delivery",
                "order_status": "completed",
                "created_date": "2023-12-22 18:56:22",
                "amount": 30,
                "delivery_id": 0,
                "order_mode": "online"
            },
            {
                "id": "jSu6tP9pRmG5dE096gJvTg==",
                "bill_no": "",
                "order_number": "OELQ6L4TDQ",
                "order_delivery_datetime": "2023-12-15 17:37:59",
                "delivery_type": "delivery",
                "order_status": "assigned",
                "created_date": "2023-12-15 17:37:59",
                "amount": 29,
                "delivery_id": 0,
                "order_mode": "online"
            },
            {
                "id": "lfGZLf0i4Gwluampo63H9A==",
                "bill_no": "",
                "order_number": "OMLQ6IV126",
                "order_delivery_datetime": "2023-12-15 16:34:22",
                "delivery_type": "delivery",
                "order_status": "assigned",
                "created_date": "2023-12-15 16:34:22",
                "amount": 29,
                "delivery_id": 0,
                "order_mode": "online"
            }
        ],
        "rpp": 20,
        "current_page": 1
    }
}
```

{% endtab %}

{% tab title="200: OK Could not find an order." %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-06 19:06:09",
    "data": {
        "results": [],
        "rpp": 20,
        "current_page": 1
    }
}
```

{% endtab %}
{% endtabs %}


# Mark as Accept

This API is used to accept the order.

## Push the Order in Accepted state

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/orders/mark_as_accept`](https://api.evitalrx.in/v1/patient/orders/mark_as_accept)

This API marks the order in the accepted state.

#### Request Body

| Name                                        | Type   | Description                                    |
| ------------------------------------------- | ------ | ---------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>    | String | Authentication token                           |
| order\_id<mark style="color:red;">\*</mark> | String | Order ID from the response of Place Order API. |

{% tabs %}
{% tab title="200: OK Order accepted successfully." %}

```json
{
    "status_code": "1",
    "status_message": "Order accepted successfully",
    "datetime": "2023-03-21 16:07:42",
    "ng_version": "0.0.378",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "order_id is required",
    "datetime": "2023-03-09 17:03:38",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Mark as Reject

This API is used to reject the order.

## Push the Order in Rejected state

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/orders/mark_as_reject`](https://api.evitalrx.in/v1/patient/orders/mark_as_reject)

The orders in the "assigned", "accepted" and "shipped" states, can be canceled with this API.

#### Request Body

| Name                                         | Type   | Description                                        |                                                                                |
| -------------------------------------------- | ------ | -------------------------------------------------- | ------------------------------------------------------------------------------ |
| apikey<mark style="color:red;">\*</mark>     | String | Authentication token                               |                                                                                |
| order\_id<mark style="color:red;">\*</mark>  | String | Order ID from the response of Place Order API.     |                                                                                |
| reason\_source                               | String | <p>"pickup"                                        | "delivery"</p><p>Default: "pickup"</p><p>pass order is pickup or delivery.</p> |
| reason\_id<mark style="color:red;">\*</mark> | Number | ID of the reasons got from Get Reject Reasons API. |                                                                                |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Your order cancelled successfully.",
    "datetime": "2023-03-21 16:05:47",
    "ng_version": "0.0.378",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "order_id is required",
    "datetime": "2023-03-09 17:03:38",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Get Reject Reasons

Get list of reasons to reject the order.

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/orders/reject_reasons`](https://api.evitalrx.in/v1/patient/orders/reject_reasons)

#### Request Body

| Name                                             | Type   | Description          |                                                               |
| ------------------------------------------------ | ------ | -------------------- | ------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>         | String | Authentication token |                                                               |
| reason\_source<mark style="color:red;">\*</mark> | String | <p>"pickup"          | "delivery"</p><p></p><p>pass order is pickup or delivery.</p> |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-03-21 17:18:14",
    "data": {
        "reasons": [
            {
                "id": 1,
                "reason": "Medicine not available"
            },
            {
                "id": 2,
                "reason": "Can't deliver in this area"
            },
            {
                "id": 4,
                "reason": "Delivery person not available"
            },
            {
                "id": 5,
                "reason": "Less order value"
            },
            {
                "id": 6,
                "reason": "Store closed"
            },
            {
                "id": 21,
                "reason": "Prescription not attached in this order"
            },
            {
                "id": 10,
                "reason": "Can't modify MRP"
            },
            {
                "id": 7,
                "reason": "Other"
            }
        ]
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "reason_source must be one of [pickup, delivery]",
    "datetime": "2023-03-21 17:19:21",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Get Chemist Order Settings

Get settings chemist has configured in eVitalRx for online orders.

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/orders/get_chemist_order_settings`](https://api.evitalrx.in/v1/patient/orders/get_chemist_order_settings)

#### Request Body

| Name                                     | Type   | Description          |
| ---------------------------------------- | ------ | -------------------- |
| apikey<mark style="color:red;">\*</mark> | String | Authentication token |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2024-02-08 12:15:13",
    "data": {
        "shipping_charges": "10", // pre-defined by chemist
        "minimum_order_value": "50" // // pre-defined by chemist
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "apikey is required",
    "datetime": "2024-02-08 12:16:17",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Mark as Shipped

This API is deprecated.

## Push the Order in shipped state

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/orders/mark_as_shipped`](https://api.evitalrx.in/v1/patient/orders/mark_as_shipped)

If the order is made with batch through Place Order API, It can be saved by this API. This removes the headache of the integration partners, who don't want their chemists to switch 2 portals. Their portal to place orders, and eVitalRx portal push the order.

#### Request Body

| Name                                              | Type              | Description                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------------------------------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| patient\_id<mark style="color:red;">\*</mark>     | String            | Id to uniquely identify the patient for whom the order is placed                                                                                                                                                                                                                                                                                                                    |
| items<mark style="color:red;">\*</mark>           | Stringified Array | <p>List of items with quantity (in pills). </p><p>All  the params are required shown below. </p><p>Medicine Id and batch should have unique combination. </p><p></p><p><em>i.e.</em> \[{ "medicine\_id": "vjalpzMV0E33BLwzzLR6fQ==", "batch": "FRESH", "expiry": "2025-12-01", "mrp": 36.1, "quantity": 2, "discount": 0, "gst\_percentage": 12, "cess\_percentage": 0}]</p><p></p> |
| apikey<mark style="color:red;">\*</mark>          | String            | Authentication token                                                                                                                                                                                                                                                                                                                                                                |
| patient\_name<mark style="color:red;">\*</mark>   | String            | Name of the Patient                                                                                                                                                                                                                                                                                                                                                                 |
| shipping                                          | String            | Extra charges in the order.                                                                                                                                                                                                                                                                                                                                                         |
| delivery\_type                                    | String            | Must be one of **pickup** or **delivery**. default is **pickup.**                                                                                                                                                                                                                                                                                                                   |
| remark                                            | String            | Note for the Prescription. This param is also available in the Order Details.                                                                                                                                                                                                                                                                                                       |
| order\_id<mark style="color:red;">\*</mark>       | String            | Order ID from the response of Place Order API.                                                                                                                                                                                                                                                                                                                                      |
| order\_date<mark style="color:red;">\*</mark>     | String            | <p>Date of the bill. </p><p>Format: YYYY-MM-DD</p><p></p>                                                                                                                                                                                                                                                                                                                           |
| parent\_patient\_id                               | String            | If billing for family member, then pass parent patient's ID here.                                                                                                                                                                                                                                                                                                                   |
| doctor\_id                                        | String            | Encrypted Doctor ID. This ID is available in the Order Details.                                                                                                                                                                                                                                                                                                                     |
| payment\_status<mark style="color:red;">\*</mark> | Number            | <p>To choose payment mode of the order. </p><p>1: CASH </p><p>2: CREDIT </p><p>3: UPI </p><p>4: CHEQUE </p><p>5: PAYTM </p><p>6: CC/DC </p><p>7: RTGS/NEFT</p>                                                                                                                                                                                                                      |

{% tabs %}
{% tab title="200: OK Order shipped successfully." %}

```json
{
    "status_code": "1",
    "status_message": "New sales bill created successfully.",
    "datetime": "2023-03-09 17:01:32",
    "ng_version": "0.0.371",
    "data": {
        "order_id": "LcNx52qfdGlw0aHcqmgsRg==",
        "bill_no": "141",
        "order_number": "OKLF112H59",
        "amount": "29",
        "print_url": "http://www.evital.in/invoice/T0tMRjExMkg1OQ==/print/",
        "share_message": "Hi%20Aagam%20Shah%2C%0AThank%20you%20for%20your%20purchase%20at%20*Manav%20Medical%20GJ*.%20We%20hope%20to%20serve%20you%20again.%0AClick%20to%20make%20Payment%20or%20view%20Invoice%3A%20http%3A%2F%2Flocalhost%2Fevital%2Finvoice%2FT0tMRjExMkg1OQ%3D%3D%2F%3Fsource%3DWhatsApp%26medium%3DManual%0A%0AIf%20the%20link%20is%20not%20clickable%2C%20please%20save%20this%20number%20and%20try%20again.%0A%0AYour%20trusted%20pharmacist%2C%0AManav%20Medical%20GJ",
        "invoice_url": "Hi%20Aagam%20Shah%2C%0AThank%20you%20for%20your%20purchase%20at%20*Manav%20Medical%20GJ*.%20We%20hope%20to%20serve%20you%20again.%0AClick%20to%20make%20Payment%20or%20view%20Invoice%3A%20http%3A%2F%2Flocalhost%2Fevital%2Finvoice%2FT0tMRjExMkg1OQ%3D%3D%2F%3Fsource%3DWhatsApp%26medium%3DManual%0A%0AIf%20the%20link%20is%20not%20clickable%2C%20please%20save%20this%20number%20and%20try%20again.%0A%0AYour%20trusted%20pharmacist%2C%0AManav%20Medical%20GJ"
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "order_id is required",
    "datetime": "2023-03-09 17:03:38",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Mark as Delivered

This API is used to complete your order.

## Push the Order in delivered state

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/orders/mark_as_delivered`](https://api.evitalrx.in/v1/patient/orders/mark_as_delivered)

This API marks the order in the delivered state. This API will complete the order.

#### Request Body

| Name                                              | Type   | Description                                                                                                                                                    |
| ------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>          | String | Authentication token                                                                                                                                           |
| delivery\_pin                                     | String | Required for pickup orders. Not required for the delivery orders.                                                                                              |
| order\_id<mark style="color:red;">\*</mark>       | String | Order ID from the response of Place Order API.                                                                                                                 |
| payment\_status<mark style="color:red;">\*</mark> | Number | <p>To choose payment mode of the order. </p><p>1: CASH </p><p>2: CREDIT </p><p>3: UPI </p><p>4: CHEQUE </p><p>5: PAYTM </p><p>6: CC/DC </p><p>7: RTGS/NEFT</p> |

{% tabs %}
{% tab title="200: OK Order delivered successfully." %}

```json
{
    "status_code": "1",
    "status_message": "Order Delivered successfully",
    "datetime": "2023-03-09 14:39:53",
    "ng_version": "0.0.371",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "order_id is required",
    "datetime": "2023-03-09 17:03:38",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Order Return

## Make Sales Return bill with API

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}patient/orders/sales_return`](https://api.evitalrx.in/v1/patient/orders/sales_return)

This API will make a Sales Return bill. chemist no need to go to the eVitalRx portal to complete the Return bill.

#### Request Body

| Name                                              | Type              | Description                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------------------------------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| patient\_id<mark style="color:red;">\*</mark>     | String            | Id to uniquely identify the patient for whom the order is placed                                                                                                                                                                                                                                                                                                                    |
| items<mark style="color:red;">\*</mark>           | Stringified Array | <p>List of items with quantity (in pills). </p><p>All  the params are required shown below. </p><p>Medicine Id and batch should have unique combination. </p><p></p><p><em>i.e.</em> \[{ "medicine\_id": "vjalpzMV0E33BLwzzLR6fQ==", "batch": "FRESH", "expiry": "2025-12-01", "mrp": 36.1, "quantity": 2, "discount": 0, "gst\_percentage": 12, "cess\_percentage": 0}]</p><p></p> |
| apikey<mark style="color:red;">\*</mark>          | String            | Authentication token                                                                                                                                                                                                                                                                                                                                                                |
| patient\_name<mark style="color:red;">\*</mark>   | String            | Name of the Patient                                                                                                                                                                                                                                                                                                                                                                 |
| remark                                            | String            | Note for the Order Return.                                                                                                                                                                                                                                                                                                                                                          |
| order\_date<mark style="color:red;">\*</mark>     | String            | <p>Date of the bill. </p><p>Format: YYYY-MM-DD</p><p></p>                                                                                                                                                                                                                                                                                                                           |
| payment\_status<mark style="color:red;">\*</mark> | Number            | <p>To choose payment mode of the order. </p><p>1: CASH </p><p>2: CREDIT </p><p>3: UPI </p><p>4: CHEQUE </p><p>5: PAYTM </p><p>6: CC/DC </p><p>7: RTGS/NEFT</p>                                                                                                                                                                                                                      |
| quantity\_type                                    | strip \| loose    | <p>\[strip]: The quantity you are passing will considered as strip </p><p>\[loose]: The quantity you are passing will considered as pills</p>                                                                                                                                                                                                                                       |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Return order added successfully.",
    "datetime": "2023-03-09 18:44:25",
    "ng_version": "0.0.371",
    "data": {
        "order_id": "UpQGYF77Y97maydwXEaVXQ=="
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Patient Name length must be less than or equal to 50 characters long",
    "datetime": "2023-03-09 18:37:21",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Order Return Details

## View Sales Return bill with API

<mark style="color:green;">`POST`</mark>  [`{{apiUrl}}patient/orders/sales_return/view`](https://api.evitalrx.in/v1/patient/orders/sales_return/view)

This API will make a Sales Return bill. chemist no need to go to the eVitalRx portal to complete the Return bill.

#### Request Body

| Name                                                         | Type   | Description                                      |
| ------------------------------------------------------------ | ------ | ------------------------------------------------ |
| <mark style="color:red;">\*</mark>chemist\_sales\_return\_id | String | Order ID from the Response of sales\_return API. |
| apikey<mark style="color:red;">\*</mark>                     | String | Authentication token                             |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2024-12-06 11:20:56",
    "ng_version": "0.0.787",
    "data": {
        "order_id": "zD2GbRYPHMaC/CL7Ot4Yjg==",
        "patient_name": "Avi Patel",
        "patient_id": "",
        "order_number": "EBD70731003365",
        "order_date": "2024-07-24",
        "amount": 23.5,
        "mobile": "",
        "order_status": "completed",
        "address": null,
        "address_line2": null,
        "city": null,
        "zipcode": null,
        "created_date": "2024-12-06 11:02:32",
        "total": 24,
        "payment_status": 2,
        "payment_date": "1900-01-01 12:00:00",
        "method_name": "Credit",
        "order_by_id": "pAUYuNJCJxZDFD5U4Nq/ZQ==",
        "order_by_entity": "chemist",
        "reference_number": 4,
        "remark": "",
        "roundoff": 0.5,
        "utm_source": "",
        "doctor_id": "",
        "total_discount": 0,
        "lock_bill": "no",
        "user_id": 0,
        "parent_patient_id": "",
        "sales_reference_id": "",
        "is_unlink_record": "no",
        "total_gst": 2.41,
        "total_cess": 1,
        "total_qty": 10,
        "items": [
            {
                "medicine_id": "TF7Wm49nceLV+NmoM6HJYw==",
                "base_price": 23.5,
                "quantity": 10,
                "mrp": 23.5,
                "discount_percentage": 0,
                "batch": "WER321",
                "expiry": "2030-02-01",
                "gst": 2.41,
                "gst_percentage": 12,
                "cess": 1,
                "cess_percentage": 5,
                "hsn_code": "345335",
                "amount": 23.5,
                "medicine_name": "Ltk 50 Tablet",
                "size": 10,
                "pack_size": "10 Tablets",
                "packing_size": "10 tablets in 1 strip",
                "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
                "content": "Losartan (50mg)",
                "location": "", // location of the medicine in pharmacy
                "stock_adjusted": "pending",
                "discount": 0,
                "order_type": "sale_return",
                "landing_price": 18.540045125038404
            }
        ],
        "billing_for_details": {
            "patient_id": "",
            "patient_name": "Avi Patel",
            "mobile": "",
            "aadhar_number": "",
            "patient_address": "",
            "patient_city": null,
            "gstn_number": "",
            "patient_zipcode": null,
            "profile_picture": "",
            "discount_percentage": 0,
            "email": "",
            "status": "active"
        },
        "is_already_adjusted": "no",
        "doctor_name": "",
        "customer_details": {
            "patient_id": "",
            "patient_name": "Avi Patel",
            "mobile": "",
            "aadhar_number": "",
            "patient_address": "",
            "patient_city": null,
            "gstn_number": "",
            "patient_zipcode": null,
            "profile_picture": "",
            "discount_percentage": 0,
            "email": "",
            "status": "active"
        },
        "chemist_details": {
            "id": "pAUYuNJCJxZDFD5U4Nq/ZQ==",
            "pharmacy_name": "Demo Pharmacy",
            "mobile": "8128937197",
            "pharmacist_digital_signature": "",
            "pharmacy_logo": "https://d3cgpvqmlaynvp.cloudfront.net/storage/chemists/kyc/noixjea3n4.jpg",
            "profile_picture": "https://d3cgpvqmlaynvp.cloudfront.net/storage/chemists/kyc/ic0qtzyda7.jpg"
        }
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "chemist_sales_return_id must be greater than 0",
    "datetime": "2024-12-06 11:24:24",
    "ng_version": "0.0.787",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Introduction

This bundle offers APIs for managing medicines, patient records, and orders in EMR/HMIS systems. It includes functionalities for searching medicines, updating patient details, managing prescriptions, and handling order information, streamlining healthcare operations.

**Here is the Postman Collection of APIs**

{% file src="/files/9xhnIFRH8gSbuulaVBuH" %}

## Sequence Diagram

<figure><img src="/files/bw6MijB4pEf6a1Y7Hxn7" alt=""><figcaption><p><mark style="background-color:yellow;"><strong><code>This diagram illustrates the flow of interactions between the Doctor, the Third-Party Integration (EMR/HMIS), and eVitalRx API in an EMR/HMIS system. The process includes adding or updating patient information, searching for medicines, pushing prescriptions (orders), saving and viewing bills, and managing bill lists filtered by patient and date range. The system ensures seamless management of patient records, medicine prescriptions, and billing processes through API integrations.</code></strong></mark></p></figcaption></figure>


# Medicines

**Watch a video.**

{% embed url="<https://www.loom.com/share/76811478123d4b5bbb562b8a15ac528a>" %}


# Search Products

To search items with the Item Name (string), GTIN number of the product, or Salt-Composition(content).

#### [Explore Medicines Available in Staging](/getting-started-with-evitalrx#explore-medicines-available-in-staging)

## Search Products

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/medicines/search`](https://api.evitalrx.in/v1/doctor/medicines/search)

If the Item is present in your inventory, then it will appear first.

#### Request Body

| Name                                           | Type   | Description                                                                                                                                                                                                                                                                       |
| ---------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| searchstring<mark style="color:red;">\*</mark> | String | <p>Search String input</p><p>It can be used in following ways.</p><p>By Item Name</p><p><code>"searchstring":"dolo"</code></p><p></p><p>By Content</p><p><code>"searchstring":"c,paraceta"</code></p><p></p><p>By GTIN Number</p><p><code>"searchstring":"89080034169"</code></p> |
| apikey<mark style="color:red;">\*</mark>       | String | Authentication token                                                                                                                                                                                                                                                              |

{% tabs %}
{% tab title="200: OK Products Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-07 10:49:06",
    "data": {
        "did_you_mean_result": [], // if medicine not found then suggestions
        "result": [
            {
                "dosage_type": "tablet",
                "medicine_name": "Cold N Flu Tablet",
                "content": "Paracetamol (500mg) + Phenylephrine Hydrochloride (5mg) + Chlorpheniramine Maleate (2mg)",
                "mrp": 78,
                "medicine_id": "8HiQkGfpzbiAzkma2b5/yw==",
                "packing_size": "1 Strip of  10 Tablet",
                "size": "10",
                "manufacturer_name": "Elder Labs Limited",
                "medicine_type": "drug",
                "gst_percentage": "12",
                "available_for_patient": "yes",
                "discontinued": "no",
                "loose_quantity": 4970,
                "sale_discount": 0,
                "strip_quantity": 497,
                "is_inventory_available": "yes",
                "sell_in_loose": "yes"
            },
            {
                "dosage_type": "tablet",
                "medicine_name": "N-Cold New Tablet",
                "content": "Paracetamol (325mg) + Phenylephrine (2.5mg) + Chlorpheniramine (2mg)",
                "mrp": 48.6,
                "medicine_id": "RYmIov0OJ2TM7qQEJ2YRqw==",
                "packing_size": "1 Strip of  10 Tablet",
                "size": "10",
                "manufacturer_name": "German Remedies Pharmaceuticals Pvt Ltd",
                "medicine_type": "drug",
                "gst_percentage": "12",
                "salt_content_id": "18885",
                "available_for_patient": "yes",
                "discontinued": "no",
                "loose_quantity": 3970,
                "sale_discount": 0,
                "strip_quantity": 397,
                "is_inventory_available": "yes",
                "sell_in_loose": "yes"
            }
        ]
    }
}
```

{% endtab %}

{% tab title="200: OK No Product found according to search query" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-07 10:50:10",
    "data": {
        "did_you_mean_result": [],
        "result": []
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "\"Medicine Name\" length must be less than or equal to 20 characters long",
    "datetime": "2022-12-06 15:19:58",
    "data": null
}
```

{% endtab %}
{% endtabs %}

**List of Medicines available in the staging environment:**

{% file src="/files/wHF4xVvM8zOXodnTUPT7" %}


# Product Details

To get item details in your inventory by unique medicine Id.

## Product Details

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/medicines/view`](https://api.evitalrx.in/v1/doctor/medicines/view)

#### Request Body

| Name                                           | Type   | Description                                                                                                                                                                                                                                                                                                    |
| ---------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>       | String | Authentication Token                                                                                                                                                                                                                                                                                           |
| medicine\_id<mark style="color:red;">\*</mark> | String | Unique id of the product                                                                                                                                                                                                                                                                                       |
| medicine\_ids                                  | String | <p>Stringified Array of medicine\_ids.​</p><p></p><p><strong>medicine\_id</strong> param is optional, if <strong>medicine\_ids</strong> param is passed.​</p><p></p><p>medicine\_ids should contain at least 2 medicine\_ids.​ </p><p></p><p>i.e.\["z5s5a+e/Cj4ip7sUl2zJFQ==", "otUfMtG4nIpWSc+oWoX7Lw=="]</p> |

{% tabs %}
{% tab title="200: OK Product Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-03-09 19:01:02",
    "data": [
        {
            "content": "Losartan (50mg)",
            "how_medicine_works": "Ltk 50 Tablet is an angiotensin receptor blocker (ARB). It relaxes blood vessel by blocking the action of a chemical that usually makes blood vessels tighter. This lowers the blood pressure, allowing the blood to flow more smoothly to different organs and the heart to pump more efficiently.",
            "how_to_use": "Take this medicine in the dose and duration as advised by your doctor. Swallow it as a whole. Do not chew, crush or break it. Ltk 50 Tablet may be taken with or without food, but it is better to take it at a fixed time.",
            "id": "y8P5ElKQqfn/Dkb0uhE9Sg==",
            "medicine_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/default.jpg",
            "is_rx_required": 0,
            "dosage_type": "tablet",
            "medicine_name": "Ltk 50 Tablet",
            "mrp": 23.5,
            "packing_size": "1 Strip of  10 Tablet",
            "pack_size": "10 Tablet",
            "packing": "Strip",
            "size": 10,
            "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
            "side_effects": " Common   Dizziness  Back pain  Sinus inflammation  Increased potassium level in blood  ",
            "medicine_category": "drug",
            "loose_quantity": 1022,
            "sale_discount": 15,
            "strip_quantity": 102,
            "is_inventory_available": "yes",
            "price": 23.5,
            "sell_in_loose": "yes",
            "warning_details": [
                {
                    "liver": "Ltk 50 Tablet should be used with caution in patients with liver disease. Dose adjustment of Ltk 50 Tablet may be needed. Please consult your doctor.<br>Use of Ltk 50 Tablet is not recommended in patients with severe liver disease."
                },
                {
                    "alcohol": "Taking Losartan with alcohol may excessively lower the blood pressure."
                },
                {
                    "driving": "It is not known whether Ltk 50 Tablet alters the ability to drive. Do not drive if you experience any symptoms that affect your ability to concentrate and react."
                },
                {
                    "kidney": "Ltk 50 Tablet is safe to use in patients with kidney disease. No dose adjustment of Ltk 50 Tablet is recommended.<br>However, talk to your doctor if you have any underlying kidney disease. Regular monitoring of blood pressure is recommended for better dose adjustment."
                },
                {
                    "lactation": "Ltk 50 Tablet is probably safe to use during lactation.  Limited human data suggests that the drug does not represent a significant risk to the baby."
                },
                {
                    "pregnancy": "Ltk 50 Tablet is unsafe to use during pregnancy.<br>There is positive evidence of human fetal risk, but the benefits from use in pregnant women may be acceptable despite the risk, for example in life-threatening situations. Please consult your doctor."
                }
            ],
            "salt_content_id": "KOKzk7o+BiY7KaYIIL5JDg=="
        }
    ]
}
```

{% endtab %}

{% tab title="200: OK Multiple Medicines Response" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-03-09 19:02:40",
    "data": [
        {
            "content": "Hydrochlorothiazide (12.5mg) + Losartan (50mg)",
            "how_medicine_works": "LTK-H Tablet is a combination of two medicines: Losartan and Hydrochlorothiazide, which lowers the blood pressure effectively. Losartan is an angiotensin receptor blocker (ARB). It works by blocking the hormone angiotensin thereby relaxing blood vessels. This allows the blood to flow more smoothly and the heart to pump more efficiently. Hydrochlorothiazide is a diuretic that removes extra water and certain electrolytes from the body. Over time it also relaxes blood vessels and improves blood flow.",
            "how_to_use": "Take this medicine in the dose and duration as advised by your doctor. Swallow it as a whole. Do not chew, crush or break it. LTK-H Tablet may be taken with or without food, but it is better to take it at a fixed time.",
            "id": "vjalpzMV0E33BLwzzLR6fQ==",
            "medicine_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/default.jpg",
            "is_rx_required": 1,
            "dosage_type": "tablet",
            "medicine_name": "LTK-H Tablet",
            "mrp": 36.1,
            "packing_size": "1 Strip of  10 Tablet",
            "pack_size": "10 Tablet",
            "packing": "Strip",
            "size": 10,
            "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
            "side_effects": " Common   Nausea  Taste change  Stomach upset  Diarrhea  Headache  Dizziness  Weakness  Decreased blood pressure  Increased blood uric acid  Increased blood lipid level  Glucose intolerance  Electrolyte imbalance  ",
            "medicine_category": "drug",
            "loose_quantity": 344,
            "sale_discount": 0,
            "strip_quantity": 34,
            "is_inventory_available": "yes",
            "price": 36.1,
            "sell_in_loose": "yes",
            "warning_details": [
                {
                    "liver": "LTK-H Tablet should be used with caution in patients with liver disease. Dose adjustment of LTK-H Tablet may be needed. Please consult your doctor."
                },
                {
                    "alcohol": "Taking Hydrochlorothiazide with alcohol may have additive effects in lowering blood pressure. You may experience headache, dizziness, lightheadedness, fainting, and/or changes in pulse or heart rate."
                },
                {
                    "driving": "LTK-H Tablet may make you feel dizzy, sleepy, tired, or decrease alertness. If this happens, do not drive."
                },
                {
                    "kidney": "LTK-H Tablet should be used with caution in patients with severe kidney disease. Dose adjustment of LTK-H Tablet may be needed. Please consult your doctor.<br>Use of LTK-H Tablet is not recommended in patients with severe kidney disease."
                },
                {
                    "lactation": "LTK-H Tablet is probably safe to use during lactation.  Limited human data suggests that the drug does not represent a significant risk to the baby."
                },
                {
                    "pregnancy": "LTK-H Tablet is unsafe to use during pregnancy.<br>There is positive evidence of human fetal risk, but the benefits from use in pregnant women may be acceptable despite the risk, for example in life-threatening situations. Please consult your doctor."
                }
            ],
            "salt_content_id": "KOKzk7o+BiY7KaYIIL5JDg=="
        },
        {
            "content": "Losartan (50mg)",
            "how_medicine_works": "Ltk 50 Tablet is an angiotensin receptor blocker (ARB). It relaxes blood vessel by blocking the action of a chemical that usually makes blood vessels tighter. This lowers the blood pressure, allowing the blood to flow more smoothly to different organs and the heart to pump more efficiently.",
            "how_to_use": "Take this medicine in the dose and duration as advised by your doctor. Swallow it as a whole. Do not chew, crush or break it. Ltk 50 Tablet may be taken with or without food, but it is better to take it at a fixed time.",
            "id": "y8P5ElKQqfn/Dkb0uhE9Sg==",
            "medicine_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/default.jpg",
            "is_rx_required": 0,
            "dosage_type": "tablet",
            "medicine_name": "Ltk 50 Tablet",
            "mrp": 23.5,
            "packing_size": "1 Strip of  10 Tablet",
            "pack_size": "10 Tablet",
            "packing": "Strip",
            "size": 10,
            "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
            "side_effects": " Common   Dizziness  Back pain  Sinus inflammation  Increased potassium level in blood  ",
            "medicine_category": "drug",
            "loose_quantity": 1022,
            "sale_discount": 15,
            "strip_quantity": 102,
            "is_inventory_available": "yes",
            "price": 23.5,
            "sell_in_loose": "yes",
            "warning_details": [
                {
                    "liver": "Ltk 50 Tablet should be used with caution in patients with liver disease. Dose adjustment of Ltk 50 Tablet may be needed. Please consult your doctor.<br>Use of Ltk 50 Tablet is not recommended in patients with severe liver disease."
                },
                {
                    "alcohol": "Taking Losartan with alcohol may excessively lower the blood pressure."
                },
                {
                    "driving": "It is not known whether Ltk 50 Tablet alters the ability to drive. Do not drive if you experience any symptoms that affect your ability to concentrate and react."
                },
                {
                    "kidney": "Ltk 50 Tablet is safe to use in patients with kidney disease. No dose adjustment of Ltk 50 Tablet is recommended.<br>However, talk to your doctor if you have any underlying kidney disease. Regular monitoring of blood pressure is recommended for better dose adjustment."
                },
                {
                    "lactation": "Ltk 50 Tablet is probably safe to use during lactation.  Limited human data suggests that the drug does not represent a significant risk to the baby."
                },
                {
                    "pregnancy": "Ltk 50 Tablet is unsafe to use during pregnancy.<br>There is positive evidence of human fetal risk, but the benefits from use in pregnant women may be acceptable despite the risk, for example in life-threatening situations. Please consult your doctor."
                }
            ],
            "salt_content_id": "KOKzk7o+BiY7KaYIIL5JDg=="
        }
    ]
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid medicine key",
    "datetime": "2022-12-07 11:15:44",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Get Inventory Status

To get status of the items in your inventory.

### <img src="https://static.vecteezy.com/system/resources/thumbnails/018/930/572/small/youtube-logo-youtube-icon-transparent-free-png.png" alt="" data-size="line"> [Before Fetching Stock Details, Add Medicines to Your Inventory](https://youtu.be/v29o6YEsocc?si=WM0nJ2BmAuye7tNE)

### Inventory Status:

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/medicines/get_inventory_status`](https://api.evitalrx.in/v1/doctor/medicines/get_inventory_status)

#### Request Body

| Name                                     | Type   | Description                                                                                                                                                                                  |
| ---------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark> | String | Authentication Token                                                                                                                                                                         |
| medicine\_ids                            | String | <p>Stringified Array of medicine\_ids.​</p><p></p><p>medicine\_ids should contain at least 2 medicine\_ids.​ </p><p></p><p>i.e.\["z5s5a+e/Cj4ip7sUl2zJFQ==", "otUfMtG4nIpWSc+oWoX7Lw=="]</p> |

{% tabs %}
{% tab title="200: OK Product Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-08 16:50:09",
    "data": [
        {
            "medicine_id": "otUfMtG4nIpWSc+oWoX7Lw==",
            "chemist_id": "pR/skynRizeVxF1blGRVMw==",
            "quantity": 1380, // Current Quantity
            "mrp": 24,
            "lock_discount": "no", // Default discount if any
            "sell_in_loose": "yes",
            "cess_percentage": 0,
            "gst_percentage": 12
        }
    ]
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid medicine key",
    "datetime": "2022-12-07 11:15:44",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Get Inventory Items

To get all items in your inventory.

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/medicines/get_inventory_items`](https://api.evitalrx.in/v1/doctor/medicines/get_inventory_items)

#### Request Body

| Name                                     | Type   | Description          |
| ---------------------------------------- | ------ | -------------------- |
| apikey<mark style="color:red;">\*</mark> | String | Authentication Token |

{% tabs %}
{% tab title="200: OK Product Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-08 16:52:57",
    "data": [
        {
            "medicine_id": "ZnsQl586DmR/ANT3aLdM4g==",
            "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
            "size": 10,
            "packing_size": "10 tablets in 1 strip",
            "mrp": 23.5,
            "medicine_name": "Ltk 50 Tablet",
            "quantity": 100,
            "content": "Losartan (50mg)",
            "dosage_type": "tablet"
        },
        {
            "medicine_id": "tx/SXzkiaaHjYXAFRCvN8Q==",
            "manufacturer_name": "GlaxoSmithKline Consumer Healthcare",
            "size": 1,
            "packing_size": "1 Strip of 15 tablets",
            "mrp": 30.24,
            "medicine_name": "Crocin 650mg Tablet",
            "quantity": 10,
            "content": "Paracetamol / Acetaminophen (125mg)",
            "dosage_type": ""
        },
        {
            "medicine_id": "6+ZMmabCAM//aQXT/8hebg==",
            "manufacturer_name": "Abaris Healthcare",
            "size": 1,
            "packing_size": "60 ml in 1 bottle",
            "mrp": 26,
            "medicine_name": "Corflam S Suspension",
            "quantity": 10,
            "content": "Ibuprofen (NA) + Paracetamol / Acetaminophen (NA)",
            "dosage_type": ""
        },
        {
            "medicine_id": "otUfMtG4nIpWSc+oWoX7Lw==",
            "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
            "size": 15,
            "packing_size": "1 Strip of  15 Tablet",
            "mrp": 32.9,
            "medicine_name": "LTK-H Tablet 5",
            "quantity": 1380,
            "content": "",
            "dosage_type": ""
        }
    ]
}
```

{% endtab %}
{% endtabs %}


# Get Alternatives

To get Medicine alternatives on the basis of the drug composition

## Get Alternatives

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/medicines/get_alternatives`](https://api.evitalrx.in/v1/doctor/medicines/get_alternatives)

The API gives alternatives available of the Product.

#### Request Body

| Name                                           | Type   | Description                             |
| ---------------------------------------------- | ------ | --------------------------------------- |
| apikey<mark style="color:red;">\*</mark>       | String | Authentication Token                    |
| medicine\_id<mark style="color:red;">\*</mark> | String | Unique id of the product                |
| content<mark style="color:red;">\*</mark>      | String | Content/Drug of the medicine\_id passed |

{% tabs %}
{% tab title="200: OK Products Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-07 11:17:37",
    "data": [
        {
            "dosage_type": "tablet",
            "medicine_name": "Coldmark Tablet",
            "content": "Paracetamol (500mg) + Phenylephrine Hydrochloride (5mg) + Chlorpheniramine Maleate (2mg)",
            "mrp": "45",
            "medicine_id": "q+td7wYsWZpHq87j7r8mbQ==",
            "packing_size": "1 Strip of  10 Tablet",
            "size": "10",
            "manufacturer_name": "Aerozest Life Science",
            "medicine_type": "drug",
            "gst_percentage": "12",
            "available_for_patient": "yes",
            "discontinued": "no",
            "loose_quantity": 0,
            "sale_discount": 0,
            "strip_quantity": 0,
            "is_inventory_available": "no"
        },
        {
            "dosage_type": "tablet",
            "medicine_name": "Koldstat Tablet",
            "content": "Paracetamol (500mg) + Phenylephrine Hydrochloride (5mg) + Chlorpheniramine Maleate (2mg)",
            "mrp": "50",
            "medicine_id": "kQw3reT/EVJg77T2Od3SZQ==",
            "packing_size": "1 Strip of  10 Tablet",
            "size": "10",
            "manufacturer_name": "Astra Idl Limited",
            "medicine_type": "drug",
            "gst_percentage": "12",
            "available_for_patient": "yes",
            "discontinued": "no",
            "loose_quantity": 0,
            "sale_discount": 0,
            "strip_quantity": 0,
            "is_inventory_available": "no"
        },
        {
            "dosage_type": "tablet",
            "medicine_name": "Ultracold Tablet",
            "content": "Paracetamol (500mg) + Phenylephrine Hydrochloride (5mg) + Chlorpheniramine Maleate (2mg)",
            "mrp": "50",
            "medicine_id": "zs1OJIrjjpi4l8t1WAXJmg==",
            "packing_size": "1 Strip of  10 Tablet",
            "size": "10",
            "manufacturer_name": "SPL Healthcare India Pvt. Ltd",
            "medicine_type": "drug",
            "gst_percentage": "12",
            "available_for_patient": "yes",
            "discontinued": "no",
            "loose_quantity": 0,
            "sale_discount": 0,
            "strip_quantity": 0,
            "is_inventory_available": "no"
        },
        {
            "dosage_type": "tablet",
            "medicine_name": "Power 999 Tablet",
            "content": "Paracetamol (500mg) + Phenylephrine Hydrochloride (5mg) + Chlorpheniramine Maleate (2mg)",
            "mrp": "35",
            "medicine_id": "5wpJHqB9SMuJq/wSbEaqmA==",
            "packing_size": "1 Strip of  10 Tablet",
            "size": "10",
            "manufacturer_name": "Medico Labs",
            "medicine_type": "drug",
            "gst_percentage": "12",
            "available_for_patient": "yes",
            "discontinued": "no",
            "loose_quantity": 0,
            "sale_discount": 0,
            "strip_quantity": 0,
            "is_inventory_available": "no"
        },
        {
            "dosage_type": "tablet",
            "medicine_name": "Dpc Plus Tablet",
            "content": "Paracetamol (500mg) + Phenylephrine Hydrochloride (5mg) + Chlorpheniramine Maleate (2mg)",
            "mrp": "28.59",
            "medicine_id": "45ZNMjRkR0YRpo6zUdnEdw==",
            "packing_size": "1 Strip of  10 Tablet",
            "size": "10",
            "manufacturer_name": "Sunij Pharma Pvt Ltd",
            "medicine_type": "drug",
            "gst_percentage": "12",
            "available_for_patient": "yes",
            "discontinued": "no",
            "loose_quantity": 0,
            "sale_discount": 0,
            "strip_quantity": 0,
            "is_inventory_available": "no"
        }
    ]
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "\"Medicine Code\" is required",
    "datetime": "2022-12-07 11:19:46",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Get Product Batch

To get item batches in your inventory by unique medicine Id.

## Product Batches

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/medicines/get_batches`](https://api.evitalrx.in/v1/doctor/medicines/get_batches)

Get Product Batches available in your inventory by Medicine Key.

#### Request Body

| Name                                           | Type   | Description              |
| ---------------------------------------------- | ------ | ------------------------ |
| apikey<mark style="color:red;">\*</mark>       | String | Authentication Token     |
| medicine\_id<mark style="color:red;">\*</mark> | String | Unique id of the product |

{% tabs %}
{% tab title="200: OK Batches Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-08 15:11:10",
    "data": [
        {
            "medicine_id": "otUfMtG4nIpWSc+oWoX7Lw==",
            "id": "o5+9ckBfrNDerV+gyQmOCQ==", // Batch ID
            "batch": "ABC",
            "expiry": "2025-12-01",
            "mrp": 24,
            "price_to_retailer": 15,
            "quantity": 1230,
            "expiry_label": "12/25"
        },
        {
            "medicine_id": "otUfMtG4nIpWSc+oWoX7Lw==",
            "id": "/GuD64lAIn9WMiGQGFUuaA==",
            "batch": "PQR",
            "expiry": "2026-12-01",
            "mrp": 24,
            "price_to_retailer": 15,
            "quantity": 150,
            "expiry_label": "12/26"
        }
    ]
}
```

{% endtab %}

{% tab title="200: OK No Batches found" %}

```json
{
    "status_code": "0",
    "status_message": "No batches found for medicine",
    "datetime": "2022-12-07 11:23:46",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid medicine key",
    "datetime": "2022-12-07 11:24:25",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Get Expired Batches

To get expired batches in your inventory by unique medicine Id.

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/medicines/get_expire_batch`](https://api.evitalrx.in/v1/doctor/medicines/get_expire_batch)

Get Expired Batches available in your inventory by Medicine Key.

#### Request Body

| Name                                           | Type   | Description                                                                                                                       |
| ---------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>       | String | Authentication Token                                                                                                              |
| medicine\_id<mark style="color:red;">\*</mark> | String | Unique id of the product                                                                                                          |
| expiry<mark style="color:red;">\*</mark>       | String | <p>Date of Expiry in YYYY-MM-DD format. </p><p></p><p>The API will find the medicines which have expiry less than this date. </p> |

{% tabs %}
{% tab title="200: OK Batches Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-08 15:11:10",
    "data": [
        {
            "medicine_id": "otUfMtG4nIpWSc+oWoX7Lw==",
            "id": "o5+9ckBfrNDerV+gyQmOCQ==", // Batch ID
            "batch": "ABC",
            "expiry": "2025-12-01",
            "mrp": 24,
            "price_to_retailer": 15,
            "quantity": 1230,
            "expiry_label": "12/25"
        },
        {
            "medicine_id": "otUfMtG4nIpWSc+oWoX7Lw==",
            "id": "/GuD64lAIn9WMiGQGFUuaA==",
            "batch": "PQR",
            "expiry": "2026-12-01",
            "mrp": 24,
            "price_to_retailer": 15,
            "quantity": 150,
            "expiry_label": "12/26"
        }
    ]
}
```

{% endtab %}

{% tab title="200: OK No Batches found" %}

```json
{
    "status_code": "0",
    "status_message": "No batches found for medicine",
    "datetime": "2022-12-07 11:23:46",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid medicine key",
    "datetime": "2022-12-07 11:24:25",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Request Product

To request a product, which is not available at eVitalRx.

## Request Product

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/medicines/request_medicine`](https://api.evitalrx.in/v1/doctor/medicines/request_medicine)

#### Request Body

<table><thead><tr><th width="285">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>apikey<mark style="color:red;">*</mark></td><td>String</td><td>Authentication Token</td></tr><tr><td>medicine_name<mark style="color:red;">*</mark></td><td>String</td><td>Product Name</td></tr><tr><td>gtin_number</td><td>String</td><td>Product's GTIN Number</td></tr><tr><td>hsn_code</td><td>String</td><td><p>Product's HSN Number</p><p>Min Length: 3</p><p>Max Length: 8</p></td></tr><tr><td>manufacturer_name<mark style="color:red;">*</mark></td><td>String</td><td>Product's Manufacturer Name</td></tr><tr><td>packaging<mark style="color:red;">*</mark></td><td>String</td><td><p>Product's Packaging</p><p></p><p>Packaging: strip, bottle, packet, piece, tube, etc.</p><p></p><p>Examples: Himalaya Cream is 100gm.</p><p>Then pass <strong>"packaging":  "tube"</strong></p></td></tr><tr><td>mrp<mark style="color:red;">*</mark></td><td>Number</td><td>Price of the Product</td></tr><tr><td>unit</td><td>String</td><td><p>Unit for the measurement of the Product</p><p></p><p>Units: gm, ml, tablets, capsules, etc.</p><p></p><p>Examples: Himalaya Cream is 100gm.</p><p>Then pass <strong>"unit":  "gm"</strong></p></td></tr><tr><td>weightage</td><td>Number</td><td><p>Weightage of the Product:</p><p></p><p>Examples: Himalaya Cream is 100gm.</p><p>pass <strong>"weightage":  100</strong></p></td></tr><tr><td>gst_percentage</td><td>Number</td><td><p>GST Percentage of the Product:</p><p>Valid values: 0, 5, 12, 18, 28</p></td></tr><tr><td>os</td><td>String</td><td>web</td></tr><tr><td>image<mark style="color:red;">*</mark></td><td>File</td><td>Back photo of the Product.</td></tr><tr><td>image<mark style="color:red;">*</mark></td><td>File</td><td>Front photo of the Product.</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-06 17:30:56",
    "data": {
        "medicine_id": "sWCoyp2jvgEx9ul1CBOuFA==",
        "medicine_type": "",
        "packing_size": "1 Tube of 100 Gm",
        "pack_size": "100 Gm",
        "manufacturer_name": "",
        "hsn_code": "",
        "gst_percentage": 0,
        "gtin_number": "",
        "mrp": 100,
        "medicine_name": "Himalaya Fairness Cream"
    }
}
```

{% endtab %}

{% tab title="200: OK Images not found" %}

```json
{
    "status_code": "0",
    "status_message": "Medicine images not found",
    "datetime": "2022-12-06 17:31:17",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "\"manufacturer_name\" is not allowed to be empty",
    "datetime": "2022-12-06 17:32:05",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Branded to Generic

To get alternate products by unique medicine Id.

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/medicines/branded_to_generic`](https://api.evitalrx.in/v1/doctor/medicines/branded_to_generic)

Get Alternate medicines with the best in terms of Expiry, Margin, and Price.

#### Request Body

| Name                                            | Type              | Description                                                                                                                                                                                                                   |
| ----------------------------------------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>        | String            | Authentication Token                                                                                                                                                                                                          |
| medicine\_ids<mark style="color:red;">\*</mark> | Stringified Array | <p>Array of medicine\_ids in the form data</p><p></p><p>\["eGMwtMdst4OkfNrNoAFxRw",  "77eruTI3h1JUg4RqaV20JQ=="]</p>                                                                                                          |
| order\_by                                       | String            | <p>must be one of <strong>epm, mep, pem</strong></p><p></p><p><strong>epm</strong>: Expiry -> Price -> Margin</p><p><strong>mep</strong>: Margin -> Expiry -> Price</p><p><strong>pem</strong>: Price -> Expiry -> Margin</p> |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-11-17 10:30:42",
    "data": {
        "eGMwtMdst4OkfNrNoAFxRw==": { // medicine ID
            "data": [],
            "message": "alternative not found",
            "status": 0
        },
        "77eruTI3h1JUg4RqaV20JQ==": {
            "data": [
                {
                    "mrp": 204.97,
                    "batch": "C2VAV19",
                    "expiry": "11-23",
                    "packing_size": "1 Bottle of  5 Ml",
                    "medicine_name": "Moxicip D Eye Drop",
                    "manufacturer_name": "Cipla Ltd",
                    "margin_percentage": "23.20",
                    "medicine_id": "M1AGVZYv89bWlk7/oWbG4Q=="
                }
            ],
            "message": "success",
            "status": 1
        }
    }
}
```

{% endtab %}

{% tab title="200: OK No Medicines found" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-08 16:20:45",
    "data": {
        "1iFlObGAoedKDQW27+2EQw==": {
            "data": [],
            "message": "alternative not found",
            "status": 0
        }
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid medicine key",
    "datetime": "2022-12-07 11:24:25",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Search Content

To search content

## Search Contents

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/medicines/content_search`](https://api.evitalrx.in/v1/doctor/medicines/content_search)

#### Request Body

| Name                                      | Type   | Description             |
| ----------------------------------------- | ------ | ----------------------- |
| content<mark style="color:red;">\*</mark> | String | Content to be searched. |
| apikey<mark style="color:red;">\*</mark>  | String | Authentication token    |

{% tabs %}
{% tab title="200 Products Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-05-15 18:54:34",
    "data": {
        "results": [
            {
                "content": "Paradichlorobenzene (4gm)",
                "id": "TmOVsxtb5BlFs4px88ReRQ=="
            },
            {
                "content": "Paradichlorobenzene (162.5mg)",
                "id": "c7OJPXkeXCg/8pa130GbTg=="
            },
            {
                "content": "Paradichlorobenzene (320mg)",
                "id": "VcelI1X0zp2urnxD6sbnJw=="
            },
            {
                "content": "Propyl Paraben (180mcg)",
                "id": "vY/1wcav8EcVHA0otFK67Q=="
            },
            {
                "content": "Propyl Paraben (850.0mg)",
                "id": "0K50lD2ZYe6ZCitNDtfJZQ=="
            },
            {
                "content": "Paradichlorobenzene (0.38%w/w)",
                "id": "+Du4PAgn4slRMnpBsqaYPw=="
            },
            {
                "content": "Para Amino Benzoic Acid (500mg)",
                "id": "Ez+RTplCJoRJpyEHzxaAPQ=="
            },
            {
                "content": "Propyl Paraben (1.5gm)",
                "id": "6UPouwJuJnDVRDEHz5Zjyw=="
            },
            {
                "content": "Propyl Paraben (600000iu)",
                "id": "TRTCy6rIpJjr3JprQmITZA=="
            },
            {
                "content": "Propyl Paraben (0.31mg)",
                "id": "I3XKPhvcLdUgojwrUhlMuw=="
            }
        ]
    }
}
```

{% endtab %}

{% tab title="200: OK No Products found" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-05-15 18:54:46",
    "data": {
        "results": []
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "content is required",
    "datetime": "2023-05-15 18:54:59",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Add Favorite Medicine

This API is for doctors to add their favorite medicine.

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/medicines/favorite/add`](https://api.evitalrx.in/v1/doctor/medicines/favorite/add)

#### Request Body

| Name                                     | Type   | Description                            |
| ---------------------------------------- | ------ | -------------------------------------- |
| apikey<mark style="color:red;">\*</mark> | String | Authentication Token                   |
| medicine\_ids                            | String | Form data Array containing medicine id |

{% tabs %}
{% tab title="200: OK Product Retrieved Successfully" %}

```json


{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2024-09-23 16:35:10",
    "data": {}
}

```

{% endtab %}
{% endtabs %}


# Patients

**Watch a video.**

{% embed url="<https://www.loom.com/share/e17072e9445240f3bb47d923fa2b93ed>" %}

{% embed url="<https://www.loom.com/share/df47215da3ae442a9e96444b0503dc74>" %}


# Add Patient

To add patients with mobile number, name and address.

### <img src="https://static.vecteezy.com/system/resources/thumbnails/018/930/572/small/youtube-logo-youtube-icon-transparent-free-png.png" alt="" data-size="line"> [Learn How to Add a Patient or Family Member](https://youtu.be/voc4bcyhZ_8?si=Nf_SpvsQX9vVo26v)

## Add Patient

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/patients/add`](https://api.evitalrx.in/v1/doctor/patients/add)

#### Request Body

| Name                                          | Type   | Description                                                                                                                               |
| --------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| mobile<mark style="color:red;">\*</mark>      | Number | Mobile number of Patient                                                                                                                  |
| first\_name<mark style="color:red;">\*</mark> | String | First name of Patient                                                                                                                     |
| last\_name<mark style="color:red;">\*</mark>  | String | Last name of Patient                                                                                                                      |
| zipcode                                       | Number | Zipcode of the patient                                                                                                                    |
| apikey<mark style="color:red;">\*</mark>      | String | Authentication token                                                                                                                      |
| dob                                           | String | <p>Date of Birth of the Patient </p><p>Format: YYYY-MM-DD</p>                                                                             |
| gender                                        | String | Gender of the Patient.Must be one of **male, female, other**.                                                                             |
| blood\_group                                  | String | Blood Group of the Patient                                                                                                                |
| custom\_fields                                | Object | <p>Key value pairs of attribute\_key and it's value.<br>For ex:<br>{"patient\_ipd\_id": "IPD1234", "patient\_mapped\_id": "PMID9876"}</p> |

{% tabs %}
{% tab title="200: OK Patient added successfully." %}

```json
{
    "status_code": "1",
    "status_message": "Patient registered successfully.",
    "datetime": "2025-01-29 11:51:06",
    "version": "1.1.17",
    "data": {
        "patient_id": "iQJtsq0ypLhX11C0NCHQig==" // Uniquue ID of the Patient
    }
}
```

{% endtab %}

{% tab title="200: OK Patient add Failed" %}

```json
{
    "status_code": "0",
    "status_message": "This Mobile is already exist.",
    "datetime": "2022-12-07 12:23:41",
    "data": {
        "patient_id": "qAj4hhwefVxwuZX9nFxHkQ=="
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Failed" %}

```json
{
    "status_code": "0",
    "status_message": "\"mobile\" is required",
    "datetime": "2022-12-07 12:25:35",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Get Patient

To get the patient details

## Get Patient

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/patients/view`](https://api.evitalrx.in/v1/doctor/patients/view)

#### Request Body

| Name                                          | Type    | Description                                                                                                                   |
| --------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
| patient\_id<mark style="color:red;">\*</mark> | String  | Unique id of the Patient                                                                                                      |
| apikey<mark style="color:red;">\*</mark>      | String  | Authentication token                                                                                                          |
| mobile<mark style="color:red;">\*</mark>      | String  | Either patient\_id or mobile should be passed.                                                                                |
| show\_family\_list                            | Boolean | <p>Default: false</p><p></p><p>If passed true then patient's family member details will be added in the response. </p><p></p> |

{% tabs %}
{% tab title="200: OK Patient retrived successfully" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2024-01-25 16:07:36",
    "data": [
        {
            "firstname": "Manav",
            "lastname": "Patel",
            "zipcode": "380005",
            "mobile": "9846251658",
            "family_member_list": [ // family members if any
                {
                    "id": "dXuOGHX5xlrfXQkkByAX3g==",
                    "firstname": "Poojan",
                    "lastname": "Mehta",
                    "zipcode": "380005",
                    "mobile": "9887878787"
                },
                {
                    "id": "dXuOGHX5xlrfXQkkByAX3g==",
                    "firstname": "Jay",
                    "lastname": "Patel",
                    "zipcode": "",
                    "mobile": ""
                }
            ],
            "patient_id": "dXuOGHX5xlrfXQkkByAX3g==",
            "custom_fields": { // addtionaly fields related to patient
                "patient_ipd_id": "IPD1234",
                "patient_mapped_id": "PMID9876"
            }
        }
    ]
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "\"patient_id\" is required",
    "datetime": "2022-12-07 12:32:04",
    "data": null
}
```

{% endtab %}
{% endtabs %}

## Get Patient

<mark style="color:green;">`POST`</mark> `https://api.evitalrx.in/v1/doctor/patients/view`

#### Request Body

| Name                                          | Type    | Description  |
| --------------------------------------------- | ------- | ------------ |
| patient\_id<mark style="color:red;">\*</mark> | String  | 1A62EQMlDx8t |
| apikey<mark style="color:red;">\*</mark>      | String  | V6oBy7oMFZbX |
| mobile<mark style="color:red;">\*</mark>      | String  | AsD3PhN0mKYs |
| show\_family\_list                            | Boolean | 2dHrkQuS9UDT |


# Update Patient

To Update patient with mobile number, name and address.

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/patients/update`](https://api.evitalrx.in/v1/doctor/patients/update)

#### Request Body

| Name                                          | Type   | Description                                                   |
| --------------------------------------------- | ------ | ------------------------------------------------------------- |
| patient\_id<mark style="color:red;">\*</mark> | String | Unique ID of the patient.                                     |
| first\_name<mark style="color:red;">\*</mark> | String | First name of Patient                                         |
| last\_name<mark style="color:red;">\*</mark>  | String | Last name of Patient                                          |
| zipcode                                       | Number | Zipcode of the patient                                        |
| apikey<mark style="color:red;">\*</mark>      | String | Authentication token                                          |
| dob                                           | String | <p>Date of Birth of the Patient </p><p>Format: YYYY-MM-DD</p> |
| gender                                        | String | Gender of the Patient.Must be one of **male, female, other**. |
| blood\_group                                  | String | Blood Group of the Patient                                    |

{% tabs %}
{% tab title="200: OK Patient updated successfully." %}

```json
{
    "status_code": "1",
    "status_message": "Patient updated successfully",
    "datetime": "2022-12-08 17:27:43",
    "data": {
        "patient_id": "haaLvntZX7KmadCtJa314w=="
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Failed" %}

```json
{
    "status_code": "0",
    "status_message": "\"patient_id\" is required",
    "datetime": "2022-12-07 12:25:35",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Add Patient family member

To add family member of the patient

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/patients/add_family_member`](https://api.evitalrx.in/v1/doctor/patients/add_family_member)

#### Request Body

| Name                                                      | Type   | Description                                                                                                                                                                                                                                 |
| --------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>                  | String | Authentication token                                                                                                                                                                                                                        |
| mobile                                                    | Number | Mobile number of Patient's family member                                                                                                                                                                                                    |
| first\_name<mark style="color:red;">\*</mark>             | String | First name of Patient's family member                                                                                                                                                                                                       |
| last\_name<mark style="color:red;">\*</mark>              | String | Last name of Patient's family member                                                                                                                                                                                                        |
| dob<mark style="color:red;">\*</mark>                     | String | <p>Date of Birth of the Patient</p><p>Format: YYYY-MM-DD</p>                                                                                                                                                                                |
| patient\_id<mark style="color:red;">\*</mark>             | String | Key of the Patient whose family member is going to be added.                                                                                                                                                                                |
| blood\_group                                              | String | Blood Group of the Patient                                                                                                                                                                                                                  |
| relation<mark style="color:red;">\*</mark>                | String | <p>Relation with the Parent Patient. Possible values are: </p><p>\[ "Brother", "Sister", "Father", "Mother", "Son", "Daughter", "Grand\_Father", "Grand\_Mother", "Uncle", "Aunt", "Wife", "Husband", "Grand\_Daughter", "Grand\_Son" ]</p> |
| parent\_patient\_mobile<mark style="color:red;">\*</mark> | String | Either pass the Parent patient's Mobile Or Patient ID                                                                                                                                                                                       |

{% tabs %}
{% tab title="200 Patient added successfully." %}

```json
{
    "status_code": "1",
    "status_message": "Family member added successfully",
    "datetime": "2022-12-23 11:36:23",
    "data": {
        "relation": "Brother",
        "firstname": "Manav",
        "lastname": "Chauhan",
        "mobile": "",
        "patient_family_member_id": "jtyjX7EP2GPrTdF+bFGBww==",
        "blood_group": "B+",
        "dob": "2001-10-14",
        "id": "m3nc908treoPV7VLHehTAA==",
        "profile_picture": ""
    }
}
```

{% endtab %}

{% tab title="200: OK Patient added Failed" %}

```
{
    "status_code": "0",
    "status_message": "This mobile number is already exist as a patient",
    "datetime": "2022-12-23 11:39:53",
    "data": {}
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "\"first_name\" is required",
    "datetime": "2022-12-23 11:40:24",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Orders

**Watch a video.**

{% embed url="<https://www.loom.com/share/e07ef49f6207430f932aee202f3aac65>" %}


# Push Prescription

To push prescription with items and its quantity.

## Push Prescription

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/orders/push_prescription`](https://api.evitalrx.in/v1/doctor/orders/push_prescription)

#### Request Body

| Name                                          | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| --------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| patient\_id<mark style="color:red;">\*</mark> | String | <p>Id to uniquely identify the patient for whom the order is placed. </p><p></p><p>Pass blank ('') if mobile and patient\_name is passed in the request body. it will automatically create the patient.</p>                                                                                                                                                                                                                                                            |
| items<mark style="color:red;">\*</mark>       | Array  | <p>List of items with quantity (in pills) and medicine\_id and discount\_percentage. Max 99% discount is allowed.</p><p></p><p>dosage details can be passed through directions in 1-1-1-1 (morning-noon-evening-night) format. </p><p></p><p>Not required, if Prescription is Passed in the <strong>image</strong> param. </p><p></p><p>i.e. \[{ "medicine\_id":"haaLvntZX7KmadCtJa314w==", "quantity":10, "discount\_percentage": 5, "directions": "0-1-0.5-2" }]</p> |
| image                                         | File   | Image of the prescription, if provided items will not be required.                                                                                                                                                                                                                                                                                                                                                                                                     |
| apikey<mark style="color:red;">\*</mark>      | String | Authentication token                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| patient\_name                                 | String | <p>Name of the Patient. </p><p></p><p>Only required if patient\_id is passed blank. </p>                                                                                                                                                                                                                                                                                                                                                                               |
| doctor\_name                                  | String | <p>Name of the Prescribing doctor <br></p>                                                                                                                                                                                                                                                                                                                                                                                                                             |
| batch\_with                                   | String | <p>Must be <strong>yes</strong> or <strong>no</strong><br><strong>yes</strong> will Auto feed the batches based on the shortest expiry & stock availability<br><strong>no</strong> will keep the batch details empty</p>                                                                                                                                                                                                                                               |
| delivery\_type                                | String | Must be one of **pickup** or **delivery**.                                                                                                                                                                                                                                                                                                                                                                                                                             |
| remark                                        | String | Note for the Prescription.                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| parent\_patient\_id                           | String | If billing for family member, then pass parent patient's ID here.                                                                                                                                                                                                                                                                                                                                                                                                      |
| shipping                                      | Number | Delivery or Extra charges to be added in the order. default: 0                                                                                                                                                                                                                                                                                                                                                                                                         |
| mobile                                        | String | <p>Mobile of the Patient. </p><p></p><p>Only required if patient\_id is passed blank. </p>                                                                                                                                                                                                                                                                                                                                                                             |
| custom\_fields                                | Object | <p>Key value pairs of custom attribute key and it's value.<br>For ex: <br>{"prescription\_id": "879", "appointment\_id": "123"}</p>                                                                                                                                                                                                                                                                                                                                    |
| order\_action                                 | string | possible value : merge,update,""                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| order\_id                                     | string | <p>1.When you want to merge a prescription, you need to pass the order\_id to which you want to merge.<br>And order\_action should be "merge".<br><br>2.When you want to update a prescription, you need to pass the order\_id to which you want to update.<br><br><br></p>                                                                                                                                                                                            |

{% tabs %}
{% tab title="200: OK Order Placed successfully." %}

```json
{
    "status_code": "1",
    "status_message": "Order placed successfully",
    "datetime": "2022-12-07 14:18:11",
    "data": {
        "order_id": "jcdPUtlOBIBZY6xfDXJ6Gw==",
        "order_number": "ODLBDER3UQ"
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid Patient Key",
    "datetime": "2022-12-07 14:18:44",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Order Details

To get the order details

## Order View

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/orders/view`](https://api.evitalrx.in/v1/doctor/orders/view)

#### Request Body

| Name                                        | Type   | Description                                                            |
| ------------------------------------------- | ------ | ---------------------------------------------------------------------- |
| order\_id<mark style="color:red;">\*</mark> | String | Unique id of the order                                                 |
| apikey<mark style="color:red;">\*</mark>    | String | Authentication token                                                   |
| order\_number                               | String | if **order\_number** is provided, then **order\_id** is not mandatory. |

{% tabs %}
{% tab title="200: OK Order successfully retrieved." %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-07 14:26:53",
    "data": {
        "id": "JoPUmfKRiivtIxpkAKtpng==", // Order ID
        "order_number": "OOLBDETJIQ",
        "amount": 115,
        "discount": 0,
        "total": 115,
        "address_name": "home",
        "address": "",
        "address_line2": "",
        "city": "",
        "state": "",
        "zipcode": "",
        "order_status": "draft",
        "created_date": "2022-12-07 14:20:04",
        "order_delivery_datetime": "2022-12-07 14:20:04",
        "pharmacy_name": "Manav Pharmacy",
        "chemist_mobile": "7043120038",
        "chemist_address": "Cambridge Road",
        "chemist_city": "Bengaluru",
        "chemist_latitude": 12.970622,
        "chemist_longitude": 77.6281433,
        "chemist_state": "Karnataka",
        "chemist_zipcode": "560008",
        "order_patient_name": "Poojan Mehta",
        "pharmacist_name": "Manav",
        "delivery_note": "",
        "payment_status": 2,
        "patient_id": "3Dc6fhD+sruK/l2h585s7w==",
        "delivery_pin": "U2FsdGVkX1+twZ9Ase9xSlahDQno3tEh1A/fF3RGZI4=",
        "payment_ref_id": "",
        "custom_fields": { // Addtional fields for order
                "prescription_id": "879",
                "appointment_id": "123"
            }
        "medicine_details": [
            {
                "medicine_id": "ZnsQl586DmR/ANT3aLdM4g==",
                "medicine_name": "Ltk 50 Tablet",
                "size": 10,
                "medicine_type": "drug",
                "packing_size": "10 tablets in 1 strip",
                "gst_percentage": 5,
                "quantity": 1,
                "mrp": 115,
                "amount": 0,
                "price": 0,
                "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
                "order_details_id": "XvpcrpsRCyGhtkVsFpFOeA==",
                "discount_percentage": 0,
                "batch": "KRI",
                "discount": 0,
                "expiry": "2023-02-01",
                "gst": 0,
                "hsn_code": "",
                "cess": 0,
                "cess_percentage": 0,
                "loose_quantity": 10
            }
        ],
        "prescription_details": [],
        "payment_url": "http://evital.in/invoice/T09MQkRFVEpJUQ==/"
    }
}
```

{% endtab %}

{% tab title="200: OK Could not find an order matching this query." %}

```json
{
    "status_code": "0",
    "status_message": "No record found",
    "datetime": "2022-12-07 14:30:56",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Order List

To get the order details

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/orders/list`](https://api.evitalrx.in/v1/doctor/orders/list)

#### Request Body

| Name                                          | Type   | Description                              |
| --------------------------------------------- | ------ | ---------------------------------------- |
| start\_date<mark style="color:red;">\*</mark> | String | Start date of orders.                    |
| apikey<mark style="color:red;">\*</mark>      | String | Authentication token                     |
| end\_date<mark style="color:red;">\*</mark>   | String | End date of orders.                      |
| page                                          | Number | For pagination purpose. default: 1       |
| patient\_id<mark style="color:red;">\*</mark> | String | ID of the patient you want to see orders |
| remark                                        | String | To search orders with notes              |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-10-06 10:47:27",
    "data": {
        "results": [
            {
                "id": "X+j2u3xGNvyTzLrZCz+g+Q==", // Order ID
                "bill_no": "",
                "order_number": "OMLN8WCXGU",
                "order_delivery_datetime": "2023-10-02 18:28:38",
                "delivery_type": "delivery",
                "order_status": "draft",
                "created_date": "2023-10-02 18:28:38",
                "amount": 4870,
                "remark": "ICU Patient" // remarks from patient/other entity
            }
        ],
        "rpp": 20,
        "current_page": 1
    }
}
```

{% endtab %}

{% tab title="200: OK No Record found" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-09-13 15:03:43",
    "data": {
        "results": [],
        "rpp": 20,
        "current_page": 1
    }
}
```

{% endtab %}

{% tab title="200: OK Error" %}

```json
{
    "status_code": "0",
    "status_message": "patient_id is required",
    "datetime": "2023-09-13 15:04:00",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Update Order

This API is deprecated.

## Update order

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/orders/update_order`](https://api.evitalrx.in/v1/doctor/orders/update_order)

#### Request Body

| Name                                        | Type   | Description                                                                                                                                                                |
| ------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| order\_id<mark style="color:red;">\*</mark> | String | Unique id of the order                                                                                                                                                     |
| apikey<mark style="color:red;">\*</mark>    | String | Authentication token                                                                                                                                                       |
| items                                       | String | <p>Stringified Array of Items.</p><p></p><p>i.e.</p><p>\[{"medicine\_id":"ZnsQl586DmR/ANT3aLdM4g==","batch\_id":"lhk/Qty04EUD42YJqOgYhA==","discount":0,"quantity":3}]</p> |

{% tabs %}
{% tab title="200: OK Order updated successfully." %}

```json
{
    "status_code": "1",
    "status_message": "Order updated successfully",
    "datetime": "2022-12-08 18:32:25",
    "data": {
        "amount": "345", // updated amount
        "order_number": "OGLBF2YAYW",
        "order_id": "Kv1Dmatn3q7QW147CsWKAg=="
    }
}
```

{% endtab %}

{% tab title="200: OK Could not find an order matching this query." %}

```json
{
    "status_code": "0",
    "status_message": "No record found",
    "datetime": "2022-12-07 14:30:56",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Save

To save the order.

## Save

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}doctor/orders/save`](https://api.evitalrx.in/v1/doctor/orders/save)

If the order is made with batch through push\_prescription API, It can be saved by this API. This removes the headache of the integration partners, who don't want their chemists to switch 2 portals. Their portal to make drafts, and eVitalRx portal to save the order.

#### Request Body

| Name                                              | Type              | Description                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------------------------------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| patient\_id<mark style="color:red;">\*</mark>     | String            | Id to uniquely identify the patient for whom the order is placed                                                                                                                                                                                                                                                                                                                    |
| items<mark style="color:red;">\*</mark>           | Stringified Array | <p>List of items with quantity (in pills). </p><p>All  the params are required shown below. </p><p>Medicine Id and batch should have unique combination. </p><p></p><p><em>i.e.</em> \[{ "medicine\_id": "vjalpzMV0E33BLwzzLR6fQ==", "batch": "FRESH", "expiry": "2025-12-01", "mrp": 36.1, "quantity": 2, "discount": 0, "gst\_percentage": 12, "cess\_percentage": 0}]</p><p></p> |
| apikey<mark style="color:red;">\*</mark>          | String            | Authentication token                                                                                                                                                                                                                                                                                                                                                                |
| patient\_name<mark style="color:red;">\*</mark>   | String            | Name of the Patient                                                                                                                                                                                                                                                                                                                                                                 |
| shipping                                          | String            | Extra charges in the order.                                                                                                                                                                                                                                                                                                                                                         |
| delivery\_type                                    | String            | Must be one of **pickup** or **delivery**. default is **pickup.**                                                                                                                                                                                                                                                                                                                   |
| remark                                            | String            | Note for the Prescription. This param is also available in the Order Details.                                                                                                                                                                                                                                                                                                       |
| order\_id<mark style="color:red;">\*</mark>       | String            | Order ID from the response of push\_prescription API.                                                                                                                                                                                                                                                                                                                               |
| order\_date<mark style="color:red;">\*</mark>     | String            | <p>Date of the bill. </p><p>Format: YYYY-MM-DD</p><p></p>                                                                                                                                                                                                                                                                                                                           |
| parent\_patient\_id                               | String            | If billing for family member, then pass parent patient's ID here.                                                                                                                                                                                                                                                                                                                   |
| doctor\_id                                        | String            | Encrypted Doctor ID. This ID is available in the Order Details.                                                                                                                                                                                                                                                                                                                     |
| payment\_status<mark style="color:red;">\*</mark> | Number            | <p>To choose payment mode of the order. </p><p>1: CASH </p><p>2: CREDIT </p><p>3: UPI </p><p>4: CHEQUE </p><p>5: PAYTM </p><p>6: CC/DC </p><p>7: RTGS/NEFT</p>                                                                                                                                                                                                                      |

{% tabs %}
{% tab title="200: OK Order Placed successfully." %}

```json
{
    "status_code": "1",
    "status_message": "New sales bill created successfully.",
    "datetime": "2023-03-09 17:01:32",
    "ng_version": "0.0.371",
    "data": {
        "order_id": "LcNx52qfdGlw0aHcqmgsRg==",
        "bill_no": "141",
        "order_number": "OKLF112H59",
        "amount": "29",
        "print_url": "http://www.evital.in/invoice/T0tMRjExMkg1OQ==/print/",
        "share_message": "Hi%20Aagam%20Shah%2C%0AThank%20you%20for%20your%20purchase%20at%20*Manav%20Medical%20GJ*.%20We%20hope%20to%20serve%20you%20again.%0AClick%20to%20make%20Payment%20or%20view%20Invoice%3A%20http%3A%2F%2Flocalhost%2Fevital%2Finvoice%2FT0tMRjExMkg1OQ%3D%3D%2F%3Fsource%3DWhatsApp%26medium%3DManual%0A%0AIf%20the%20link%20is%20not%20clickable%2C%20please%20save%20this%20number%20and%20try%20again.%0A%0AYour%20trusted%20pharmacist%2C%0AManav%20Medical%20GJ",
        "invoice_url": "Hi%20Aagam%20Shah%2C%0AThank%20you%20for%20your%20purchase%20at%20*Manav%20Medical%20GJ*.%20We%20hope%20to%20serve%20you%20again.%0AClick%20to%20make%20Payment%20or%20view%20Invoice%3A%20http%3A%2F%2Flocalhost%2Fevital%2Finvoice%2FT0tMRjExMkg1OQ%3D%3D%2F%3Fsource%3DWhatsApp%26medium%3DManual%0A%0AIf%20the%20link%20is%20not%20clickable%2C%20please%20save%20this%20number%20and%20try%20again.%0A%0AYour%20trusted%20pharmacist%2C%0AManav%20Medical%20GJ"
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "order_id is required",
    "datetime": "2023-03-09 17:03:38",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Introduction

This API provides an entity to add custom fields with their attribute keys and value. Adding custom fields gives flexibility to the entity to store extra information related to an order or a patient.

**Here is the Postman Collection of APIs**

{% file src="/files/UICInivQuOeXqYyJc1nu" %}

## Sequence Diagram

<figure><img src="/files/H1X5jvDfnMSnrkho256P" alt=""><figcaption><p><mark style="background-color:yellow;"><strong><code>This sequence diagram illustrates how the Third Party interacts with eVitalRx for managing custom fields. It covers the operations of adding, updating, deleting, and listing custom fields for entities like orders or patients. The flow shows how the third party sends requests to eVitalRx, and eVitalRx responds with confirmation of actions performed.</code></strong></mark></p></figcaption></figure>

**Watch a video.**

{% embed url="<https://www.loom.com/share/55a5a0c5dfe8423ab55bf4e8344c39f0>" %}


# Add Custom Fields

To add user defined custom fields with attribute key and module

Add custom fields, Maximum limit for an entity to add custom fields is 20. Below is a sample cURL request to add some custom fields:

{% file src="/files/lHcdOQDq2keSogvRZGVr" %}

<mark style="color:green;">`POST`</mark>[`{{apiUrl}}custom_fields/add_update_custom_field`](https://api.evitalrx.in/v1/custom_fields/add_update_custom_field)

#### Request Body

| Name                                     | Type   | Description                                                                                                                             |
| ---------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark> | String | Authentication token                                                                                                                    |
| custom\_fields                           | Array  | <p>Array of custom field object<br>For ex:<br>{attribute\_key: string, module: string }<br>Valid module are:<br>sales and customers</p> |
| action                                   | String | add                                                                                                                                     |

{% tabs %}
{% tab title="OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2024-10-01 10:36:31",
    "data": null
}
```

{% endtab %}

{% tab title="Limit Error" %}

```json
{
    "status_code": "0",
    "status_message": "Total custom field exceeds limit of 20",
    "datetime": "2024-10-01 10:44:00",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Update Custom Field

To update a particular custom field using the id.

Update a custom field

Below is sample cURL request to update a custom field. Use raw JSON format to call the API. Length of the array while update action should be one only.

{% file src="/files/L0oNXo5bio6H0tKzRCRu" %}

<mark style="color:green;">`POST`</mark>[`{{apiUrl}}custom_fields/add_update_custom_field`](https://api.evitalrx.in/v1/custom_fields/add_update_custom_field)

#### Request Body

| Name                                     | Type   | Description                                                                                                                                                                                                                                       |
| ---------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark> | String | Authentication token                                                                                                                                                                                                                              |
| entity                                   | Number | type of the entity                                                                                                                                                                                                                                |
| custom\_fields                           | Array  | <p>Array of custom field object of length one containing id attribute key and module. Update one custom field at a time.<br>For ex:<br>{id: string, attribute\_key: string, module: string }<br><br>Valid modules are:<br>sales and customers</p> |
| action                                   | String | update                                                                                                                                                                                                                                            |

{% tabs %}
{% tab title="200 Update success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2024-09-24 15:14:36",
    "data": null
}
```

{% endtab %}

{% tab title="Invalid update id" %}

```json
{
    "status_code": "0",
    "status_message": "update failed",
    "datetime": "2024-09-24 15:14:36",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Delete Custom Fields

To delete custom field using the id.

Delete one or more custom fields.

Below is a Sample cURL request to delete particular custom fields.

{% file src="/files/qUFKc75pVvrx4MoyujgX" %}

<mark style="color:green;">`POST`</mark>[`{{apiUrl}}custom_fields/add_update_custom_field`](https://api.evitalrx.in/v1/custom_fields/add_update_custom_field)

#### Request Body

| Name                                     | Type   | Description                                                                                                                                                                                     |
| ---------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark> | String | Authentication token                                                                                                                                                                            |
| entity                                   | Number | type of the entity                                                                                                                                                                              |
| custom\_fields                           | Array  | <p>Array of custom field object containing id, attribute key and module name<br>For ex:<br>{id: string, attribute\_key: string, module: string}<br>Valid module are:<br>sales and customers</p> |
| action                                   | String | delete                                                                                                                                                                                          |

{% tabs %}
{% tab title="OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2024-10-01 10:24:18",
    "data": null
}
```

{% endtab %}

{% tab title="Invalid id of attribute" %}

```json
{
    "status_code": "0",
    "status_message": "deleting failed",
    "datetime": "2024-10-01 10:25:52",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# List Custom Fields

To list the user defined custom fields.

List custom fields

Below is a sample cURL to list custom fields.

{% file src="/files/zRdxg68jT44GNnUqCAV0" %}

<mark style="color:green;">`POST`</mark>[`{{apiUrl}}custom_fields/`list\_user\_custom\_fields](https://api.evitalrx.in/v1/custom_fields/list_user_custom_fields)

#### Request Body

| Name                                     | Type   | Description                                                                                                                    |
| ---------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------ |
| apikey<mark style="color:red;">\*</mark> | String | Authentication token                                                                                                           |
| module                                   | String | <p>Type of module,</p><p>Valid module are:</p><p>sales and customers.</p><p>if not provided all module fields are listed, </p> |

{% tabs %}
{% tab title="OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2024-09-30 17:04:42",
    "data": [
        {
            "id": "oyESErpn5eM/lQZPgEvxRw==",
            "attribute_key": "prescription_id",
            "module": "sales"
        },
        {
            "id": "J7kwRmvgO/93drQrS09DjA==",
            "attribute_key": "appointment_id",
            "module": "sales"
        },
        {
            "id": "zZBjQtv8YC8gzeDpmzakxg==",
            "attribute_key": "zipcode",
            "module": "sales"
        }
    ]
}
```

{% endtab %}

{% tab title="404 Invalid API key" %}

```json
{
    "status_code": "404",
    "status_message": "Invalid API Key",
    "datetime": "2024-09-30 17:11:28",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Reports

The **Master Bundle API** provides two types of reports: the **Margin Report**, which details product margins, pricing, and related financial information, and the **Stock Summary Report**, which offers a comprehensive overview of stock levels, details, and product locations. Users can request these reports in either compressed or non-compressed formats, allowing for flexibility in data presentation and usage.

**Here is the Postman Collection of APIs**

{% file src="/files/I2se4IgJYS1jqrtHnOur" %}

## Sequence Diagram

<figure><img src="/files/Fch5HY8xErne7dd1H4wo" alt=""><figcaption><p><mark style="background-color:yellow;"><strong><code>The Master Bundle API offers two reports: the Margin Report, which provides product margins and sales data, and the Stock Summary Report, detailing stock levels, pricing, and margins. Users can request these reports from the eVitalRx System, which returns the data in either compressed or non-compressed formats.</code></strong></mark></p></figcaption></figure>

**Watch a video.**

{% embed url="<https://www.loom.com/share/31ad0ce8044d4bad89afb5aacda775a2>" %}


# Margin Report

To view Margin of Sales/Sales Return

## Margin Report&#x20;

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}master/reports/margin_report`](https://api.evitalrx.in/v1/master/reports/margin_report)

#### Request Body

| Name                                          | Type   | Description                                                                                                                                                                                                                                    |                                                                                                                                                                                     |
| --------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| start\_date<mark style="color:red;">\*</mark> | String | <p>Start Date of the report. Must be less than equals to current Date or End Date.</p><p></p><p>Format = YYYY-MM-DD</p>                                                                                                                        |                                                                                                                                                                                     |
| end\_date<mark style="color:red;">\*</mark>   | String | <p>End Date of the report. Must be greater than equals to Start Date and less than equals to current Date.</p><p></p><p>Format = YYYY-MM-DD</p><p></p><p>The duration between End Date and Start Date must be less than equals to 31 days.</p> |                                                                                                                                                                                     |
| apikey<mark style="color:red;">\*</mark>      | String | Authentication token                                                                                                                                                                                                                           |                                                                                                                                                                                     |
| view\_by                                      | String | <p>item\_wise                                                                                                                                                                                                                                  | bill\_item\_wise</p><p></p><p>bill\_item\_wise: Show the margin on Sales bills.</p><p>item\_wise: Show the margin on items.</p><p></p><p>Default Value: bill\_item\_wise</p><p></p> |
| requested\_by                                 | String | <p>sales                                                                                                                                                                                                                                       | sale\_return</p><p></p><p>sales: Show Sales Margin Report. </p><p>sale\_return: Show Sales Return Margin Report.</p><p></p><p>Default: sales</p>                                    |
| tags                                          | String | <p>\["headache", "painkiller"]</p><p></p><p>filter by tags in the bill\_item\_wise report.</p>                                                                                                                                                 |                                                                                                                                                                                     |
| child\_chemist\_code                          | String | <p>chemist\_code of Child Chemist. </p><p></p><p>It will show the margin report of the child chemist.</p>                                                                                                                                      |                                                                                                                                                                                     |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2023-01-09 15:06:22",
    "data": {
        "type": "sales",
        "current_page": 1,
        "summary": {
            "total_purchase": 138.88,
            "total_sell": 225.6,
            "total_net_gst": 4.56,
            "profit": 82.16,
            "margin": 38.5
        },
        "results": [
            {
                "order_id": "hXdqB4ImyDFgNkqnvDQfSg==",
                "created_date": "2022-11-08 18:48:23",
                "patient_name": "Poojan Mehta",
                "bill_no": "23",
                "patient_id": "jbe37VCyuofdSgqVfzUAEA==",
                "medicine_id": "gv0GokYn9w4zFL51eouS2g==",
                "total_quantity_sold": 10,
                "gstpercentage": 5,
                "mrp": 112,
                "discount": 10,
                "current_stock": 90, // present stock
                "total_selling_price": 100.8,
                "total_landing_price": 10.08,
                "total_sales_gst": 4.8,
                "order_by_id": "+93Y8e1zYBSOwcnRNboSJw==",
                "order_by_entity": "chemist",
                "tag": [
                    "headache"
                ],
                "medicine_name": "Ltk 50 Tablet",
                "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
                "size": 10,
                "pack_size": "10 Tablets",
                "total_purchase_gst": 0.48,
                "total_net_gst": 4.32,
                "taxable_purchase_amount": 9.6,
                "taxable_sales_amount": 96,
                "profit": 86.4,
                "margin": 90
            },
            {
                "order_id": "yl4XZ5EZ9HHUEil31DBWzw==",
                "created_date": "2022-12-01 18:09:48",
                "patient_name": "Ronak Dunzo",
                "bill_no": "24",
                "patient_id": "zRC97Kh3xOMVdHZKkyZRVA==",
                "medicine_id": "BXGcaezmfzcQEdh7fZVmUg==",
                "total_quantity_sold": 15,
                "gstpercentage": 12,
                "mrp": 24,
                "discount": 0,
                "current_stock": 607,
                "total_selling_price": 24,
                "total_landing_price": 16.8,
                "total_sales_gst": 2.57,
                "order_by_id": "+93Y8e1zYBSOwcnRNboSJw==",
                "order_by_entity": "chemist",
                "tag": [
                    "headache"
                ],
                "medicine_name": "LTK-H Tablet 5",
                "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
                "size": 15,
                "pack_size": "15 Tablet",
                "total_purchase_gst": 1.8,
                "total_net_gst": 0.77,
                "taxable_purchase_amount": 15,
                "taxable_sales_amount": 21.43,
                "profit": 6.43,
                "margin": 30
            },
            {
                "order_id": "3+uJ2X8XmtbtDwKB1Pa+BQ==",
                "created_date": "2022-11-08 17:13:59",
                "patient_name": "Poojan Mehta",
                "bill_no": "22",
                "patient_id": "jbe37VCyuofdSgqVfzUAEA==",
                "medicine_id": "gv0GokYn9w4zFL51eouS2g==",
                "total_quantity_sold": 10,
                "gstpercentage": 5,
                "mrp": 112,
                "discount": 10,
                "current_stock": 90,
                "total_selling_price": 100.8,
                "total_landing_price": 112,
                "total_sales_gst": 4.8,
                "order_by_id": "+93Y8e1zYBSOwcnRNboSJw==",
                "order_by_entity": "chemist",
                "tag": [
                    "headache"
                ],
                "medicine_name": "Ltk 50 Tablet",
                "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
                "size": 10,
                "pack_size": "10 Tablets",
                "total_purchase_gst": 5.33,
                "total_net_gst": -0.53,
                "taxable_purchase_amount": 106.67,
                "taxable_sales_amount": 96,
                "profit": -10.67,
                "margin": -11.11
            }
        ]
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "end_date is required",
    "datetime": "2023-01-09 15:07:27",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Stock Summary

To view the summary of the stock.

## Sales Report&#x20;

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}master/reports/stock_summary`](https://api.evitalrx.in/v1/master/reports/stock_summary)

#### Request Body

| Name                                     | Type   | Description                                                                                                                                                                                                                                                                                                     |
| ---------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark> | String | Authentication token                                                                                                                                                                                                                                                                                            |
| manufacturer\_name                       | Array  | A list of manufacturer name(s) to filter the stock summary by                                                                                                                                                                                                                                                   |
| compress\_repsonse                       | String | <p>"<strong>no</strong>": Returns the full, detailed response with all data in a readable format. (default)</p><p>"<strong>yes</strong>": Compresses the response, reducing the size by sending data in a more compact format (array of arrays), which can improve performance when handling large datasets</p> |
| report\_fields                           | Array  | A list of fields to include in the stock summary report. Default includes a set of common fields such as `medicine_id`, `manufacturer_name`, `stock`, `price`, etc.                                                                                                                                             |
| location                                 | Array  | A list of locations where the stock is stored or needs to be filtered by                                                                                                                                                                                                                                        |
| item\_type                               | String | <p><strong>"all"</strong>: Includes all available items. (default)</p><p><strong>"discontinued"</strong>: Only includes items that have been discontinued</p>                                                                                                                                                   |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2024-12-04 16:33:29",
    "data": {
        "compressed": "no",
        "results": [
            {
                "medicine_code": "MDDRG4997072411",
                "medicine_id": "hKtRHscgbs/zRdGqisi3HA==",
                "manufacturer_name": "TTK Healthcare Ltd",
                "medicine_name": "Dolobest MR 100mg/500mg/250mg Tablet",
                "medicine_category": null,
                "content": "Aceclofenac (100mg) + Paracetamol/Acetaminophen (500mg) + Chlorzoxazone (250mg)",
                "pack_size": "10 Tablets",
                "batch": "ASDASD",
                "margin": 48.42,
                "expiry": "02/27",
                "batch_stock": 0,
                "mrp": 130,
                "total_by_mrp": 0,
                "price_to_retailer": 85.69, // ptr
                "price_to_supplier": 0,
                "total_by_ptr": 0,
                "total_by_pts": 0,
                "landing_price": 81.58,
                "total_by_lp": 0,
                "location": "", // location of the product in pharmacy
                "gst_percentage": 12,
                "hsn_code": "554645",
                "tags": "",
                "size": 10,
                "stock": 154484,
                "medicine_name_alias": "",
                "olddbref": "0",
                "max_quantity": 0,
                "min_quantity": 0
            },
            {
                "medicine_code": "MDDRG4695038199",
                "medicine_id": "oXg3nBR+crfVVlI1JSYsBw==",
                "manufacturer_name": "Staunch Health Care Pvt Ltd",
                "medicine_name": "Laurunam 1000 mg Injection",
                "medicine_category": null,
                "content": "Meropenem (1000mg)",
                "pack_size": "1 Injection",
                "batch": "UHJKL32",
                "margin": 176.36000000000013,
                "expiry": "02/29",
                "batch_stock": 0,
                "mrp": 1857.13,
                "total_by_mrp": 0,
                "price_to_retailer": 1500.69,
                "price_to_supplier": 0,
                "total_by_ptr": 0,
                "total_by_pts": 0,
                "landing_price": 1680.77,
                "total_by_lp": 0,
                "location": "",
                "gst_percentage": 12,
                "hsn_code": "",
                "tags": "",
                "size": 1,
                "stock": 797,
                "medicine_name_alias": "",
                "olddbref": "0",
                "max_quantity": 0,
                "min_quantity": 0
            }
        ]
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "item_type must be one of [all, discontinued]",
    "datetime": "2024-12-04 16:34:45",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Introduction

The healthcare industry is changing how it serves patients, and a fulfillment API is a prime example. By merging GPS and medication data, this API facilitates medication delivery by directing orders to nearby pharmacies with the required medication in stock. The patient can then choose either pickup or delivery, streamlining the order fulfillment process.

**Flow diagram:**

<figure><img src="/files/UHlLhjktwODXUuDmSY6L" alt=""><figcaption></figcaption></figure>

#### Here is the Postman Collection of APIs

**Version 3**

{% embed url="<https://drive.google.com/file/d/1YpByXcFx46otySWpxIOqklJeHaQYuF-c/view?usp=sharing>" %}

**Version 2**

{% embed url="<https://drive.google.com/file/d/1dLwRzNVgptv3g_oHL2hJilYYbKpSv3sk/view?usp=drive_link>" %}

#### Watch a video

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkMQ1evvT-4Hx1hloPt%2Fuploads%2FHqvBwsGZ8z2NV7OvRNS2%2FDOCS-fulfillment%20API%20Overview.webm?alt=media&token=e967bd55-8229-4def-b493-36d75de62705>" %}

{% embed url="<https://www.loom.com/share/2a48dcea42504b47b92d443947974dea>" %}


# Patients


# Add Patient

To add patients with mobile number, name and address.

## <img src="https://static.vecteezy.com/system/resources/thumbnails/018/930/572/small/youtube-logo-youtube-icon-transparent-free-png.png" alt="" data-size="line"> [Learn How to Add a Patient](https://youtu.be/voc4bcyhZ_8?si=Nf_SpvsQX9vVo26v)

## Add Patient &#x20;

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}fulfillment/patients/add`](https://ews-staging-api-product.portal-evital.com/v1/fulfillment/patients/add)

#### Request Body

| Name                                          | Type   | Description                                                                              |
| --------------------------------------------- | ------ | ---------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>      | String | Authentication token                                                                     |
| zipcode                                       | Number | Zip code of the Patient                                                                  |
| mobile<mark style="color:red;">\*</mark>      | Number | Mobile number of Patient                                                                 |
| first\_name<mark style="color:red;">\*</mark> | String | First name of Patient                                                                    |
| last\_name                                    | String | Last name of Patient                                                                     |
| dob                                           | String | <p>Date of Birth of the Patient</p><p>Format: YYYY-MM-DD</p>                             |
| gender                                        | String | <p>Gender of the Patient.</p><p>Must be one of <strong>male, female, other</strong>.</p> |
| blood\_group                                  | String | Blood Group of the Patient                                                               |

{% tabs %}
{% tab title="200 Patient added successfully." %}

```json
{
    "status_code": "1",
    "status_message": "Patient registered successfully.",
    "datetime": "2022-12-06 18:07:04",
    "data": {
        "patient_id": "qAj4hhwefVxwuZX9nFxHkQ==" // Unique Patient ID
    }
}
```

{% endtab %}

{% tab title="200: OK Patient added Failed" %}

```
{
    "status_code": "0",
    "status_message": "This Mobile is already exist.",
    "datetime": "2022-12-07 12:23:41",
    "data": {
        "patient_id": "qAj4hhwefVxwuZX9nFxHkQ=="
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "Please enter valid zipcode",
    "datetime": "2022-12-06 18:09:55",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Get Patient

To get the patient details

## Get Patient

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}fulfillment/patients/view`](https://ews-staging-api-product.portal-evital.com/v1/fulfillment/patients/view)

#### Request Body

| Name                                          | Type   | Description                                    |
| --------------------------------------------- | ------ | ---------------------------------------------- |
| patient\_id<mark style="color:red;">\*</mark> | String | Unique id of the Patient                       |
| apikey<mark style="color:red;">\*</mark>      | String | Authentication token                           |
| mobile                                        | String | Either patient\_id or mobile should be passed. |

{% tabs %}
{% tab title="200 Patient details retrieved successfully." %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-06 18:11:54",
    "data": [
        {
            "firstname": "Manav",
            "lastname": "Patel",
            "zipcode": "380008",
            "mobile": "9787998785",
            "patient_id": "qAj4hhwefVxwuZX9nFxHkQ=="
        }
    ]
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "\"patient_id\" is required",
    "datetime": "2022-12-06 18:12:45",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Medicines


# Search

To search items with the Item Name (string), GTIN number of the product, or Salt-Composition(content).

#### [Explore Medicines Available in Staging](/getting-started-with-evitalrx#explore-medicines-available-in-staging)

## Search Products

<mark style="color:green;">`POST`</mark> [`https://ews-staging-search.portal-evital.com/v1/fulfillment/medicines/pillo/search`](https://ews-staging-search.portal-evital.com/v1/fulfillment/medicines/pillo/search)

#### Request Body

| Name                                           | Type   | Description                                                                                                                                                                                                                                                                       |
| ---------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| searchstring<mark style="color:red;">\*</mark> | String | <p>Search String input</p><p>It can be used in following ways.</p><p>By Item Name</p><p><code>"searchstring":"dolo"</code></p><p></p><p>By Content</p><p><code>"searchstring":"c,paraceta"</code></p><p></p><p>By GTIN Number</p><p><code>"searchstring":"89080034169"</code></p> |
| apikey<mark style="color:red;">\*</mark>       | String | Authentication token                                                                                                                                                                                                                                                              |

{% tabs %}
{% tab title="200 Products Retrieved Successfully" %}

```json
{
    "status_code": "1",
    "status_message": "SUCCESS",
    "datetime": "2025-09-09 11:48:20",
    "ng_version": "0.0.578",
    "data": {
        "search_type": "normal",
        "did_you_mean_result": [],
        "result": [
            {
                "accept_online_order": "yes",
                "discontinued": "no",
                "discount_percentage": 0,
                "gst_percentage": 12,
                "medicine_id": "X1P9/F3XVunOtftRNNCyHA==",
                "mrp": 30.74,
                "quantity": 0,
                "sell_in_loose": "yes",
                "available_for_patient": "yes",
                "content": "Paracetamol (650mg)",
                "dosage_type": "tablet",
                "gtin_number": "",
                "hsn_code": "30049061",
                "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/medicines/62d4e09cd4dd3.jpg",
                "is_rx_required": 0,
                "popularity_score": 72.72727272727273,
                "medicine_category": "drug",
                "primary_category_id": 819,
                "manufacturer_name": "Micro Labs Ltd",
                "medicine_name": "Dolo 650 Tablet",
                "medicine_name_suggest": "Dolo 650 Tablet",
                "medicine_type": "drug",
                "pack_size": "15 Tablet",
                "packing_size": "1 Strip of  15 Tablet",
                "price": 30.74,
                "salt_content_id": "+qIGHQHPc9AJh9QUPHyMSA==",
                "schedule_type": "H",
                "size": 15,
                "slug": "dolo-650-tablet-M00234T",
                "thumb_image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/medicines/thumb/62d4e09cd4dd3.jpg",
                "price_per_unit": 2.05,
                "unit": "Tablet"
            },
            {
                "accept_online_order": "yes",
                "discontinued": "no",
                "discount_percentage": 0,
                "gst_percentage": 12,
                "medicine_id": "HD3nI9bnanVvGm6N6jthJw==",
                "mrp": 50,
                "quantity": 0,
                "sell_in_loose": "yes",
                "available_for_patient": "no",
                "content": "Losartan Potassium (100mg)",
                "dosage_type": "tablet",
                "gtin_number": "",
                "hsn_code": "0",
                "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/medicines/default.jpg",
                "is_rx_required": 0,
                "popularity_score": 46.96969696969697,
                "medicine_category": "",
                "primary_category_id": 0,
                "manufacturer_name": "Alkem Laboratories Ltd",
                "medicine_name": "Dolo 650 Tablet (15 Tablet)",
                "medicine_name_suggest": "Dolo 650 Tablet (15 Tablet)",
                "medicine_type": "",
                "pack_size": "15 Tablet",
                "packing_size": "1 Strip of  15 Tablet",
                "price": 50,
                "salt_content_id": "klejjWIyfAodC8J11IGD7w==",
                "schedule_type": "",
                "size": 15,
                "slug": "dolo-650-tablet-15-tablet-MDOTC316961964353",
                "thumb_image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/medicines/thumb/default.jpg",
                "price_per_unit": 3.33,
                "unit": "Tablet"
            },
            {
                "accept_online_order": "yes",
                "discontinued": "no",
                "discount_percentage": 0,
                "gst_percentage": 12,
                "medicine_id": "SfsO+h0OEdipWQ6ZZGwcZA==",
                "mrp": 0,
                "quantity": 0,
                "sell_in_loose": "yes",
                "available_for_patient": "no",
                "content": "Losartan Potassium (100mg)",
                "dosage_type": "tablet",
                "gtin_number": "",
                "hsn_code": "0",
                "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/medicines/default.jpg",
                "is_rx_required": 0,
                "popularity_score": 0,
                "medicine_category": "Drug",
                "primary_category_id": 0,
                "manufacturer_name": "Micro Labs Ltd",
                "medicine_name": "Dolo 650 Tablet (1 Tablet)",
                "medicine_name_suggest": "Dolo 650 Tablet (1 Tablet)",
                "medicine_type": "drug",
                "pack_size": "1 Tablet",
                "packing_size": "1 Strip of  1 Tablet",
                "price": 0,
                "salt_content_id": "klejjWIyfAodC8J11IGD7w==",
                "schedule_type": "",
                "size": 1,
                "slug": "dolo-650-tablet-1-tablet-MDDRG31541966617",
                "thumb_image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/medicines/thumb/default.jpg",
                "price_per_unit": 0,
                "unit": "Tablet"
            }
        ]
    }
}
```

{% endtab %}

{% tab title="200: OK No Products found" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-06 15:21:25",
    "data": {
        "did_you_mean_result": [],
        "result": []
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "\"Medicine Name\" length must be less than or equal to 20 characters long",
    "datetime": "2022-12-06 15:19:58",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# View V3

To get item details in your inventory by unique medicine Id.

## Product Details

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}fulfillment/medicines/view_v3`](https://ews-staging-api-product.portal-evital.com/v1/fulfillment/medicines/view_v3)

#### Request Body

| Name                                           | Type   | Description                                                                                                                                                                                                                                                                                                           |
| ---------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>       | String | Authentication Token                                                                                                                                                                                                                                                                                                  |
| medicine\_id<mark style="color:red;">\*</mark> | String | Unique id of the product                                                                                                                                                                                                                                                                                              |
| location\_token                                | String | Get token from Check Serviceability V3 API                                                                                                                                                                                                                                                                            |
| medicine\_ids                                  | String | <p>Stringified Array of medicine\_ids.</p><p></p><p><strong>medicine\_id</strong> param is optional, if <strong>medicine\_ids</strong> param is passed.</p><p></p><p>medicine\_ids should contain at least 2 medicine\_ids.</p><p></p><p>Example:</p><p>\["z5s5a+e/Cj4ip7sUl2zJFQ==", "otUfMtG4nIpWSc+oWoX7Lw=="]</p> |
| latitude                                       | Number | Latitude of the customer                                                                                                                                                                                                                                                                                              |
| longitude                                      | Number | Longitude of the customer                                                                                                                                                                                                                                                                                             |
| distance                                       | Number | <p>Distance of fulfillment.</p><p></p><p>radius of search area for search provided item</p>                                                                                                                                                                                                                           |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2025-04-01 12:30:34",
    "version": "1.1.89",
    "data": {
        "content": "Losartan (50mg)",
        "how_medicine_works": "Ltk 50 Tablet is an angiotensin receptor blocker (ARB). It relaxes blood vessel by blocking the action of a chemical that usually makes blood vessels tighter. This lowers the blood pressure, allowing the blood to flow more smoothly to different organs and the heart to pump more efficiently.",
        "how_to_use": "Take this medicine in the dose and duration as advised by your doctor. Swallow it as a whole. Do not chew, crush or break it. Ltk 50 Tablet may be taken with or without food, but it is better to take it at a fixed time.",
        "id": "y1sw0N315wy4+UDhhT5FjA==",
        "medicine_image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/medicines/6142edda9e799.jpeg",
        "is_rx_required": 0,
        "dosage_type": "tablet",
        "medicine_name": "Ltk 50 Tablet",
        "mrp": 23.5,
        "packing_size": "1 Strip of  10 Tablet",
        "pack_size": "10 Tablet",
        "packing": "Strip",
        "size": 10,
        "hsn_code": "10001111",
        "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
        "side_effects": " Common   Dizziness  Back pain  Sinus inflammation  Increased potassium level in blood  ",
        "alcohol": "Taking Losartan with alcohol may excessively lower the blood pressure.",
        "driving": "It is not known whether Ltk 50 Tablet alters the ability to drive. Do not drive if you experience any symptoms that affect your ability to concentrate and react.",
        "kidney": "Ltk 50 Tablet is safe to use in patients with kidney disease. No dose adjustment of Ltk 50 Tablet is recommended.<br>However, talk to your doctor if you have any underlying kidney disease. Regular monitoring of blood pressure is recommended for better dose adjustment.",
        "lactation": "Ltk 50 Tablet is probably safe to use during lactation.  Limited human data suggests that the drug does not represent a significant risk to the baby.",
        "liver": "Ltk 50 Tablet should be used with caution in patients with liver disease. Dose adjustment of Ltk 50 Tablet may be needed. Please consult your doctor.<br>Use of Ltk 50 Tablet is not recommended in patients with severe liver disease.",
        "pregnancy": "Ltk 50 Tablet is unsafe to use during pregnancy.<br>There is positive evidence of human fetal risk, but the benefits from use in pregnant women may be acceptable despite the risk, for example in life-threatening situations. Please consult your doctor.",
        "medicine_category": "drug",
        "gst_percentage": 12,
        "medicine_type": 65,
        "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/medicines/6142edda9e799.jpeg",
        "price": 21.15,
        "medicine_uses": "Ltk 50 Tablet is used in the treatment of <a href='/diseases/high-blood-pressure-68'>high blood pressure</a>.",
        "other_packings": "",
        "salt_content_id": "SBFG1vyLxuS3eapamEiruQ==",
        "schedule_type": "",
        "discount_percentage": 10,
        "in_stock": false,
        "size_variants": [],
        "size_variants_2": [],
        "alternative_results": {
            "results": [
                {
                    "approved": 0,
                    "available_for_patient": "yes",
                    "cess_percentage": 0,
                    "requested_by_entity": "chemist",
                    "content": "Paracetamol (650mg)",
                    "dosage_type": "tablet",
                    "gst_percentage": 12,
                    "gtin_number": "",
                    "hsn_code": "30049099",
                    "image": "https://d2ffmswuyj0h1d.cloudfront.net/storage/medicines/thumb/60ae1dc73132f.jpg",
                    "manufacturer_name": "Hetero Drugs Ltd",
                    "medicine_id": "PDqfWw+enNR0w5U23KOsZg==",
                    "medicine_name": "Lanol ER Tablet (10 Tablet)",
                    "medicine_name_suggest": "Lanol ER Tablet (10 Tablet)",
                    "medicine_type": "drug",
                    "mrp": 22.4,
                    "pack_size": "10 Tablet",
                    "packing_size": "1 Strip of  10 Tablet",
                    "price": 20.16,
                    "discount_percentage": 10,
                    "salt_content_id": 197,
                    "schedule_type": "H",
                    "size": 10,
                    "slug": "lanol-er-tablet-10-tablet-MDDRG2183024649",
                    "is_rx_required": 1,
                    "primary_category_id": 819,
                    "popularity_score": 99.83337266934151
                }
            ],
            "is_salt_content_id_zero": false
        },
        "medicine_images": [],
        "thumb_image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/medicines/thumb/6142edda9e799.jpeg",
        "thumb_medicine_image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/medicines/thumb/6142edda9e799.jpeg"
    }
}
```

{% endtab %}

{% tab title="200: OK No Product found according to request params" %}

```json
{
    "status_code": "0",
    "status_message": "Invalid medicine key",
    "datetime": "2022-12-06 16:42:59",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK Multiple Medicines" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2022-12-06 17:54:14",
    "data": [
        {
            "content": "",
            "how_medicine_works": "LTK-H Tablet is a combination of two medicines: Losartan and Hydrochlorothiazide, which lowers the blood pressure effectively. Losartan is an angiotensin receptor blocker (ARB). It works by blocking the hormone angiotensin thereby relaxing blood vessels. This allows the blood to flow more smoothly and the heart to pump more efficiently. Hydrochlorothiazide is a diuretic that removes extra water and certain electrolytes from the body. Over time it also relaxes blood vessels and improves blood flow.",
            "how_to_use": "Take this medicine in the dose and duration as advised by your doctor. Swallow it as a whole. Do not chew, crush or break it. LTK-H Tablet may be taken with or without food, but it is better to take it at a fixed time.",
            "id": "otUfMtG4nIpWSc+oWoX7Lw==",
            "medicine_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/611c99c173648.jpg",
            "is_rx_required": 1,
            "dosage_type": "",
            "medicine_name": "LTK-H Tablet 5",
            "mrp": 24,
            "packing_size": "1 Strip of  15 Tablet",
            "size": 15,
            "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
            "side_effects": " Common   Nausea  Taste change  Stomach upset  Diarrhea  Headache  Dizziness  Weakness  Decreased blood pressure  Increased blood uric acid  Increased blood lipid level  Glucose intolerance  Electrolyte imbalance  ",
            "medicine_category": "otc",
            "loose_quantity": 1305,
            "sale_discount": 0,
            "strip_quantity": 87,
            "is_inventory_available": "yes",
            "price": 24,
            "sell_in_loose": "yes",
            "warning_details": [
                {
                    "liver": "LTK-H Tablet should be used with caution in patients with liver disease. Dose adjustment of LTK-H Tablet may be needed. Please consult your doctor."
                },
                {
                    "alcohol": "Taking Hydrochlorothiazide with alcohol may have additive effects in lowering blood pressure. You may experience headache, dizziness, lightheadedness, fainting, and/or changes in pulse or heart rate."
                },
                {
                    "driving": "LTK-H Tablet may make you feel dizzy, sleepy, tired, or decrease alertness. If this happens, do not drive."
                },
                {
                    "kidney": "LTK-H Tablet should be used with caution in patients with severe kidney disease. Dose adjustment of LTK-H Tablet may be needed. Please consult your doctor.<br>Use of LTK-H Tablet is not recommended in patients with severe kidney disease."
                },
                {
                    "lactation": "LTK-H Tablet is probably safe to use during lactation.  Limited human data suggests that the drug does not represent a significant risk to the baby."
                },
                {
                    "pregnancy": "LTK-H Tablet is unsafe to use during pregnancy.<br>There is positive evidence of human fetal risk, but the benefits from use in pregnant women may be acceptable despite the risk, for example in life-threatening situations. Please consult your doctor."
                }
            ]
        },
        {
            "content": "",
            "how_medicine_works": "",
            "how_to_use": "",
            "id": "z5s5a+e/Cj4ip7sUl2zJFQ==",
            "medicine_image": "https://d1tu4pmhr82np8.cloudfront.net/storage/medicines/default.jpg",
            "is_rx_required": 0,
            "dosage_type": "",
            "medicine_name": "Mamy Poko Pants Extra Absorb NB1 - 20 Piece",
            "mrp": 195,
            "packing_size": "1 Packet of 20 Piece",
            "size": 1,
            "manufacturer_name": "Unicharm India",
            "side_effects": "",
            "medicine_category": "generic",
            "loose_quantity": 0,
            "sale_discount": 0,
            "strip_quantity": 0,
            "is_inventory_available": "no",
            "warning_details": [
                {
                    "liver": ""
                },
                {
                    "alcohol": ""
                },
                {
                    "driving": ""
                },
                {
                    "kidney": ""
                },
                {
                    "lactation": ""
                },
                {
                    "pregnancy": ""
                }
            ]
        }
    ]
}
```

{% endtab %}
{% endtabs %}


# Orders


# Check Serviceability V3

To check if a location is serviceable

With this API you can check which **location** are **serviceable** and are allowed for placing the order either for **pickup** or **delivery** type order. We check real-time availability of the nearby pharmacy-stores whether they are online or not.

We provide 5 delivery-service primarily:

<table><thead><tr><th width="164.23809814453125">Delivery Service Type</th><th width="174.8092041015625">Delivery Time</th><th>When to Choose Which Delivery Service ?</th></tr></thead><tbody><tr><td>Quick</td><td>within 60 min</td><td><ul><li>Ideal for <strong>Quick-Commerce</strong></li><li>Unique Medicine SKU availability ranges from <strong>Small to Medium</strong> (<em>may vary depending upon the tier of city</em>)</li></ul></td></tr><tr><td>Regular</td><td>within 2 hour</td><td><ul><li>Ideal for <strong>Quick-Commerce</strong></li><li>Unique Medicine SKU availability ranges from <strong>Medium to Large.</strong></li></ul></td></tr><tr><td>In Stock Same Day</td><td>within 8 hours</td><td><ul><li>Ideal for <strong>Insurance-Provider</strong> &#x26; <strong>TPA</strong></li><li>Unique Medicine SKU availability ranges from <strong>Medium to Large.</strong></li></ul></td></tr><tr><td>Same Day</td><td>within 24 hours</td><td><ul><li>Ideal for <strong>Insurance-Provider</strong> &#x26; <strong>TPA</strong></li><li>Unique Medicine SKU availability are <strong>Large.</strong></li></ul></td></tr><tr><td>PAN India</td><td>within 5-7 days<br>vary upon distance</td><td><ul><li>Ideal for General Use</li><li>Unique Medicine SKU availability are <strong>Large.</strong></li></ul></td></tr></tbody></table>

## Things to know

1. Since this API contains real-time availability of the pharmacy-store it is required to refresh the location-token periodically.

* When to refresh the `location_token`
  * Refer to a threshold of 15 min limit.
  * Upon cart-screen loading.
  * Before Placing the order.
  * When patient location is updated or address is changed from address book, cart screen etc.

2. When you can place the order ?

* When you get **serviceable** as `true`

#### Testing Data

* Location Details:&#x20;
  * Latitude : 23.1025849
  * Longitude : 72.5953601
  * Zipcode : 380005
  * Address : Office B, 3rd Floor, 4D Square Mall, below PVR Cinema, Motera, Ahmedabad, Gujarat 380005

## Get serviceability check

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}fulfillment/orders/check_serviceability_v3`](https://ews-staging-api-product.portal-evital.com/v1/fulfillment/orders/check_serviceability_v3)

#### Request Body

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>apikey<mark style="color:red;">*</mark></td><td>String</td><td>Authentication Token</td></tr><tr><td>latitude<mark style="color:red;">*</mark></td><td>String</td><td>Latitude of the customer</td></tr><tr><td>longitude<mark style="color:red;">*</mark></td><td>String</td><td>Longitude of the customer</td></tr><tr><td>zipcode<mark style="color:red;">*</mark></td><td>String</td><td>Zipcode of the patient</td></tr><tr><td>service_type<mark style="color:red;">*</mark></td><td>'quick' | 'regular' | 'in_stock_same_day' | 'same_day' | 'pan_india'</td><td><p>Stringified array of service types.</p><p>For eg.</p><pre class="language-postman_json"><code class="lang-postman_json">"[\"quick\",\"regular\", \"in_stock_same_day\",\"same_day\", \"pan_india\"]"
</code></pre></td></tr><tr><td>delivery_type</td><td>'pickup' | 'delivery'</td><td><strong>delivery</strong> (<em>Default</em>): Order will be delivered.<br><strong>pickup</strong> : Order will be of pick-up type.</td></tr><tr><td>full_address</td><td>String</td><td>Full address of  the patient for <br>eg. Office B, 3rd Floor, 4D Square Mall, below PVR Cinema, Motera, Ahmedabad, Gujarat 380005</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2026-02-14 09:51:58",
    "version": "1.1.547",
    "data": {
        "quick": null,
        "regular": {
            "serviceable": true,
            "error_slug": "",
            "location_token": "lGtSXojVIMwGbrsVqY03B4oboixKAingRNU6lPAIQy/G8L6J9CBmGcTGrx8f/RihijStxJAuMwNf55aMGcSgfrTDU2AKOBcyyhebNW3yc28acHe2sRSSYqtsFqwRfUJDrNQlcht1yEs8+Va6q3jbK69T5piJ7IM/RDpeWWoTvV5o0LFwLueIPfF2EGTMCLXPr191diEc/YmJOJj8hcq/q1XaUyUv0HeUVhe+XC9t6ynlfE2g6q6DlWbTytHQE3OfHyqjWw6QFA41SCo9QmRi/A=="
        },
        "in_stock_same_day": null,
        "same_day": {
            "serviceable": true,
            "error_slug": "",
            "location_token": "lGtSXojVIMwGbrsVqY03B5pG3EIS1dxZwe8yXIiW4NC4B4+02Uu+Iu1EoS5ynBnbz4j7Okw453FONcjxoUYEgzDkbuENC8PbMRNDsk2hNtAwLuTa9kF/VI7Vrs9ddwhtYnOyoDti7K21+BwHIuOP4CJVHu6kvQtFCN7d9XMg1LDzcA+1HcO3B9RXi3ej3nAy+7KhBuUfhI86N48Aewi29xxwEkLVMHfSj6bvvdAAjIdDRvW8NV2mBanAJn8pCfdz4T63PND9YuAL+s761e5Emg=="
        },
        "pan_india": null
    }
}
```

{% endtab %}

{% tab title="200: OK Invalid params" %}

```json
{
    "status_code": "0",
    "status_message": "zipcode is required",
    "datetime": "2025-05-14 10:22:41",
    "version": "1.1.133",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK Not Serviceable" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2025-05-14 10:23:22",
    "version": "1.1.133",
    "data": {
        "quick": null,
        "regular": {
            "serviceable": false,
            "error_slug": "no_pharmacy_found",
            "location_token": "0P6Hm1/BNc7uxzkOSZaBLVm6SiC2t0JAqdfTAkYsDVaIW1ItSdS37OKMQ5miSYjf"
        },
        "same_day": {
            "serviceable": false,
            "error_slug": "no_pharmacy_found",
            "location_token": "0P6Hm1/BNc7uxzkOSZaBLeGCJnWMLSOhvviSlR4mPlyTurNYbuWd2jb5dWPzlIj5"
        },
        "pan_india": null
    }
}
```

{% endtab %}
{% endtabs %}

## Errors Explanation

* `no_pharmacy_found`&#x20;
  * Currently no pharmacy are available there to take the order or area is not serviceable at the moment.
* `no_pharmacy_found_due_to_off_hours`
  * When pharmacies are there but they are offline or due to their store timing store is closed.


# Checkout V3

To check availability of the items.

This API provides availability of medicines with alternatives. And calculates the total cart value.

## Get the availability of medicines

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}fulfillment/orders/checkout_v3`](https://ews-staging-api-product.portal-evital.com/v1/fulfillment/orders/checkout_v3)

For the medicines which are out of stock, available alternative medicines will be provided.

> In API request, You need to pass either provide **patient\_id** or **mobile & patient\_name**.

#### Charges Breakdown Explanation

* `with_discount` represents the **actual payable amount** after applying the offers.
* `without_discount`  represents the total amount without applying any discount. It can also be used to show **Savings Calculation**.

**charges-total-with\_discount** = This amount is summation of items `price * quantity`.

**charges-total-without\_discount** = This amount is summation of items `mrp * quantity` .

**payable\_amount.without\_discount** calculation

```markdown
payable_amount.without_discount =
    total.without_discount
  + delivery_charge.without_discount
  + surge_charge.without_discount
  + handling_fee.without_discount
  + small_cart_fee.without_discount
  + delivery_tip_amount.without_discount
```

**payable\_amount.with\_discount** calculation

```markdown
 payable_amount.with_discount =
       total.with_discount
      + delivery_charge.with_discount
      + surge_charge.with_discount
      + handling_fee.with_discount
      + small_cart_fee.with_discount
      + delivery_tip_amount.with_discount
```

## Things to know

This API provides the real time stock availability cases that can be occur are:

* Similar to check-serviceability, checkout API is need to be called to have an updated the cart availability as item-availability is directly related to the pharmacy availability directly.
* On Cart-Screen, Whenever the check-serviceability API is called the checkout should also be called with update `location_token`.
* On Collecting Payment from patient always use `payable_amount.with_discount` .&#x20;

> ***NOTE :*** The amount quoted is the maximum amount it may or may not get reduced from the maximum quoted price. For Postpaid cleints, this Price Variation needs to handeled at their end.&#x20;

#### Request Body

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>apikey<mark style="color:red;">*</mark></td><td>String</td><td>Authentication Token</td></tr><tr><td>location_token<mark style="color:red;">*</mark></td><td>String</td><td>Get token from Check Serviceability V3 API</td></tr><tr><td>patient_id<mark style="color:red;">*</mark></td><td>String</td><td><p>Id to uniquely identify the patient for whom the order is placed.</p><p></p><p>if mobile and patient name is provided, then patient_id is optional.</p></td></tr><tr><td>mobile</td><td>String</td><td>Patient's mobile no</td></tr><tr><td>patient_name</td><td>String</td><td>Patient's name</td></tr><tr><td>items<mark style="color:red;">*</mark></td><td>String</td><td><p>Stringified Array of Items.</p><p></p><p>Items should contain at least 1 object. </p><p></p><p>MIN: 1 (medicines)</p><p>MAX: 20 (medicines)</p><p></p><p>Example:</p><pre class="language-json"><code class="lang-json">"[{\"quantity\":1,\"medicine_id\":\"vVgL6Ggy5tYhqQr1qXOAzA==\"},{\"quantity\":2,\"medicine_id\":\"BXGcaezmfzcQEdh7fZVmUg==\"}]"
</code></pre></td></tr><tr><td>latitude<mark style="color:red;">*</mark></td><td>Number</td><td>Latitude of the customer</td></tr><tr><td>longitude<mark style="color:red;">*</mark></td><td>Number</td><td>Longitude of the customer</td></tr><tr><td>zipcode<mark style="color:red;">*</mark></td><td>String</td><td>Zipcode of the customer</td></tr><tr><td>find_alternative</td><td>Boolean</td><td>Flag to get item alternatives</td></tr><tr><td>show_cart_options</td><td>Boolean</td><td>To know alternate cart items options.</td></tr><tr><td>delivery_type</td><td>'pickup' | 'delivery'</td><td>"delivery" : Order will be delivered to patient address.<br>"pickup" : Order is required to  be picked-up by patient from pharmacy store</td></tr><tr><td>address</td><td>String</td><td>Address of Patient for delivery.</td></tr><tr><td>address_line2</td><td>String</td><td>Address Line 2 for long address</td></tr><tr><td>city</td><td>String </td><td>City of Patient for delivery</td></tr><tr><td>state</td><td>String</td><td>State of Patient for delivery</td></tr><tr><td>copay_type</td><td>'flat' | 'percentage'</td><td>Copay amount type paid by the organization</td></tr><tr><td>copay_value</td><td>Number</td><td>Copay amount</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2025-07-28 16:13:52",
    "version": "1.1.254",
    "data": {
        "shipping_charges": 50,
        "charges": {
            "total": {
                "with_discount": 355.8,
                "without_discount": 355.8
            },
            "delivery_charge": {
                "with_discount": 69,
                "without_discount": 69
            },
            "roundoff": {
                "with_discount": 0.2,
                "without_discount": 0.2
            },
            "payable_amount": {
                "with_discount": 425,
                "without_discount": 424.8
            },
            "wallet_amount": {
                "available_amount": 0,
                "redeemable_amount": 0
            },
            "surge_charge": {
                "with_discount": 0,
                "without_discount": 0
            },
            "handling_fee": {
                "with_discount": 0,
                "without_discount": 0
            },
            "small_cart_fee": {
                "with_discount": 0,
                "without_discount": 0
            },
            "delivery_tip_amount": {
                "with_discount": 0,
                "without_discount": 0
            }
        },
        "items": [
            {
                "medicine_id": "EvM8wa0vXyjsi2JZnNKXrA==",
                "mrp": 42.83,
                "price": 42.83,
                "discount_percentage": 0,
                "available": "yes",
                "available_quantity": 2,
                "requested_quantity": 2,
                "alternatives": [
                    {
                        "medicine_id": "y1sw0N315wy4+UDhhT5FjA==",
                        "medicine_slug": "ltk-50-tablet-MDDRG507073861",
                        "content": "Losartan (50mg)",
                        "is_rx_required": 0,
                        "medicine_name": "Ltk 50 Tablet",
                        "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
                        "size": 10,
                        "packing": "Strip",
                        "pack_size": "10 Tablet",
                        "packing_size": "1 Strip of  10 Tablet",
                        "mrp": 25,
                        "price": 25,
                        "discount_percentage": 0,
                        "medicine_type": "drug",
                        "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/itemoriginalcopy/medicines/6142edda9e799.jpeg",
                        "available_quantity": 2,
                        "available": "yes",
                        "requested_quantity": 2,
                        "estimated_delivery_tat": "2025-07-28 18:13:52",
                        "service_type": "regular"
                    },
                    {
                        "medicine_id": "biijdBcG6mMCg+g8mrHGFA==",
                        "medicine_slug": "losfirst-50mg-tablet-MDDRG5503084143",
                        "content": "Losartan (50mg)",
                        "is_rx_required": 1,
                        "medicine_name": "Losfirst 50 mg Tablet",
                        "manufacturer_name": "Zyphar's Pharmaceuticals Pvt Ltd",
                        "size": 10,
                        "packing": "Strip",
                        "pack_size": "10 Tablets",
                        "packing_size": "10 tablets in 1 strip",
                        "mrp": 44.63,
                        "price": 41.06,
                        "discount_percentage": 8,
                        "medicine_type": "drug",
                        "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/itemoriginalcopy/medicines/default.jpg",
                        "available_quantity": 2,
                        "available": "yes",
                        "requested_quantity": 2,
                        "estimated_delivery_tat": "2025-07-28 18:13:52",
                        "service_type": "regular"
                    }
                ],
                "estimated_delivery_tat": "2025-07-28 18:13:52",
                "service_type": "regular"
            },
            {
                "medicine_id": "eYlGilhNCz4CDs/NqrnbcQ==",
                "mrp": 12.8,
                "price": 11.52,
                "discount_percentage": 10,
                "available": "yes",
                "available_quantity": 5,
                "requested_quantity": 5,
                "alternatives": [],
                "estimated_delivery_tat": "2025-07-28 18:13:52",
                "service_type": "regular"
            },
            {
                "medicine_id": "y1sw0N315wy4+UDhhT5FjA==",
                "mrp": 25,
                "price": 23,
                "discount_percentage": 8,
                "available": "yes",
                "available_quantity": 2,
                "requested_quantity": 2,
                "alternatives": [],
                "estimated_delivery_tat": "2025-07-28 18:13:52",
                "service_type": "regular"
            },
            {
                "medicine_id": "adUASNSP6SnY/XbyHLkruw==",
                "mrp": 65.21,
                "price": 58.69,
                "discount_percentage": 10,
                "available": "no",
                "available_quantity": 0,
                "requested_quantity": 2,
                "alternatives": [],
                "estimated_delivery_tat": "",
                "service_type": ""
            }
        ],
        "cart_options": [
            {
                "label": "quick_same_medicines",
                "title": "Quick Delivery with Same Medicines",
                "available_item_count": 3,
                "total_mrp": 199.66,
                "total_discount": 10.4,
                "total_price": 189.26,
                "shipping": 50,
                "payable_amount": 239.26,
                "items": [
                    {
                        "medicine_id": "EvM8wa0vXyjsi2JZnNKXrA==",
                        "mrp": 42.83,
                        "price": 42.83,
                        "discount_percentage": 0,
                        "requested_quantity": 2,
                        "amount": 85.66,
                        "medicine_slug": "losakind-50-tablet-MDDRG286667590",
                        "content": "Losartan (50mg)",
                        "is_rx_required": 1,
                        "medicine_name": "Losakind-50 Tablet",
                        "manufacturer_name": "Mankind Pharma Ltd",
                        "size": 10,
                        "packing": "Strip",
                        "pack_size": "10 Tablet",
                        "packing_size": "1 Strip of  10 Tablet",
                        "medicine_type": "drug",
                        "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/itemoriginalcopy/medicines/62975c5feb174.jpg",
                        "is_swap_available": "no",
                        "swap_medicines": [],
                        "available_quantity": 2,
                        "available": "yes",
                        "estimated_delivery_tat": "2025-07-28 18:13:52",
                        "service_type": "regular"
                    },
                    {
                        "medicine_id": "eYlGilhNCz4CDs/NqrnbcQ==",
                        "mrp": 12.8,
                        "price": 11.52,
                        "discount_percentage": 10,
                        "requested_quantity": 5,
                        "amount": 57.6,
                        "medicine_slug": "ltk-25mg-tablet-MDDRG507073860",
                        "content": "Losartan (25mg)",
                        "is_rx_required": 1,
                        "medicine_name": "Ltk 25mg Tablet",
                        "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
                        "size": 10,
                        "packing": "Strip",
                        "pack_size": "10 Tablet",
                        "packing_size": "1 Strip of  10 Tablet",
                        "medicine_type": "drug",
                        "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/itemoriginalcopy/medicines/60c459646117f.jpg",
                        "is_swap_available": "no",
                        "swap_medicines": [],
                        "available_quantity": 5,
                        "available": "yes",
                        "estimated_delivery_tat": "2025-07-28 18:13:52",
                        "service_type": "regular"
                    },
                    {
                        "medicine_id": "y1sw0N315wy4+UDhhT5FjA==",
                        "mrp": 25,
                        "price": 23,
                        "discount_percentage": 8,
                        "requested_quantity": 2,
                        "amount": 46,
                        "medicine_slug": "ltk-50-tablet-MDDRG507073861",
                        "content": "Losartan (50mg)",
                        "is_rx_required": 0,
                        "medicine_name": "Ltk 50 Tablet",
                        "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
                        "size": 10,
                        "packing": "Strip",
                        "pack_size": "10 Tablet",
                        "packing_size": "1 Strip of  10 Tablet",
                        "medicine_type": "drug",
                        "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/itemoriginalcopy/medicines/6142edda9e799.jpeg",
                        "is_swap_available": "no",
                        "swap_medicines": [],
                        "available_quantity": 2,
                        "available": "yes",
                        "estimated_delivery_tat": "2025-07-28 18:13:52",
                        "service_type": "regular"
                    },
                    {
                        "medicine_id": "adUASNSP6SnY/XbyHLkruw==",
                        "mrp": 65.21,
                        "price": 58.69,
                        "discount_percentage": 10,
                        "requested_quantity": 2,
                        "amount": 0,
                        "medicine_slug": "dytor-----5",
                        "content": "",
                        "is_rx_required": 0,
                        "medicine_name": "Dytor -   5",
                        "manufacturer_name": "1mg Technologies Pvt. Ltd",
                        "size": 15,
                        "packing": "15",
                        "pack_size": "15T",
                        "packing_size": "15T",
                        "medicine_type": "drug",
                        "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/itemoriginalcopy/medicines/default.jpg",
                        "is_swap_available": "no",
                        "swap_medicines": [],
                        "available_quantity": 0,
                        "available": "no",
                        "estimated_delivery_tat": "",
                        "service_type": ""
                    }
                ]
            },
            {
                "label": "quick_alternative_medicines",
                "title": "Quick Delivery with Alternative Medicines",
                "available_item_count": 3,
                "total_mrp": 199.66,
                "total_discount": 10.4,
                "total_price": 189.26,
                "shipping": 50,
                "payable_amount": 239.26,
                "items": [
                    {
                        "medicine_id": "EvM8wa0vXyjsi2JZnNKXrA==",
                        "mrp": 42.83,
                        "price": 42.83,
                        "discount_percentage": 0,
                        "requested_quantity": 2,
                        "amount": 85.66,
                        "medicine_slug": "losakind-50-tablet-MDDRG286667590",
                        "content": "Losartan (50mg)",
                        "is_rx_required": 1,
                        "medicine_name": "Losakind-50 Tablet",
                        "manufacturer_name": "Mankind Pharma Ltd",
                        "size": 10,
                        "packing": "Strip",
                        "pack_size": "10 Tablet",
                        "packing_size": "1 Strip of  10 Tablet",
                        "medicine_type": "drug",
                        "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/itemoriginalcopy/medicines/62975c5feb174.jpg",
                        "is_swap_available": "no",
                        "swap_medicines": [],
                        "available_quantity": 2,
                        "available": "yes",
                        "estimated_delivery_tat": "2025-07-28 18:13:52",
                        "service_type": "regular"
                    },
                    {
                        "medicine_id": "eYlGilhNCz4CDs/NqrnbcQ==",
                        "mrp": 12.8,
                        "price": 11.52,
                        "discount_percentage": 10,
                        "requested_quantity": 5,
                        "amount": 57.6,
                        "medicine_slug": "ltk-25mg-tablet-MDDRG507073860",
                        "content": "Losartan (25mg)",
                        "is_rx_required": 1,
                        "medicine_name": "Ltk 25mg Tablet",
                        "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
                        "size": 10,
                        "packing": "Strip",
                        "pack_size": "10 Tablet",
                        "packing_size": "1 Strip of  10 Tablet",
                        "medicine_type": "drug",
                        "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/itemoriginalcopy/medicines/60c459646117f.jpg",
                        "is_swap_available": "no",
                        "swap_medicines": [],
                        "available_quantity": 5,
                        "available": "yes",
                        "estimated_delivery_tat": "2025-07-28 18:13:52",
                        "service_type": "regular"
                    },
                    {
                        "medicine_id": "y1sw0N315wy4+UDhhT5FjA==",
                        "mrp": 25,
                        "price": 23,
                        "discount_percentage": 8,
                        "requested_quantity": 2,
                        "amount": 46,
                        "medicine_slug": "ltk-50-tablet-MDDRG507073861",
                        "content": "Losartan (50mg)",
                        "is_rx_required": 0,
                        "medicine_name": "Ltk 50 Tablet",
                        "manufacturer_name": "Unison Pharmaceuticals Pvt Ltd",
                        "size": 10,
                        "packing": "Strip",
                        "pack_size": "10 Tablet",
                        "packing_size": "1 Strip of  10 Tablet",
                        "medicine_type": "drug",
                        "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/itemoriginalcopy/medicines/6142edda9e799.jpeg",
                        "is_swap_available": "no",
                        "swap_medicines": [],
                        "available_quantity": 2,
                        "available": "yes",
                        "estimated_delivery_tat": "2025-07-28 18:13:52",
                        "service_type": "regular"
                    },
                    {
                        "medicine_id": "adUASNSP6SnY/XbyHLkruw==",
                        "mrp": 65.21,
                        "price": 58.69,
                        "discount_percentage": 10,
                        "requested_quantity": 2,
                        "amount": 0,
                        "medicine_slug": "dytor-----5",
                        "content": "",
                        "is_rx_required": 0,
                        "medicine_name": "Dytor -   5",
                        "manufacturer_name": "1mg Technologies Pvt. Ltd",
                        "size": 15,
                        "packing": "15",
                        "pack_size": "15T",
                        "packing_size": "15T",
                        "medicine_type": "drug",
                        "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/itemoriginalcopy/medicines/default.jpg",
                        "is_swap_available": "no",
                        "swap_medicines": [],
                        "available_quantity": 0,
                        "available": "no",
                        "estimated_delivery_tat": "",
                        "service_type": ""
                    }
                ]
            }
        ]
    }
}
```

{% endtab %}

{% tab title="200: OK Invalid params" %}

```json
{
    "status_code": "0",
    "status_message": "longitude is required",
    "datetime": "2023-02-15 12:46:54",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK No pharmacy found" %}

```json
{
    "status_code": "0",
    "status_message": "No Pharmacies found near by your location",
    "datetime": "2023-02-15 12:37:11",
    "data": null
}
```

{% endtab %}

{% tab title="200: Error Note" %}
**Error Slug :** It provides the an error slug for shorter error form.\
**Error Note :** It provides potential errors can occur during the place-order flow working as a pre-validator. This gives error full description

* **`ADDRESS_LAT_LONG_MISMATCH` :** It indicates that the patient `address` (**address + address\_line2 + city + state + zipcode**) does not match with `latitude` & `longitude` . Such major difference can cause discrepancy at the time of delivery.

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2026-02-23 16:56:03",
    "version": "1.1.559",
    "data": {
        "error_slug": "ADDRESS_LAT_LONG_MISMATCH",
        "error_note": "Your current location must be within 3000 meters of the provided address.",
        "shipping_charges": 99,
        "charges": {
            "total": {
                "with_discount": 30.74,
                "without_discount": 30.74
            },
            "delivery_charge": {
                "with_discount": 99,
                "without_discount": 99
            },
            "roundoff": {
                "with_discount": 0.26,
                "without_discount": 0.26
            },
            "payable_amount": {
                "with_discount": 130,
                "without_discount": 129.74
            },
            "wallet_amount": {
                "available_amount": 0,
                "redeemable_amount": 0
            },
            "surge_charge": {
                "with_discount": 0,
                "without_discount": 0
            },
            "handling_fee": {
                "with_discount": 0,
                "without_discount": 0
            },
            "small_cart_fee": {
                "with_discount": 0,
                "without_discount": 0
            },
            "delivery_tip_amount": {
                "with_discount": 0,
                "without_discount": 0
            }
        },
        "items": [
            {
                "medicine_id": "25d10fcd689bd0d00b2ddf1f80504404",
                "mrp": 30.74,
                "price": 30.74,
                "discount_percentage": 0,
                "available": "yes",
                "available_quantity": 1,
                "requested_quantity": 1,
                "hsn_code": "12343245",
                "medicine_category": "generic",
                "salt_content_id": "55331f9e6726942309ea0a07700cfade",
                "medicine_uses": "Dolo 650 mg Tablet is used for <a href='/diseases/pain-relief-168'>pain relief</a> and <a href='/diseases/fever-191'>fever</a>. It is used to relieve pain in conditions like headache, joint pain, muscle pain or dental pain.",
                "medicine_slug": "dolo-650-mg-tablet-MDDRG315497373",
                "content": "Paracetamol/Acetaminophen (650mg)",
                "medicine_name": "Dolo 650 Mg Tablet",
                "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/itemoriginalcopy/medicines/default.jpg",
                "size": 15,
                "packing": "Strip",
                "pack_size": "15 Tablets",
                "packing_size": "1 Strip of 15 tablets",
                "popularity_score": 0,
                "medicine_type": "drug",
                "alternatives": [
                    {
                        "medicine_id": "e083b908ee27700b7a4f427af70d2c6a",
                        "medicine_slug": "doloflam-tablet-MDDRG5194076526",
                        "content": "Nimesulide (NA)",
                        "is_rx_required": 1,
                        "medicine_name": "Doloflam Tablet",
                        "manufacturer_name": "Vilco Laboratories Pvt Ltd",
                        "size": 10,
                        "packing": "Strip",
                        "pack_size": "10 Tablets",
                        "packing_size": "10 tablets in 1 strip",
                        "mrp": 9.3,
                        "price": 8.37,
                        "discount_percentage": 10,
                        "medicine_type": "drug",
                        "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/itemoriginalcopy/medicines/default.jpg",
                        "available_quantity": 1,
                        "available": "yes",
                        "requested_quantity": 1,
                        "popularity_score": 0,
                        "estimated_delivery_tat": "2026-02-23 18:56:03",
                        "service_type": "regular"
                    },
                    {
                        "medicine_id": "25238bbc02da87d1e4d64ce6f0bc6641",
                        "medicine_slug": "vesdol-gel-MDOTC5174086888",
                        "content": "",
                        "is_rx_required": 0,
                        "medicine_name": "Vesdol Gel",
                        "manufacturer_name": "Vestal Healthcare",
                        "size": 1,
                        "packing": "Gel",
                        "pack_size": "30 Gm",
                        "packing_size": "30 gm Gel",
                        "mrp": 90,
                        "price": 90,
                        "discount_percentage": 0,
                        "medicine_type": "otc",
                        "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/itemoriginalcopy/medicines/blank_otc_uobogo.png",
                        "available_quantity": 1,
                        "available": "yes",
                        "requested_quantity": 1,
                        "popularity_score": 0,
                        "estimated_delivery_tat": "2026-02-23 18:56:03",
                        "service_type": "regular"
                    },
                    {
                        "medicine_id": "68ead7689035e0b037c9c23e99b5108e",
                        "medicine_slug": "rancil-10-tablet-MDDRG4750189557",
                        "content": "Cilnidipine (10mg)",
                        "is_rx_required": 1,
                        "medicine_name": "Rancil 10 Tablet",
                        "manufacturer_name": "Sun Pharmaceutical Industries Ltd",
                        "size": 10,
                        "packing": "Strip",
                        "pack_size": "10 Tablets",
                        "packing_size": "10 tablets in 1 strip",
                        "mrp": 86,
                        "price": 86,
                        "discount_percentage": 0,
                        "medicine_type": "drug",
                        "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/itemoriginalcopy/medicines/rancil-10-tablet-MDDRG4750189557.jpg",
                        "available_quantity": 0,
                        "available": "no",
                        "requested_quantity": 1,
                        "popularity_score": 0,
                        "estimated_delivery_tat": "",
                        "service_type": ""
                    }
                ],
                "is_rx_required": 0,
                "estimated_delivery_tat": "2026-02-23 18:56:03",
                "service_type": "regular"
            }
        ],
        "cart_options": [
            {
                "label": "quick_same_medicines",
                "title": "Quick Delivery with Same Medicines",
                "available_item_count": 1,
                "total_mrp": 30.74,
                "total_discount": 0,
                "total_price": 30.74,
                "shipping": 99,
                "payable_amount": 129.74,
                "items": [
                    {
                        "medicine_id": "25d10fcd689bd0d00b2ddf1f80504404",
                        "mrp": 30.74,
                        "price": 30.74,
                        "discount_percentage": 0,
                        "requested_quantity": 1,
                        "amount": 30.74,
                        "medicine_slug": "dolo-650-mg-tablet-MDDRG315497373",
                        "content": "Paracetamol/Acetaminophen (650mg)",
                        "is_rx_required": 0,
                        "medicine_name": "Dolo 650 Mg Tablet",
                        "manufacturer_name": "Micro Labs Ltd",
                        "popularity_score": 0,
                        "available_for_patient": "yes",
                        "size": 15,
                        "packing": "Strip",
                        "pack_size": "15 Tablets",
                        "packing_size": "1 Strip of 15 tablets",
                        "medicine_type": "drug",
                        "medicine_category": "generic",
                        "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/itemoriginalcopy/medicines/default.jpg",
                        "is_swap_available": "no",
                        "swap_medicines": [],
                        "available_quantity": 1,
                        "available": "yes",
                        "estimated_delivery_tat": "2026-02-23 18:55:59",
                        "service_type": "regular"
                    }
                ]
            },
            {
                "label": "quick_alternative_medicines",
                "title": "Quick Delivery with Alternative Medicines",
                "available_item_count": 1,
                "total_mrp": 30.74,
                "total_discount": 0,
                "total_price": 30.74,
                "shipping": 99,
                "payable_amount": 129.74,
                "items": [
                    {
                        "medicine_id": "25d10fcd689bd0d00b2ddf1f80504404",
                        "mrp": 30.74,
                        "price": 30.74,
                        "discount_percentage": 0,
                        "requested_quantity": 1,
                        "amount": 30.74,
                        "medicine_slug": "dolo-650-mg-tablet-MDDRG315497373",
                        "content": "Paracetamol/Acetaminophen (650mg)",
                        "is_rx_required": 0,
                        "medicine_name": "Dolo 650 Mg Tablet",
                        "manufacturer_name": "Micro Labs Ltd",
                        "popularity_score": 0,
                        "available_for_patient": "yes",
                        "size": 15,
                        "packing": "Strip",
                        "pack_size": "15 Tablets",
                        "packing_size": "1 Strip of 15 tablets",
                        "medicine_type": "drug",
                        "medicine_category": "generic",
                        "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/itemoriginalcopy/medicines/default.jpg",
                        "is_swap_available": "no",
                        "swap_medicines": [],
                        "available_quantity": 1,
                        "available": "yes",
                        "estimated_delivery_tat": "2026-02-23 18:55:59",
                        "service_type": "regular"
                    }
                ]
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}


# Place Order V3

To place order with items and its quantity.

Place Order API has two flow:

1. **Manual Flow** : The available items are passed and order can be placed.
2. **Prescription Digitization Flow** : In this flow only prescription will be provided which will be digitized at our end then, order will be placed.
3. **Order To a Particular Pharmacy (Pickup Order Only):** For Pickup orders the order can be placed to a particular chemist directly which are nearby to the user location. Refer to API `checkout_with_pharmacy` and use parameter `assign_to_chemist_id` .

> In API request, You need to pass either provide **patient\_id** or **mobile & patient\_name**.

To Place an order you can try with below medicines:

* LTK-25    ( BEXJIx1DBa0TyZQjJB+qDw== )
* LTK-50    ( gv0GokYn9w4zFL51eouS2g== )
* LTK-AM   ( vVgL6Ggy5tYhqQr1qXOAzA== )
* Rancil 10  ( kb/sYNrCj/A7lRqf7VCQOA== )
* Vicks Vapourub 25 ml  ( P50Ved5KnpFmBp9XGAIVUg== )

## <img src="https://static.vecteezy.com/system/resources/thumbnails/018/930/572/small/youtube-logo-youtube-icon-transparent-free-png.png" alt="" data-size="line"> [Placing Orders with Ease: A Step-by-Step Guide](https://youtu.be/1TlUVPaWolI?si=2ybv22QYp_P3w994)

## Things to know

* **Price Increase After Order Place:** (very less probability to occur)
  * **Scenario :** While taking the payment if time difference is too large between checkout and place-order due to payment delay(from patient/user) then the `location_token` might change. This might resulting in price-increase.
    * **Solution-1:** Every time Before taking the payment from user refresh the location-token, then call checkout-v3 to get updated price. After that only place-order to avoid price increase.
    * **Solution-2:** Compare the order-total from Place-Order API Response with the payment amount taken from patient(user). If order-total is increased then cancel the order and place a new another.
    * **Solution-3:** Place the order in `pending` state and then take payment on **order-total** from Place-Order Response. And then call **Payment-Webhook  API** to notify us.

## Place Order

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}fulfillment/orders/place_order_v3`](https://ews-staging-api-product.portal-evital.com/v1/fulfillment/orders/place_order_v3)

#### Request Body

| Name                                              | Type                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------------------------------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>          | String                 | Authentication token                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| location\_token<mark style="color:red;">\*</mark> | String                 | Get token from Check Serviceability V3 API                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| patient\_id<mark style="color:red;">\*</mark>     | String                 | <p>Id to uniquely identify the patient for whom the order is placed  </p><p></p><p>if mobile and patient name is provided, then patient\_id is optional.</p>                                                                                                                                                                                                                                                                                                                                                                                              |
| items<mark style="color:red;">\*</mark>           | String                 | <p>Stringified Array of items with quantity (in strip) and medicine\_id.</p><p><em>i.e.</em> \[{"medicine\_id":"Eli4pMFfzobV63G67jtjZw==","quantity": 2}]</p><p><br>Provide only available items which can be know from checkout V3.</p><p><br>Pass "discount\_percentage" along with "medicine\_id" and quantity to apply custom discount on the item.</p>                                                                                                                                                                                               |
| delivery\_type<mark style="color:red;">\*</mark>  | 'pickup' \| 'delivery' | <p><strong>delivery</strong> (<em>Default</em>): Order will be delivered.<br><strong>pickup</strong> : Order will be of pick-up type.</p>                                                                                                                                                                                                                                                                                                                                                                                                                 |
| address<mark style="color:red;">\*</mark>         | String                 | Address of Patient for delivery. required if delivery\_type is **delivery**                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| address\_line2                                    | String                 | Address Line 2 for long address                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| city<mark style="color:red;">\*</mark>            | String                 | City of Patient for delivery                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| state<mark style="color:red;">\*</mark>           | String                 | State of Patient for delivery                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| zipcode<mark style="color:red;">\*</mark>         | String                 | Zip code of Patient for delivery                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| latitude                                          | Number                 | Latitude of the patient to search in nearby pharmacies.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| longitude                                         | Number                 | Longitude of the patient to search in the nearby pharmacies.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| mobile                                            | String                 | Patient's mobile no is optional if patient\_id is provided, required otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| patient\_name                                     | String                 | Patient's name is optional if patient\_id is provided, required otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| prescription\_urls                                | String                 | <p>Stringified Array of prescription URLs.​</p><p></p><p><strong>items</strong> param is optional, if <strong>prescription\_urls</strong> param is passed.​</p><p></p><p><strong>prescription\_urls</strong> is mandatory for RX medicine.(Check is\_rx\_required from <a href="/pages/P8NUqyzdF9XhZrDTIYko">checkout</a>)</p><p></p><p>For eg.</p><p>\["<https://www.klippa.com/wp-content/uploads/2020/12/medical-prescription-ocr.png","https://as2.ftcdn.net/v2/jpg/00/56/61/71/500_F_56617167_ZGbrr3mHPUmLoksQmpuY7SPA8ihTI5Dh.jpg>"]</p><p><br></p> |
| full\_address                                     | String                 | <p>Required If lat-long is not provided. This address is used to get the lat-long to find the nearest pharmacy store.</p><p></p><p>Only zipcode can also by passed in this param </p><p></p><p>like <code>{ "full\_address": "560008" }</code></p>                                                                                                                                                                                                                                                                                                        |
| requestId                                         | String                 | Partner order id                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| requested\_client\_source                         | String                 | Partner Order Source                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| assign\_to\_chemist\_id                           | String                 | Chemist ID from `checkout_with_pharmacy` API to assign the order to a particular chemist                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| copay\_type                                       | 'flat' \| 'percentage' | Copay amount type paid by the organization                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| copay\_value                                      | Number                 | Copay amount                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

{% tabs %}
{% tab title="200 Order Placed successfully." %}

```json
{
    "status_code": "1",
    "status_message": "Order placed successfully",
    "datetime": "2025-03-13 17:52:30",
    "version": "1.1.51",
    "data": {
        "order_id": "F7VH/hoYLmOIBrCiHyccng==",
        "order_number": "OOM87BK5Y7",
        "total_amount": 119,
        "total": 149,
        "split_orders": [
            {
                "order_id": "7xS09/uGsj9fglWVxIw97Q==",
                "order_number": "O2M87BK68H",
                "chemist_details": {
                    "chemist_id": "GJmQXzl+VAVkke3efyTrcw==",
                    "pharmacy_name": "Demo Pharmacy",
                    "full_address": "Evital Rx 4d Square Mall, Ahmedabad, Gujarat, India, 380005",
                    "latitude": "23.1025849",
                    "longitude": "72.5953601",
                    "zipcode": "380005"
                }
            }
        ],
        // For only copay enabled clients
        "payment_url": "https://ews-staging-mypillo.portal-evital.com/fulfillment/cart/61d843744cfa220afa0a6f6d450db6d8"
    }
}
```

{% endtab %}

{% tab title="200: OK Order failed." %}

```json
{
    "status_code": "0",
    "status_message": "Something went wrong",
    "datetime": "2022-12-06 18:47:41",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Order Details V2

To view order details

## Order View

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}fulfillment/orders/view_v2`](https://ews-staging-api-product.portal-evital.com/v1/fulfillment/orders/view_v2)

#### Request Body

| Name                                        | Type   | Description            |
| ------------------------------------------- | ------ | ---------------------- |
| order\_id<mark style="color:red;">\*</mark> | String | Unique id of the order |
| apikey<mark style="color:red;">\*</mark>    | String | Authentication token   |

{% tabs %}
{% tab title="200: OK Order successfully retrieved." %}

```json
{
    "status_code": "1",
    "status_message": "Order details fetched successfully",
    "datetime": "2025-03-18 12:49:43",
    "version": "1.1.59",
    "data": {
        "order_id": "t423AnBm695D8u+Lt2tJqQ==",
        "order_number": "OGM8E5B9M5",
        "payment_date": "2025-03-18 12:31:59",
        "payment_status": 3,
        "address_name": "home",
        "address": "eVitalRx office, 4D square mall",
        "address_line2": "",
        "city": "Ahmedabad",
        "zipcode": "380005",
        "created_date": "2025-03-18 12:31:59",
        "redeembalance": 0,
        "prescription_group_id": "",
        "voucher_id": 0,
        "voucher_amount": 0,
        "voucher_discount": 0,
        "prescription_details": [],
        "items": [
            {
                "medicine_id": "EvM8wa0vXyjsi2JZnNKXrA==",
                "medicine_name": "Losakind-50 Tablet",
                "size": 10,
                "packing": "Strip",
                "pack_size": "10 Tablet",
                "packing_size": "1 Strip of  10 Tablet",
                "medicine_type": "drug",
                "gst_percentage": 12,
                "quantity": 10,
                "mrp": 42.83,
                "price": 38.55,
                "discount_percentage": 10,
                "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/medicines/thumb/62975c5feb174.jpg"
            },
            {
                "medicine_id": "y1sw0N315wy4+UDhhT5FjA==",
                "medicine_name": "Ltk 50 Tablet",
                "size": 10,
                "packing": "Strip",
                "pack_size": "10 Tablet",
                "packing_size": "1 Strip of  10 Tablet",
                "medicine_type": "drug",
                "gst_percentage": 12,
                "quantity": 2,
                "mrp": 23.5,
                "price": 21.15,
                "discount_percentage": 10,
                "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/medicines/thumb/6142edda9e799.jpeg"
            }
        ],
        "charges": {
            "total": {
                "with_discount": 427.8,
                "without_discount": 475.3
            },
            "delivery_charge": {
                "with_discount": 30,
                "without_discount": 30
            },
            "roundoff": {
                "with_discount": 0.2,
                "without_discount": 0.2
            },
            "payable_amount": {
                "with_discount": 458,
                "without_discount": 505.3
            },
            "applied_discounts": {
                "wallet_redeemed": 0,
                "voucher_applied": 0
            }
        },
        "overall_status": "assigned",
        "draft_order_status": "assigned",
        "split_orders": [
            {
                "order_id": "64b37pPrrwp1clQteCuWMw==",
                "chemist_order_number": "OTM8E5B9S7",
                "chemist_order_id": "64b37pPrrwp1clQteCuWMw==",
                "utm_source": "visit_health",
                "chemist_id": 685,
                "total": 458,
                "order_status": "assigned",
                "delivery_id": 0,
                "tracking_url": "localhost/evital/to/t423AnBm695D8u+Lt2tJqQ==/",
                "created_date": "2025-03-18 12:31:58",
                "order_delivery_status": "assigned",
                "delivery_pin": 1234,
                "delivery_partner": "vitrun",
                "delivery_estimate_time": 42,
                "delivery_charge": 30,
                "amount": 428,
                "discount": 0,
                "reject_reason": "Wrong medicines order",
                "order_status_display_text": "Pharmacy has received your order.",
                "estimated_maximum_delivery_date": "2025-03-19 14:24:36",
                "estimated_minimum_delivery_date": "2025-03-19 13:24:36",
                "service_type":"regular",
                "verification_images": {
                    "order_packet_verification_images": [],
                    "order_items_verification_images": []
                },
                "invoice_print_url": "http://localhost:8080/evital/invoice/T1RNOEU1QjlTNw==/print/",
                "invoice_pdf": "",
                "items": [
                    {
                        "medicine_id": "EvM8wa0vXyjsi2JZnNKXrA==",
                        "medicine_name": "Losakind-50 Tablet",
                        "size": 10,
                        "packing": "Strip",
                        "pack_size": "10 Tablet",
                        "packing_size": "1 Strip of  10 Tablet",
                        "medicine_type": "drug",
                        "gst_percentage": 12,
                        "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/medicines/thumb/62975c5feb174.jpg",
                        "quantity": 10,
                        "mrp": 42.83,
                        "price": 38.55,
                        "discount": 10
                    },
                    {
                        "medicine_id": "y1sw0N315wy4+UDhhT5FjA==",
                        "medicine_name": "Ltk 50 Tablet",
                        "size": 10,
                        "packing": "Strip",
                        "pack_size": "10 Tablet",
                        "packing_size": "1 Strip of  10 Tablet",
                        "medicine_type": "drug",
                        "gst_percentage": 12,
                        "image": "https://d3cgpvqmlaynvp.cloudfront.net/storage/medicines/thumb/6142edda9e799.jpeg",
                        "quantity": 2,
                        "mrp": 23.5,
                        "price": 21.15,
                        "discount": 10
                    }
                ],
                "chemist_details": {
                    "chemist_id": "EQYmBF/sPyAcIbTXvZ6vRA==",
                    "details": {
                        "pharmacy_name": "Demo Pharmacy",
                        "pharmacy_logo": "https://d3cgpvqmlaynvp.cloudfront.net/storage/chemists/kyc/col6p1dhuv.jpg",
                        "store_photos": [
                            "https://d3cgpvqmlaynvp.cloudfront.net/storage/chemists/kyc/35kddetdv0.png"
                        ],
                        "full_address": "Evital Rx 4d Square Mall, Ahmedabad, Gujarat, India, 380005",
                        "latitude": "23.1025849",
                        "longitude": "72.5953601",
                        "zipcode": "380005",
                        "store_timings": {
                            "fullday_working": "yes",
                            "timings": [
                                {
                                    "id": "tGykhzbp4nsd9zeEAPSYuQ==",
                                    "day_of_week": "monday",
                                    "working": "no",
                                    "start_time": "07:00:00",
                                    "end_time": "18:00:00"
                                },
                                {
                                    "id": "clyhyxOLPjGvmfppybaa/g==",
                                    "day_of_week": "tuesday",
                                    "working": "no",
                                    "start_time": "07:00:00",
                                    "end_time": "14:00:00"
                                },
                                {
                                    "id": "rhvyzAAfMfMZzX4Rpt30bA==",
                                    "day_of_week": "wednesday",
                                    "working": "no",
                                    "start_time": "07:00:00",
                                    "end_time": "20:30:00"
                                },
                                {
                                    "id": "FrJIdUy/EpK93fcLJcNNbg==",
                                    "day_of_week": "thursday",
                                    "working": "no",
                                    "start_time": "07:00:00",
                                    "end_time": "14:00:00"
                                },
                                {
                                    "id": "xlE5pmGCNWdjVV7pR7foJw==",
                                    "day_of_week": "friday",
                                    "working": "no",
                                    "start_time": "07:00:00",
                                    "end_time": "14:00:00"
                                },
                                {
                                    "id": "shodTymtXk8SWykPUv80yw==",
                                    "day_of_week": "saturday",
                                    "working": "no",
                                    "start_time": "07:00:00",
                                    "end_time": "19:00:00"
                                },
                                {
                                    "id": "bvtsaFKUrO4nLT1fLD80rQ==",
                                    "day_of_week": "sunday",
                                    "working": "no",
                                    "start_time": "00:00:00",
                                    "end_time": "23:59:59"
                                }
                            ]
                        }
                    }
                }
            }
        ],
        "refund_detail": {
            "refund_mode": "original_payment",
            "refund_date": "2026-08-31 11:16:41",
            "refund_status": "initiated",
            "original_payment_amount": 149,
            "pillo_coin_amount": 0,
            "refund_message": "Refund of ₹149 has been initiated to your original payment."
        }
    }
}
```

{% endtab %}

{% tab title="200: OK Could not find an order matching this query." %}

```json
{
    "status_code": "0",
    "status_message": "No record found",
    "datetime": "2022-12-07 14:30:56",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Cancel Order V2

The patient can cancel the order with this API.

## Push the Order in Cancelled state

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}fulfillment/orders/cancel_order_v2`](https://ews-staging-api-product.portal-evital.com/v1/fulfillment/orders/cancel_order_v2)

The order can not be cancelled after accepted status.

#### Request Body

| Name                                         | Type   | Description                                                                           |
| -------------------------------------------- | ------ | ------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>     | String | Authentication token                                                                  |
| order\_id<mark style="color:red;">\*</mark>  | String | Order ID from the response of Place Order API.                                        |
| reason\_id<mark style="color:red;">\*</mark> | Number | ID of the reasons got from Get Reject Reasons API.                                    |
| reason                                       | String | <p>Other reason if any<br><br>if reason\_id is provided, then reason is optional.</p> |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Your order cancelled successfully.",
    "datetime": "2023-03-21 16:05:47",
    "ng_version": "0.0.378",
    "data": null
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "order_id is required",
    "datetime": "2023-03-09 17:03:38",
    "data": null
}
```

{% endtab %}
{% endtabs %}


# Get Reject Reasons

Get list of reasons to reject the order.

<mark style="color:green;">`POST`</mark> [`{{apiUrl}}fulfillment/orders/reject_reasons`](https://ews-staging-api-product.portal-evital.com/v1/fulfillment/orders/reject_reasons)

#### Request Body

| Name                                             | Type   | Description          |                                                               |
| ------------------------------------------------ | ------ | -------------------- | ------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>         | String | Authentication token |                                                               |
| reason\_source<mark style="color:red;">\*</mark> | String | <p>"pickup"          | "delivery"</p><p></p><p>pass order is pickup or delivery.</p> |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "status_code": "1",
    "status_message": "Success",
    "datetime": "2025-05-02 16:05:50",
    "version": "1.1.118",
    "data": {
        "reasons": [
            {
                "id": 13,
                "reason": "Wrong medicines order"
            },
            {
                "id": 14,
                "reason": "Order placed on wrong address"
            },
            {
                "id": 15,
                "reason": "No response in order"
            },
            {
                "id": 12,
                "reason": "Discount is less"
            },
            {
                "id": 16,
                "reason": "By mistake place an order"
            },
            {
                "id": 17,
                "reason": "Other"
            }
        ]
    }
}
```

{% endtab %}

{% tab title="200: OK Validation Error" %}

```json
{
    "status_code": "0",
    "status_message": "reason_source must be one of [pickup, delivery]",
    "datetime": "2023-03-21 17:19:21",
    "data": null
}
```

{% endtab %}
{% endtabs %}




---

[Next Page](/llms-full.txt/1)

