---
search:
  tags:
    - Transfers
    - POST
seo:
  description: >-
    Admin or branch manager. Moves several medicines between two branches in
    one… Reference for the POST /api/v1/transfers/batch endpoint in the
    PharmaFlow API.
sidebar:
  label: Create a batch stock transfer
  badge: POST
title: Create a batch stock transfer
type: openapi-operation
---
Admin or branch manager. Moves several medicines between two branches in one atomic request. Every line is in one transaction, so one failure rolls it back, and branches must differ.

`POST /api/v1/transfers/batch`

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

- `from_branch_id` (string, required)
- `to_branch_id` (string, required)
- `notes` (string)
- `items` (object[], required)

Request body example:

```json
{
  "from_branch_id": "string",
  "to_branch_id": "string",
  "notes": "",
  "items": [
    {
      "medicine_id": "string",
      "qty": -9007199254740991
    }
  ]
}
```

**Responses**

- `201` — Every line moved
- `400` — A line quantity is not positive, both branches are the same, the source has insufficient stock, or no source batch is available
- `401` — Not authenticated
- `403` — Caller is not an admin, branch manager, or inventory manager
- `404` — A medicine, the source branch, or the destination branch was not found

Response example, 201:

```json
{
  "items": [
    {
      "id": "string",
      "medicine_id": "string",
      "medicine_name": "string",
      "qty": -9007199254740991,
      "created_at": "string"
    }
  ],
  "total": -9007199254740991
}
```
