---
search:
  tags:
    - Purchases
    - POST
seo:
  description: >-
    Admin or pharmacist. Receives a batch and records the IN movement in one…
    Reference for the POST /api/v1/purchases endpoint in the PharmaFlow API.
sidebar:
  label: Receive a batch
  badge: POST
title: Receive a batch
type: openapi-operation
---
Admin or pharmacist. Receives a batch and records the IN movement in one transaction. Fields must be present and the quantity positive, and the receipt bumps stock and syncs.

`POST /api/v1/purchases`

**Request body** (`application/json`, required)

- `supplier_id` (string, required)
- `medicine_id` (string, required)
- `branch_id` (string, required)
- `batch_number` (string, required)
- `expiry_date` (string, required)
- `quantity` (number | string, required)
- `unit_cost` (number | string, required)
- `manufacturing_date` (string | null)
- `notes` (string)

Request body example:

```json
{
  "supplier_id": "string",
  "medicine_id": "string",
  "branch_id": "string",
  "batch_number": "string",
  "expiry_date": "string",
  "quantity": 0,
  "unit_cost": 0,
  "manufacturing_date": "string",
  "notes": "string"
}
```

**Responses**

- `201` — Batch received
- `400` — A required field is missing, or the quantity is not a positive number
- `401` — Not authenticated
- `403` — Access forbidden for this role

Response example, 201:

```json
{
  "id": "string",
  "medicine_id": "string",
  "branch_id": "string",
  "supplier_id": "string",
  "batch_number": "string",
  "expiry_date": "string",
  "manufacturing_date": "string",
  "qty_received": -9007199254740991,
  "qty_remaining": -9007199254740991,
  "unit_cost": "string",
  "status": "string",
  "sfda_status": "string",
  "created_at": "string",
  "medicine_name": "string",
  "medicine_selling_price": 0,
  "supplier_name": "string",
  "is_deleted": true
}
```
