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

Write off a batch

Admin or pharmacist. Zeroes a batch and records a WRITE_OFF movement for the units removed. An unknown batch gets 404, and the rest leaves the medicine stock in the same transaction.

PUT/api/v1/purchases/{batchId}/write-off
Authorization
AuthorizationBearer token (JWT) · headerrequired

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

Path parameters
batchIdstringrequired

The batch being written off.

Responses
200

Batch written off

statusstringrequired
batch_idstringrequired
401

Not authenticated

detailstringrequired
403

Access forbidden for this role

detailstringrequired
404

Batch not found

detailstringrequired
Try it
Server
Authorization
Parameters
Request
curl -X PUT 'http://localhost:8000/api/v1/purchases/string/write-off' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "status": "string",
  "batch_id": "string"
}