Skip to content
PharmaFlow Knowledgebase
Esc
↑↓navigate↵open⌘Jpreview

Create a stock transfer

Admin or branch manager. Moves one medicine between two branches and completes it. FEFO from active batches, the branches must differ, and short stock is refused with 400.

POST/api/v1/transfers
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT from POST /api/v1/auth/login sent as Authorization Bearer.

Request body
requiredapplication/json
from_branch_idstringrequired
min length 1
to_branch_idstringrequired
min length 1
medicine_idstringrequired
min length 1
qtyintegerrequired
min -9007199254740991 · max 9007199254740991
notesstring
default: ""
Responses
201

Transfer completed

idstringrequired
from_branch_idstringrequired
to_branch_idstringrequired
medicine_idstringrequired
medicine_namestringrequired
qtyintegerrequired
min -9007199254740991 · max 9007199254740991
statusstringrequired
created_atstringrequired
400

The quantity is not positive, both branches are the same, or the source branch has insufficient stock

detailstringrequired
401

Not authenticated

detailstringrequired
403

Caller is not an admin, branch manager, or inventory manager

detailstringrequired
404

The medicine, source branch, or destination branch was not found

detailstringrequired
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST 'http://localhost:8000/api/v1/transfers' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "from_branch_id": "string",
  "to_branch_id": "string",
  "medicine_id": "string",
  "qty": -9007199254740991,
  "notes": ""
}'
Response
{
  "id": "string",
  "from_branch_id": "string",
  "to_branch_id": "string",
  "medicine_id": "string",
  "medicine_name": "string",
  "qty": -9007199254740991,
  "status": "string",
  "created_at": "string"
}