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

Submit a stock count

Admin or branch manager. Applies the counts as stock adjustments on the caller’s branch. Empty items get 400, a surplus lands on the newest batch, and a shortfall drains the oldest.

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

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

Request body
requiredapplication/json
itemsobject[]required
Show properties
Array of object
medicine_idstringrequired
counted_quantitynumber | stringrequired
notesstring
Responses
200

The adjustments that were applied

statusstringrequired
adjustments_madeintegerrequired
min -9007199254740991 · max 9007199254740991
itemsobject[]required
Show properties
Array of object
medicine_idstringrequired
db_quantitynumberrequired
counted_quantityintegerrequired
min -9007199254740991 · max 9007199254740991
deltaintegerrequired
min -9007199254740991 · max 9007199254740991
400

No items submitted

detailstringrequired
401

Not authenticated

detailstringrequired
403

Access forbidden for the caller's role

detailstringrequired
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST 'http://localhost:8000/api/v1/stockcount/submit' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "items": [
    {
      "medicine_id": "string",
      "counted_quantity": 0,
      "notes": "string"
    }
  ]
}'
Response
{
  "status": "string",
  "adjustments_made": -9007199254740991,
  "items": [
    {
      "medicine_id": "string",
      "db_quantity": 0,
      "counted_quantity": -9007199254740991,
      "delta": -9007199254740991
    }
  ]
}