For developers
API for other Gaunita products
How HRMS and other products post to Books.
Other Gaunita products post to Books through a small service API. It is authenticated with a per-service secret key (set by your administrator as BOOKS_SERVICE_KEYS) and is not for end-user scripts.
All calls send Authorization: Bearer <service key> and name the organisation. The organisation must have an active Books plan.
| Call | Purpose |
|---|---|
GET /api/service/v1/accounts?orgId=…&businessId=… | List the chart of accounts |
POST /api/service/v1/accounts/ensure | Create or adopt the system accounts a service needs: { orgId, accounts: [{ key, code, name, type, subtype }] } |
POST /api/service/v1/journals | Post a balanced journal: { orgId, ref, date, narration, lines: [{ account, debit | credit }] } |
DELETE /api/service/v1/journals/<ref>?orgId=…&date=… | Reverse a posted journal |
- Lines name an account by system key or code; amounts are integers in the smallest currency unit (paise).
- Posting is idempotent per service and
ref: repeating a request returns the original entry withduplicate: true, so retries are safe. - Unbalanced journals and unknown accounts are rejected with a clear message; periods locked in Books are respected.
#Businesses
GET /businesses?orgId=… lists an organisation's businesses (the first is its default). POST /businesses with { orgId, ref, name, countryCode?, currency?, stateCode?, city? } creates a separate business for the calling service (for example one per POS outlet) or returns the one already made for that ref. It counts against the plan's business limit. POST /accounts/ensure accepts income and equity accounts as well as assets, liabilities and expenses.