# Get Product Batch

## 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.evitalrx.in/api-for-patient-app/medicines/get-product-batch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
