---
search:
  tags:
    - Medicines
    - POST
seo:
  description: >-
    Admin, inventory manager, or branch manager. Reads a CSV or an Excel file
    and… Reference for the POST /api/v1/medicines/import endpoint in the
    PharmaFlow API.
sidebar:
  label: Import medicines from a CSV or Excel file
  badge: POST
title: Import medicines from a CSV or Excel file
type: openapi-operation
---
Admin, inventory manager, or branch manager. Reads a CSV or an Excel file and upserts the medicines in one transaction. Barcodes already in the catalogue can be skipped, and every row is judged on its own: the valid rows are imported while each row without a name is reported back with its row number so it can be corrected and resent. Images are not imported from the file.

`POST /api/v1/medicines/import`

**Request body** (`text/csv`, required)

- `name` (string, required)
- `generic_name` (string)
- `barcode` (string)
- `category` (string)
- `form` (string)
- `strength` (string)
- `unit` (string)
- `selling_price` (string)
- `low_stock_threshold` (integer)
- `requires_prescription` (boolean)
- `is_controlled` (boolean)
- `vat_category` (string)
- `requires_cold_chain` (boolean)
- `sfda_registration_no` (string)
- `max_public_price` (string)

Request body example:

```json
{
  "name": "string",
  "generic_name": "",
  "barcode": "",
  "category": "",
  "form": "",
  "strength": "",
  "unit": "",
  "selling_price": "0.000",
  "low_stock_threshold": 10,
  "requires_prescription": false,
  "is_controlled": false,
  "vat_category": "zero_rated",
  "requires_cold_chain": false,
  "sfda_registration_no": "",
  "max_public_price": "0.000"
}
```

**Responses**

- `200` — Import summary
- `400` — The file body is empty, has no header row, or has no data rows
- `401` — Not authenticated
- `403` — Caller is not an admin, inventory manager, or branch manager
- `413` — The file exceeds the 10 MB import limit
- `415` — The content type is neither CSV nor Excel

Response example, 200:

```json
{
  "name": "string",
  "generic_name": "",
  "barcode": "",
  "category": "",
  "form": "",
  "strength": "",
  "unit": "",
  "selling_price": "0.000",
  "low_stock_threshold": 10,
  "requires_prescription": false,
  "is_controlled": false,
  "vat_category": "zero_rated",
  "requires_cold_chain": false,
  "sfda_registration_no": "",
  "max_public_price": "0.000"
}
```
