Import medicines from a CSV or Excel file
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/importAuthorization
AuthorizationBearer token (JWT) · headerrequiredJWT from POST /api/v1/auth/login sent as Authorization Bearer.
Request body
requiredtext/csvnamestringrequiredmin length 1
generic_namestringdefault: ""
barcodestringdefault: ""
categorystringdefault: ""
formstringdefault: ""
strengthstringdefault: ""
unitstringdefault: ""
selling_pricestringdefault: "0.000"
low_stock_thresholdintegermin -9007199254740991 · max 9007199254740991 · default: 10
requires_prescriptionbooleandefault: false
is_controlledbooleandefault: false
vat_categorystringdefault: "zero_rated"
requires_cold_chainbooleandefault: false
sfda_registration_nostringdefault: ""
max_public_pricestringdefault: "0.000"
Responses
200
Import summary
namestringrequiredmin length 1
generic_namestringrequireddefault: ""
barcodestringrequireddefault: ""
categorystringrequireddefault: ""
formstringrequireddefault: ""
strengthstringrequireddefault: ""
unitstringrequireddefault: ""
selling_pricestringrequireddefault: "0.000"
low_stock_thresholdintegerrequiredmin -9007199254740991 · max 9007199254740991 · default: 10
requires_prescriptionbooleanrequireddefault: false
is_controlledbooleanrequireddefault: false
vat_categorystringrequireddefault: "zero_rated"
requires_cold_chainbooleanrequireddefault: false
sfda_registration_nostringrequireddefault: ""
max_public_pricestringrequireddefault: "0.000"
400
The file body is empty, has no header row, or has no data rows
detailstringrequired401
Not authenticated
detailstringrequired403
Caller is not an admin, inventory manager, or branch manager
detailstringrequired413
The file exceeds the 10 MB import limit
detailstringrequired415
The content type is neither CSV nor Excel
detailstringrequired
