PharmaFlow API
The PharmaFlow point of sale, inventory, and operations API. Paths are absolute: feature routes live under /api/v1, and /health stays on the root so a liveness probe never tracks the API version. The local default base URL is http://localhost:8000. Authentication is a Bearer JWT from POST /api/v1/auth/login unless an operation is marked public. Roles are admin and pharmacist in the seed data, and admin bypasses every role check.
http://localhost:8000Health
Service and database smoke checks.
Auth
Login, current user, and password change.
- POSTLog in and issue an access token
/api/v1/auth/login - GETRead the signed in user
/api/v1/auth/me - POSTChange the caller's password
/api/v1/auth/change-password
Users
User records, roles, and password resets.
- GETList users
/api/v1/users - POSTCreate a user
/api/v1/users - GETRead a user
/api/v1/users/{userId} - PUTUpdate a user
/api/v1/users/{userId} - POSTReset a user's password
/api/v1/users/{userId}/reset-password
Branches
Pharmacy branches and their lifecycle.
- GETList branches
/api/v1/branches - POSTCreate a branch
/api/v1/branches - GETRead a branch
/api/v1/branches/{branchId} - PUTUpdate a branch
/api/v1/branches/{branchId}
Currency
Currency registry, branch currency, and exchange rates.
- GETList the currency registry
/api/v1/currency - POSTCreate a currency
/api/v1/currency - PATCHUpdate a currency
/api/v1/currency/{code} - GETRead the caller's branch currency
/api/v1/currency/branch - GETRead the currency overview
/api/v1/currency/overview - GETResolve the effective rate
/api/v1/currency/effective - GETList exchange rates
/api/v1/currency/rates - POSTFile an exchange rate
/api/v1/currency/rates - POSTCheck a sale rate against tolerance
/api/v1/currency/rates/check
Categories
Medicine categories used to group the catalogue.
- GETList the category catalogue
/api/v1/categories - POSTCreate a category
/api/v1/categories - PUTUpdate a category
/api/v1/categories/{slug} - DELETEDelete a category
/api/v1/categories/{slug}
Medicines
The medicine catalogue, batch stock, and the controlled registry.
- GETList the medicine catalogue
/api/v1/medicines - POSTCreate a medicine
/api/v1/medicines - GETRead a medicine
/api/v1/medicines/{medicineId} - PUTUpdate a medicine
/api/v1/medicines/{medicineId} - DELETEDeactivate a medicine
/api/v1/medicines/{medicineId} - GETList a medicine's stock movements
/api/v1/medicines/{medicineId}/movements - GETList the controlled dispensing registry
/api/v1/medicines/controlled/registry
Suppliers
Supplier records and contact details.
- GETList suppliers
/api/v1/suppliers - POSTCreate a supplier
/api/v1/suppliers - GETRead a supplier
/api/v1/suppliers/{supplierId} - PUTUpdate a supplier
/api/v1/suppliers/{supplierId} - DELETEDeactivate a supplier
/api/v1/suppliers/{supplierId}
Sessions
Cash sessions, breaks, tender declarations, and Z-reports.
- POSTOpen a cash session
/api/v1/sessions/open - GETList closed cash sessions
/api/v1/sessions/history - GETRead the caller's open session
/api/v1/sessions/current - POSTStart a break on the open session
/api/v1/sessions/break/start - POSTEnd the caller's open break
/api/v1/sessions/break/end - POSTClose the caller's cash session
/api/v1/sessions/close - POSTDeclare the counted cash
/api/v1/sessions/tender - GETList the caller's tender declarations
/api/v1/sessions/tender/history - GETList the sales in a session
/api/v1/sessions/{sessionId}/sales - GETRead a session Z-report
/api/v1/sessions/{sessionId}/z-report
Sales
Sale creation, listing, and invoice allocation.
- GETList sales
/api/v1/sales - POSTCreate a sale
/api/v1/sales - GETRead a sale
/api/v1/sales/{saleId} - GETRead a sale invoice identity
/api/v1/sales/{saleId}/invoice
Returns
Sale returns, restocking, and credit notes.
- GETLook up a returnable invoice
/api/v1/returns/lookup/{invoiceNumber} - GETList returns
/api/v1/returns - POSTCreate a return
/api/v1/returns - GETRead a return
/api/v1/returns/{returnId}
Parked
Parked carts and their recall or void lifecycle.
- GETList parked carts
/api/v1/parked - POSTPark a cart
/api/v1/parked - POSTRecall a parked cart
/api/v1/parked/{parkedId}/recall - POSTVoid a parked cart
/api/v1/parked/{parkedId}/void
Coupons
Coupon validation and administration.
- GETValidate a coupon code
/api/v1/coupons/validate/{code} - GETList coupons
/api/v1/coupons - POSTCreate a coupon
/api/v1/coupons - PUTUpdate a coupon
/api/v1/coupons/{couponId}
Prescriptions
Prescriptions and their dispense or cancel flow.
- GETList prescriptions
/api/v1/prescriptions - POSTCreate a prescription
/api/v1/prescriptions - GETGet a prescription
/api/v1/prescriptions/{prescriptionId} - POSTDispense a prescription
/api/v1/prescriptions/{prescriptionId}/dispense - POSTCancel a prescription
/api/v1/prescriptions/{prescriptionId}/cancel
Purchases
Batch receipts, expiring stock, and the movement ledger.
- GETList received batches
/api/v1/purchases - POSTReceive a batch
/api/v1/purchases - GETList expiring batches
/api/v1/purchases/expiring - GETRead a received batch
/api/v1/purchases/{batchId} - PUTWrite off a batch
/api/v1/purchases/{batchId}/write-off - GETList stock movements
/api/v1/purchases/movements/all
Transfers
Stock transfers between branches.
- GETList stock transfers
/api/v1/transfers - POSTCreate a stock transfer
/api/v1/transfers - POSTCreate a batch stock transfer
/api/v1/transfers/batch
Stockcount
Stock count sheets and variance submission.
- GETRead the branch stock count sheet
/api/v1/stockcount - POSTSubmit a stock count
/api/v1/stockcount/submit
Customers
Customer records, credit limits, and the ledger.
- GETList customers
/api/v1/customers - POSTCreate a customer
/api/v1/customers - GETGet a customer ledger
/api/v1/customers/{customerId}/ledger - GETGet a customer
/api/v1/customers/{customerId} - PUTUpdate a customer
/api/v1/customers/{customerId} - POSTRecord a customer payment
/api/v1/customers/{customerId}/payments
Dashboard
Summary metrics and branch comparison.
- GETRead the dashboard summary
/api/v1/dashboard/summary - GETCompare branch revenue
/api/v1/dashboard/branch-comparison
Alerts
Low stock, expiring, and expired alerts.
- GETList low stock alerts
/api/v1/alerts/low-stock - GETList expiring batches
/api/v1/alerts/expiry - GETList expired batches
/api/v1/alerts/expired
Audit
The append-only audit trail.
PurchaseOrders
Purchase orders from draft through received.
- GETList purchase orders
/api/v1/purchase-orders - POSTCreate a purchase order
/api/v1/purchase-orders - GETList suggested reorders
/api/v1/purchase-orders/suggested - GETRead a purchase order
/api/v1/purchase-orders/{purchaseOrderId} - PUTSend or cancel a purchase order
/api/v1/purchase-orders/{purchaseOrderId}/status - POSTReceive a purchase order
/api/v1/purchase-orders/{purchaseOrderId}/receive
Reports
Inventory, purchase, sales, pharmacist, and VAT reports.
- GETReport on the medicine inventory
/api/v1/reports/inventory - GETReport on purchase spend
/api/v1/reports/purchases - GETReport sales by pharmacist
/api/v1/reports/sales/by-pharmacist - GETReport on sales
/api/v1/reports/sales - GETReport on VAT by month
/api/v1/reports/vat
Sync
Device registration, push, pull, and snapshots.
- POSTRegister a till
/api/v1/sync/devices/register - POSTPush queued changes
/api/v1/sync/push - GETPull changes since a revision
/api/v1/sync/pull - GETSnapshot the catalogue
/api/v1/sync/snapshot - GETList pending sync conflicts
/api/v1/sync/conflicts - POSTResolve a sync conflict
/api/v1/sync/conflicts/{id}/resolve
Settings
Organisation settings, including the tax policy.
- GETRead the organisation settings
/api/v1/settings - PUTUpdate the organisation settings
/api/v1/settings
Printing
Printers, receipt templates, and print jobs.
- GETList printers
/api/v1/printing/printers - POSTRegister a printer
/api/v1/printing/printers - PUTUpdate a printer
/api/v1/printing/printers/{printerId} - DELETERemove a printer
/api/v1/printing/printers/{printerId} - GETList receipt templates
/api/v1/printing/receipt-templates - POSTCreate a receipt template
/api/v1/printing/receipt-templates - GETList print jobs
/api/v1/printing/print-jobs - POSTRecord a print job
/api/v1/printing/print-jobs
Ops
Changelog entries and manager approvals.
- GETList the published changelog
/api/v1/changelog - POSTPublish a changelog entry
/api/v1/changelog - GETList manager approvals
/api/v1/approvals - POSTRequest a manager approval
/api/v1/approvals - PUTApprove or reject an approval
/api/v1/approvals/{approvalId}
Dispensing
Will-call pickup, generic search, and refill reminders.
- GETList the will-call queue
/api/v1/dispensing/will-call - POSTAdd a will-call pickup
/api/v1/dispensing/will-call - PUTCollect a will-call pickup
/api/v1/dispensing/will-call/{willCallId}/pickup - GETSearch medicines by generic name
/api/v1/dispensing/generic-search - GETList pending refill reminders
/api/v1/dispensing/refills - POSTCreate a refill reminder
/api/v1/dispensing/refills
SupplierFinance
Supplier invoices, payments, reorder suggestions, and quarantine.
- GETList supplier invoices
/api/v1/supplier-finance/invoices - POSTRecord a supplier invoice
/api/v1/supplier-finance/invoices - POSTRecord a payment on an invoice
/api/v1/supplier-finance/invoices/{invoiceId}/payments - GETList reorder suggestions
/api/v1/supplier-finance/reorder-suggestions - POSTQuarantine or release a batch
/api/v1/supplier-finance/batches/{batchId}/quarantine
Compliance
Statutory books, the EFRIS preview, and devices.
- GETList the prescription book
/api/v1/compliance/prescription-book - GETList the classified drugs book
/api/v1/compliance/classified-drugs-book - GETPreview the EFRIS payload for a sale
/api/v1/compliance/efris-preview/{saleId} - GETList registered devices
/api/v1/compliance/devices - POSTRevoke a device
/api/v1/compliance/devices/{deviceId}/revoke - POSTRestore a revoked device
/api/v1/compliance/devices/{deviceId}/restore
Marketing
Public marketing contact and enquiry endpoints.
Images
Presigned uploads for medicine photos and branding.