Skip to content

User Manual (API Integration)

User Manual (API Integration) for APSX Platform Clinic Software supporting businesses in Clinic, Spa, Wellness, Hospital, Beauty, Elderly Care Centers, Mental Health Clinics, Eye Clinics, and all types of medical facilities.

Connect your clinic data to any system through a REST API built on OpenAPI 3.1 — read and write everything the APSX app does, from customers, appointments, queues and medical records to receipts, stock, doctor fees and reports.

endpoints
950+endpoints
business domains
11business domains
standard spec, try calls in the docs
OpenAPI 3.1standard spec, try calls in the docs
outbound events when data changes
Webhookoutbound events when data changes
Up and running in 2 callsREST · JSON
# 1) Get an access token
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>" }'

# 2) Call the API with that token
curl https://shopv2.api-apsx.com/floor/live \
  -H "Authorization: Bearer <ACCESS_TOKEN>"

Every response has status · message · data — always check status before using data

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 endpoints
  • Appointments & 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
    POST/appointment/addPOST/queueGET/floor/live
    View in docs125 endpoints
  • 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/consultations
    View in docs192 endpoints
  • Lab & 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
    PUT/lab/check/valuePOST/healthreportPOST/healthreport/batch
    View in docs66 endpoints
  • 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
    POST/order/express/orderandinvoicePOST/receipt/searchGET/taxinvoice/{id}
    View in docs89 endpoints
  • 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
    POST/service/processPOST/service/tranferGET/service/item/{serviceId}
    View in docs43 endpoints
  • 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
    POST/productstore/summaryPOST/productstore/stock-cardPOST/purchessorder
    View in docs118 endpoints
  • 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 endpoints
  • Promotions, 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-preview
    View in docs44 endpoints
  • Reports & 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
    POST/report/salessummaryPOST/report/profitPOST/report/rfmanalysis
    View in docs87 endpoints
  • 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/list
    View in docs55 endpoints
  • All 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/search
  • Your 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/add
  • Data warehouse / BI

    Load sales, profit and RFM reports from every branch into Power BI, Looker Studio or your warehouse

    POST/report/salessummaryPOST/report/rfmanalysis
  • Lab 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/search
  • Corporate health checkups

    Import an employer's staff roster, then batch-create health-check reports by date range

    POST/healthreport/company/{id}/employees/importPOST/healthreport/batch
  • Keep 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

  1. 1Enable the API add-onContact the APSX team to enable the API add-on for your shop or chain
  2. 2Copy your keysThe shop owner opens APSX › Shop settings › Integrations (API) › APSTH Shop API to see the Public key and Private key
  3. 3Get an access tokenPOST /auth/oauth with both keys to receive an access_token bound to your shop
  4. 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

Standard response envelope
// ✓ 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)

Events available today
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
Sample payload
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

New · Claude × APSX

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

See how to connect Claude

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.

Who can use the API?
Any shop or chain with the APSX API add-on. The owner finds the keys in shop settings and can hand them to their developers or integration partner.
How much does it cost?
The API is an add-on on top of your main package. Contact our team for pricing and terms for your shop.
Can I keep using my keys from the original Shop API?
Yes — Shop API v2 uses the same keys and token flow. Just switch the base URL to https://shopv2.api-apsx.com.
Where can I try calls?
In the docs, press Test Request on any endpoint and paste your access token. Calls run against your shop's real data, so be careful with write operations.
Can I pull data across branches?
Keys are issued per shop/branch and a token only sees its own shop. Some endpoints (such as customer search) cover the whole chain — this is noted on each endpoint.
What should I do with status: false?
Read the reason in message — every endpoint in the docs lists its possible messages. If it's still unclear, send us the endpoint, body and message.