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

  1. Get accessTalk to us and we enable the API for your Cloud Pro account.
  2. Log inSend your login and password to /api/login and get a token valid for one hour.
  3. 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

RequestReturns
POST /api/loginA bearer token valid for one hour
POST /api/changePasswordChanges your own password
POST /v1/reports/productsProduct catalogue with pricing and stock
POST /v1/reports/stockcurrentCurrent stock for an item across branches
POST /v1/reports/salesSales: by ticket, item or category
POST /v1/reports/salesprofitSales profit per ticket or per item
POST /v1/reports/purchasesPurchases: by invoice, supplier or item
POST /v1/reports/productsoperationsItem movement log of stock-affecting events
POST /v1/reports/customersCustomers: all, by ID or by telephone
POST /v1/reports/spendingsExpenses paid from the cash accounts
POST /v1/reports/branchesYour 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

Setup steps for Claude, ChatGPT and Gemini

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_report stock_current_report sales_report sales_profit_report purchases_report products_operations_report customers_report spendings_report branches_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.