Covers every part of the clinic
What you can do with the API
Anything you do in the app can be done through the API, read and write — grouped into 11 business domains. Each card shows sample endpoints and links to the reference with full parameters and request/response examples.
Customers & CRM
Complete customer records, shared across every branch
- Create and update customers with auto HN and duplicate ID-card checks across branches
- Treatment, appointment and lab history, drug allergies, coverage rights and attachments
- Customer groups, tags, prepaid credit (coin) and sales pipeline
- Per-customer analytics — visit frequency, spending trend, churn risk
POST/customerGET/customer/citizen/{citizenId}GET/customer/analytics/{customerId}View in docs93 endpointsAppointments & queue
From booking to the moment the patient leaves
- Create, search, confirm and cancel appointments; doctor schedules and free slots
- Open queues (check-in), change status, cancel and add queue notes
- Order drugs, Lab/X-Ray and course usage into a queue
- Live clinic floor — rooms, beds, today's queue, doctors on duty
Medical records & care
OPD · IPD · ER · surgery · Thai medicine · telemedicine
- General, dental, eye and orthopedic OPD plus clinic-designed OPD forms
- Inpatients: admit · vital signs · nursing notes · MAR · bed transfer · discharge
- Emergency room, surgery/anesthesia records, Thai traditional medicine, telemedicine
- ICD diagnosis codes and medical certificates
POST/ipd/admitGET/opdDental/customer/{customerId}POST/{shopId}/thai-med/consultationsView in docs192 endpointsLab & health checkups
Connect lab analysers/LIS and corporate checkups
- Lab items, panels and coverage-based pricing
- Write Lab/X-Ray results back to the queue with reference ranges and images
- Health-check reports — compile a visit into a numbered report, or batch-create by date range
- Employers and employee roster import
Sales, invoices & receipts
The full set of financial documents, ready for your accounting system
- Sales orders with drugs, courses, lab items, credit and discounts
- Invoices, receipts, tax invoices and credit notes — search, print, void
- Express sale: order + invoice in one call
- Shop expenses and sync to PEAK accounting
Courses & service usage
Sell multi-session courses, redeem them and track balances
- Courses and bundles, Excel import, sync from head office to branches
- Redeem sessions, check remaining balance, transfer courses between customers
- Service history and the drugs/supplies used per session
Products, drugs & inventory
Multi-warehouse stock, lots, expiry and purchasing
- Drugs and products, units, prices, bundles, directions, drug labels
- Per-warehouse stock, lots, expiry, stock card, low-stock and expiry summary
- Purchase orders, goods receipt, issue, inter-branch transfer, adjustments
- Vendors/suppliers and sync to PEAK
Doctor fees, commission & staff
Feed compensation straight into payroll
- Calculate doctor fees and commission per invoice; totals per staff member
- Doctors and staff, roles and licence numbers
- Doctor schedules and available time slots
POST/handling/calculateGET/handling/gethandlingusersGET/user/calendar/user/{userId}View in docs29 endpointsPromotions, coupons & gift vouchers
Marketing campaigns tied to real sales
- Send SMS promotions, preview recipient counts, review results
- Discount coupons, redemption and history
- Gift vouchers — issue in batches, validate codes, compute discounts, redeem across branches
- Articles and reviews for your storefront
POST/giftvoucher/validatePOST/coupon/useprocessPOST/promotion/recipient-previewView in docs44 endpointsReports & dashboard
The same numbers as the in-app reports, ready for your BI
- Sales, profit, income, receivables, expenses, tax
- Stock, movements and controlled-drug registers (psychotropics 2–5 · narcotics 3)
- Courses and services, appointments, queues, customers and RFM
- Dashboard figures: sales, payments, profit, new customers
Shop & reference data
Lookup data every other domain needs
- Shop and branch details, payment accounts
- Dropdown data: rooms, beds, departments, roles, doctors, coverage rights
- Attachments and uploads, notifications, packages and add-ons
GET/reference/doctoruserGET/reference/righttreatmentPOST/notification/inbox/listView in docs55 endpointsAll 950+ endpoints in one place
Parameters, request/response examples, error messages and a Test Request button on every endpoint
What teams build with it
Common integration patterns — combine endpoints from the domains above to fit your workflow
Sync finance documents to ERP/accounting
Pull daily receipts, tax invoices, credit notes and expenses into your accounting system — no re-keying
POST/receipt/searchPOST/invoice/searchYour own booking app or website
Let patients see doctor availability, book and view past appointments in your clinic's app
GET/user/calendar/user/{userId}POST/appointment/addData warehouse / BI
Load sales, profit and RFM reports from every branch into Power BI, Looker Studio or your warehouse
POST/report/salessummaryPOST/report/rfmanalysisLab analysers / LIS
Write results from analysers or your LIS straight into the patient's queue so doctors see them instantly
PUT/lab/check/valuePOST/lab/searchCorporate health checkups
Import an employer's staff roster, then batch-create health-check reports by date range
POST/healthreport/company/{id}/employees/importPOST/healthreport/batchKeep your CRM in sync
Receive a webhook whenever a customer is created or updated and update your CRM or marketing tools automatically
POST/customer/paginationPOST/promotion/recipient-preview
For developers
Get started in 4 steps
- 1Enable the API add-onContact the APSX team to enable the API add-on for your shop or chain
- 2Copy your keysThe shop owner opens APSX › Shop settings › Integrations (API) › APSTH Shop API to see the Public key and Private key
- 3Get an access tokenPOST /auth/oauth with both keys to receive an access_token bound to your shop
- 4Call any endpointSend Authorization: Bearer <access_token> with every call and check status in the result
Keep the Private key on your server only — never ship it in a mobile app or browser code
# 1) Get an access token (reuse it until it expires)
curl -X POST https://shopv2.api-apsx.com/auth/oauth \
-H "Authorization: Bearer <PUBLIC_KEY>" \
-H "Content-Type: application/json" \
-d '{
"public_key": "<PUBLIC_KEY>",
"private_key": "<PRIVATE_KEY>"
}'
# → { "status": true, "message": "",
# "data": { "access_token": "eyJhbGciOi…" } }
# 2) Live clinic floor — rooms, beds, queue, doctors on duty
curl https://shopv2.api-apsx.com/floor/live \
-H "Authorization: Bearer <ACCESS_TOKEN>"
Conventions to know before you code
Every endpoint follows the same shape — write one client wrapper and reuse it everywhere
// ✓ OK
{
"status": true,
"message": "",
"data": { … }
}
// ✗ business error — HTTP 200
{
"status": false,
"message": "Invalid or expire token.",
"data": ""
}
Business errors (insufficient balance, duplicates…) return HTTP 200 with status: false and the reason in message — always check status, not just the HTTP code
- Shop / branch
- Locked by the access token — you can only reach the shop your key belongs to
- Dates & times
- YYYY-MM-DD and YYYY-MM-DD HH:MM:SS in Thai time (UTC+7)
- Amounts
- Decimal numbers with 2 places, in Thai baht
- Paginated lists
- …/search and …/pagination endpoints take a page number and per_page in the body
- Expired token
- You get status: false + "Invalid or expire token." → request a new one from /auth/oauth
- Rate limits
- /auth/oauth 20 req/min per IP · /report/* 30 req/min per token — over the limit returns HTTP 429
Webhooks
Get notified instantly — no polling
Set up endpoints yourself in APSX › Shop settings › Integrations (API) › Webhook (up to 10 per shop · https only)
customer.createdcustomer.updatedcourse.createdcourse.updatedcourse.deleted- Delivered as POST JSON with X-Apsx-Event · X-Apsx-Delivery · X-Apsx-Shop headers
- Set a secret to receive an X-Apsx-Signature (HMAC-SHA256) so you can verify it came from APSX
- Endpoint down? Automatic retries at 1 min → 5 min → 30 min → 2 h → 6 h
- Review delivery history and send test events from the settings page
POST https://your-app.example.com/apsx-webhook
X-Apsx-Event: customer.updated
X-Apsx-Delivery: 98231
X-Apsx-Shop: 123
X-Apsx-Signature: sha256=5f1c…
{
"id": 98231,
"event": "customer.updated",
"shop_id": 123,
"ref_type": "customer",
"ref_id": 45678,
"occurred_at": "2026-11-08T10:15:00+07:00",
"attempt": 1,
"data": {
"id": 45678,
"ctm_id": "HN000123",
"first_name": "…",
"phone": "…"
}
}Secure by design
Health data is sensitive, so the API enforces the same controls as the app
Public / Private key pair
Issued per shop and only valid while the API add-on is active
Shop-scoped tokens
The shop comes from the access token, not from the request — a key only reaches the shop it belongs to
Instant revocation
When the shop owner changes their password, all existing tokens stop working
Rate limiting
Protects against key guessing and runaway report queries
HTTPS everywhere
Encrypted connections only, for both the API and webhooks
Audit trail
Token requests are logged with the caller's IP for later review
Not writing code? Just ask Claude
APSX is an MCP server, so Claude can answer questions with your sales, fees, appointments and outstanding balances. Sign in with your APSX account via OAuth — read-only, no API keys needed
Frequently asked questions
Ready to connect your systems to APSX?
Browse every endpoint in the docs, or talk to our team about enabling the API add-on for your shop.