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

Close the caller's cash session

Any signed in user. Closes the caller’s open session and freezes totals and payment split. An open break is closed first and counted, and a caller with no session is refused.

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

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

Responses
200

The closed session

idstringrequired
user_idstringrequired
branch_idstringrequired
opening_floatstringrequired
statusstringrequired
opened_atstringrequired
closed_atstring | nullrequired
total_salesintegerrequired
min -9007199254740991 · max 9007199254740991
total_revenuestringrequired
total_vatstringrequired
payment_breakdownstring | nullrequired
401

Not authenticated

detailstringrequired
404

No active session to close

detailstringrequired
Try it
Server
Authorization
Request
curl -X POST 'http://localhost:8000/api/v1/sessions/close' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "id": "string",
  "user_id": "string",
  "branch_id": "string",
  "opening_float": "string",
  "status": "string",
  "opened_at": "string",
  "closed_at": "string",
  "total_sales": -9007199254740991,
  "total_revenue": "string",
  "total_vat": "string",
  "payment_breakdown": "string"
}