Pharmafly Cloud Pro · Developers
Your pharmacy data, in your own systems
A JSON REST API for Cloud Pro reports, and an MCP server for AI assistants. Feed your dashboards, accounting software and company systems with sales, profit, purchases, stock, customer and expense data for every branch in the chain.
Getting started
- Get accessTalk to us and we enable the API for your Cloud Pro account.
- Log inSend your login and password to /api/login and get a token valid for one hour.
- Call the reportsSend the token as Authorization: Bearer on every request.
Log in
curl -X POST https://api.pharmafly.com/api/login \
-H "Content-Type: application/json" \
-d '{"Login":"mybranch","Password":"secret"}'
The response body is the token as plain text. An expired subscription returns 401 with SubscriptionExpired.
Example: a month of sales by category, all branches
curl -X POST https://api.pharmafly.com/v1/reports/sales \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"BranchLogins": [],
"DateFrom": "2026-10-01T00:00:00Z",
"DateTo": "2026-10-31T23:59:59Z",
"ReportMode": "by_categories",
"IncludeSales": true, "IncludeReturns": true,
"IncludeCash": true, "IncludeCredit": true, "IncludeInsurance": true,
"IncludeHomeDelivery": true, "IncludeCallcenter": true, "IncludeWholeSales": true,
"IncludePaid": true, "IncludeUnpaid": true
}'
An empty BranchLogins means all your branches, and rows from every branch come back in one JSON array. A report only ever reads branches in your own chain, whatever the request says.
Endpoints
Base URL: https://api.pharmafly.com
| Request | Returns |
|---|---|
POST /api/login | A bearer token valid for one hour |
POST /api/changePassword | Changes your own password |
POST /v1/reports/products | Product catalogue with pricing and stock |
POST /v1/reports/stockcurrent | Current stock for an item across branches |
POST /v1/reports/sales | Sales: by ticket, item or category |
POST /v1/reports/salesprofit | Sales profit per ticket or per item |
POST /v1/reports/purchases | Purchases: by invoice, supplier or item |
POST /v1/reports/productsoperations | Item movement log of stock-affecting events |
POST /v1/reports/customers | Customers: all, by ID or by telephone |
POST /v1/reports/spendings | Expenses paid from the cash accounts |
POST /v1/reports/branches | Your branches with their name and sales forecast |
Errors come back as JSON {"ErrorMessage":"..."} with the matching HTTP status (400, 401, 404, 409, 500). Dates are RFC3339. Ask us for the full per-endpoint reference and a Postman collection.
MCP server for AI assistants
The same reports are available as read-only MCP (Model Context Protocol) tools, so any AI assistant or MCP-capable app can query the chain's data directly. Each tool runs the matching endpoint with the same rules and results.
- URL
https://api.pharmafly.com/mcp- Transport
- Streamable HTTP, stateless, JSON responses
- Auth
- OAuth 2.1 with PKCE and dynamic client registration, using a Pharmafly login. Scope: reports:read only.
- Tokens
- One-hour access tokens; refresh tokens rotate on every use, up to 90 days.
- Tools
products_reportstock_current_reportsales_reportsales_profit_reportpurchases_reportproducts_operations_reportcustomers_reportspendings_reportbranches_report
Claude Code
claude mcp add --transport http pharmafly https://api.pharmafly.com/mcp
Gemini CLI
Add the server to settings.json, then run /mcp auth pharmafly to sign in.
{
"mcpServers": {
"pharmafly": { "httpUrl": "https://api.pharmafly.com/mcp" }
}
}
Apps that only take a fixed URL (Ollama, LM Studio…)
{
"mcpServers": {
"pharmafly": { "command": "npx", "args": ["-y", "mcp-remote", "https://api.pharmafly.com/mcp"] }
}
}
Tools return up to 200 rows by default (maxRows up to 2000), with totalRows and truncated so the assistant knows when a result was cut.
Ready to run your pharmacy smarter?
Talk to us: we help you pick the right edition for your pharmacy.