> For the complete documentation index, see [llms.txt](https://docs.evitalrx.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.evitalrx.in/api-for-doctor-portal/medicines/get-expired-batches.md).

# Get Expired Batches

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.evitalrx.in/api-for-doctor-portal/medicines/get-expired-batches.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
