Every endpoint in this group additionally requires the acting user to be a system manager, accountant, or project admin. Covers the company fund ledger, expenses, capital transactions, and payroll (including each doctor's revenue-share commission).
GET
/fund/summary
Bearer token · accounting access
Range summary of the fund ledger, broken down by source.
Request
| Field |
Type |
Notes |
| from, to |
date (query) |
optional
|
Response data
-
balance, period_total_in, period_total_out, period_net
number
-
by_source
object — {payment, expense, capital, salary_advance, salary_payment}
GET
/fund/transactions
Bearer token · accounting access
Raw ledger of every fund-affecting event.
Request
| Field |
Type |
Notes |
| source_type |
string (query) |
optional
— payment|expense|capital|salary_advance|salary_payment
|
| from, to, per_page |
(query) |
optional
|
Response data
-
id, uuid, source_type, source_id, amount (signed), description, occurred_on, created_by
GET
/expenses
Bearer token · accounting access
Lists company expenses.
Request
| Field |
Type |
Notes |
| category, from, to, per_page |
(query) |
optional
|
POST
/expenses
Bearer token · accounting access
201 Created
Records a company expense (posts a negative fund transaction).
Request
| Field |
Type |
Notes |
| category |
enum |
required
— dental_supplies, lab_fees, rent, utilities, equipment, marketing, insurance, maintenance, taxes, other
|
| vendor_name, invoice_number |
string |
optional
|
| amount |
number |
required
— min 0.01
|
| expense_date |
date |
required
|
| description |
string |
optional
|
| attachment |
file |
optional
— multipart, jpg/jpeg/png/pdf, max 10MB
|
POST
/expenses/{id}
Bearer token · accounting access
Updates an expense (note: POST, not PUT — supports re-uploading the attachment).
Request
| Field |
Type |
Notes |
| (same fields as create, all optional) |
|
|
DELETE
/expenses/{id}
Bearer token · accounting access
Deletes an expense and its fund transaction.
GET
/capital-transactions
Bearer token · accounting access
Lists owner capital injections/withdrawals.
Request
| Field |
Type |
Notes |
| type, per_page |
(query) |
optional
|
Response data
-
[CapitalTransaction object]
array
POST
/capital-transactions
Bearer token · accounting access
201 Created
Records a capital injection or withdrawal (posts a signed fund transaction).
Request
| Field |
Type |
Notes |
| type |
enum |
required
— injection, withdrawal
|
| amount |
number |
required
— min 0.01
|
| party_name |
string |
optional
|
| transaction_date |
date |
required
|
| description |
string |
optional
|
Response data
-
(CapitalTransaction object)
PUT
/capital-transactions/{id}
Bearer token · accounting access
Edits a capital transaction.
Request
| Field |
Type |
Notes |
| (same fields as create, all optional) |
|
|
Response data
-
(CapitalTransaction object)
DELETE
/capital-transactions/{id}
Bearer token · accounting access
Deletes a capital transaction and its fund transaction. (No GET /capital-transactions/{id} — show is not exposed.)
GET
/payroll/employees
Bearer token · accounting access
Lists employees with their current salary/commission configuration.
Response data
-
id, uuid, name, role_name
-
is_doctor
boolean
-
monthly_salary, commission_percentage
number | null
PUT
/payroll/employees/{userId}/salary
Bearer token · accounting access
Sets an employee's base salary and (for doctors) commission rate.
Request
| Field |
Type |
Notes |
| monthly_salary |
number |
required
— min 0
|
| commission_percentage |
number |
optional
— 0–100, doctors only
|
GET
/payroll/salary-advances
Bearer token · accounting access
Lists salary advances given to employees.
Request
| Field |
Type |
Notes |
| user_id, unsettled_only, per_page |
(query) |
optional
|
Response data
-
[SalaryAdvance object]
array
POST
/payroll/salary-advances
Bearer token · accounting access
201 Created
Records an advance against future salary (posts a negative fund transaction).
Request
| Field |
Type |
Notes |
| user_id |
integer |
required
|
| amount |
number |
required
— min 0.01
|
| advance_date |
date |
required
|
| note |
string |
optional
|
PUT
/payroll/salary-advances/{id}
Bearer token · accounting access
Edits an outstanding advance (blocked once settled by a salary payment).
Request
| Field |
Type |
Notes |
| amount, advance_date, note |
|
optional
|
DELETE
/payroll/salary-advances/{id}
Bearer token · accounting access
Removes an outstanding advance (blocked once settled).
GET
/payroll/salary-payments
Bearer token · accounting access
Lists processed salary payments.
Request
| Field |
Type |
Notes |
| user_id, period_year, period_month, per_page |
(query) |
optional
|
Response data
-
[SalaryPayment object]
array
POST
/payroll/salary-payments
Bearer token · accounting access
201 Created
Processes a month's salary payment: nets base salary + doctor commission against unsettled advances, then posts the remainder to the fund.
Request
| Field |
Type |
Notes |
| user_id |
integer |
required
|
| period_year |
integer |
required
— 2000–2100
|
| period_month |
integer |
required
— 1–12
|
| paid_at |
date |
required
|
Response data
-
(SalaryPayment object)
— employee must have monthly_salary set; the same employee/period cannot be paid twice
GET
/payroll/salary-payments/{id}
Bearer token · accounting access
Fetches a single payment's breakdown.
PUT
/payroll/salary-payments/{id}
Bearer token · accounting access
Corrects the paid date — amounts are immutable (delete + recreate to correct those).
Request
| Field |
Type |
Notes |
| paid_at |
date |
required
|
DELETE
/payroll/salary-payments/{id}
Bearer token · accounting access
Reverses a payment: un-settles any advances it absorbed and removes its fund transaction.