Quick Start
1. Get an API keyAccounting data APIs are protected by
X-Api-Key. Store keys in a server-side secret store.2. Call health checkVerify network, TLS, Host, and header configuration before business calls.
3. Query tenant dataUse
firmId and companyId to read the accounting data you need.curl -sS "https://accounting.sun-bd.com/api/v1/accounting/health" \
-H "X-Api-Key: YOUR_API_KEY"
Centralized Member Integration
The local member system has been removed from this project. The web app signs in through same-origin /api/central-member/login, which relays to the centralized member API. The backend validates RS256 JWTs through JWKS and loads effective permissions from the member API.
For login, logout, refresh, permissions, and JWKS details, read the central member API integration guide.
Response Shape
{
"success": true,
"data": { "...": "..." },
"error": null,
"timestamp": "2026-05-30T00:00:00Z",
"traceId": "0H..."
}
On failures, use error.code and HTTP status for program logic, not localized error text.
Main Endpoints
| Feature | Method | Path |
|---|---|---|
| Health | GET | /api/v1/accounting/health |
| Summary | GET | /api/v1/accounting/firms/{firmId}/companies/{companyId}/summary |
| Chart of accounts | GET | /api/v1/accounting/firms/{firmId}/companies/{companyId}/chart-of-accounts |
| Vouchers | GET | /api/v1/accounting/firms/{firmId}/companies/{companyId}/vouchers |
| Journal | GET | /api/v1/accounting/firms/{firmId}/companies/{companyId}/journal |
| Ledger | GET | /api/v1/accounting/firms/{firmId}/companies/{companyId}/ledger |
| Trial balance | GET | /api/v1/accounting/firms/{firmId}/companies/{companyId}/trial-balance |
| Balance sheet | GET | /api/v1/accounting/firms/{firmId}/companies/{companyId}/reports/balance-sheet |
| Income statement | GET | /api/v1/accounting/firms/{firmId}/companies/{companyId}/reports/income-statement |
Examples
Accounting summary
curl -sS "https://accounting.sun-bd.com/api/v1/accounting/firms/FIRM001/companies/COMP001/summary?dateFrom=2026-01-01&dateTo=2026-12-31" \
-H "X-Api-Key: YOUR_API_KEY"
Node.js
const response = await fetch(
"https://accounting.sun-bd.com/api/v1/accounting/firms/FIRM001/companies/COMP001/trial-balance",
{ headers: { "X-Api-Key": process.env.WEMS_ACCOUNTING_API_KEY } }
);
const payload = await response.json();
.NET
using var client = new HttpClient { BaseAddress = new Uri("https://accounting.sun-bd.com") };
client.DefaultRequestHeaders.Add("X-Api-Key", apiKeyFromSecretStore);
var payload = await client.GetFromJsonAsync<object>(
"/api/v1/accounting/firms/FIRM001/companies/COMP001/chart-of-accounts");
Error Handling
| HTTP | Common cause | Action |
|---|---|---|
| 401 | Missing or invalid API key, or invalid member token | Check headers and sign in again if needed. |
| 400 | Invalid date, paging, or query format | Fix query parameters and retry. |
| 404 | Resource or tenant data does not exist | Check firmId/companyId and data permission. |
| 503 | Service or configuration is not ready | Keep traceId and notify the administrator. |