---
search:
  tags:
    - PurchaseOrders
    - POST
seo:
  description: >-
    Admin and branch manager. Books received lines into… Reference for the POST
    /api/v1/purchase-orders/{purchaseOrderId}/receive endpoint in the PharmaFlow
    API.
sidebar:
  label: Receive a purchase order
  badge: POST
title: Receive a purchase order
type: openapi-operation
---
Admin and branch manager. Books received lines into batches, closing the order as RECEIVED. An already received or cancelled order is refused with 400, so nothing is booked twice.

`POST /api/v1/purchase-orders/{purchaseOrderId}/receive`

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

- `items` (object[], required)

Request body example:

```json
{
  "items": [
    {
      "medicine_id": "string",
      "batch_number": "string",
      "qty_received": -9007199254740991,
      "unit_cost": 0,
      "expiry_date": "string",
      "manufacturing_date": "string"
    }
  ]
}
```

**Responses**

- `200` — The purchase order is received
- `400` — The request body fails validation, the PO is already received, or it is cancelled
- `401` — Not authenticated
- `403` — Access forbidden for this role
- `404` — PO not found

Response example, 200:

```json
{
  "id": "string",
  "status": "string",
  "batches_created": -9007199254740991
}
```
