Prime API
A REST API over the same service layer the application uses, so anything the interface can do, a token can do. JSON in, JSON out, company-scoped.
Authentication
Create a token under Settings → API access. Send it as a bearer token. Tokens are scoped to one company unless issued as a group token.
curl https://your-domain/api/v1/accounts \
-H "Authorization: Bearer prime_live_xxxxxxxxxxxx" \
-H "X-Company-Id: 1"
Response shape
Every endpoint returns the same envelope, matching the internal service contract. Check success before reading data.
{
"success": true,
"data": { "id": 4821, "reference": "JV-2026-0412" },
"message": "Journal posted"
}
Core endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/companies |
List companies the token can reach. |
| GET | /api/v1/accounts |
Chart of accounts for the active company. |
| POST | /api/v1/journals |
Post a balanced journal entry. Returns the entry id. |
| GET | /api/v1/invoices |
Sales invoices, filterable by status and date range. |
| POST | /api/v1/invoices |
Raise an invoice with lines and tax treatment. |
| GET | /api/v1/items |
Inventory items with current quantity per location. |
| POST | /api/v1/stock/adjustments |
Raise an adjustment for approval. |
| GET | /api/v1/employees |
Employee register for the active company. |
| GET | /api/v1/reports/trial-balance |
Trial balance for a period. |
Webhooks
Subscribe to events rather than polling. Each delivery is signed with an HMAC header you should verify before trusting the body.
journal.posted— a ledger entry has been committedinvoice.paid— a receipt fully settled an invoiceapproval.decided— a request was approved or rejectedstock.adjusted— an approved adjustment changed a quantitypayroll.completed— a payroll run finished
Rate limits and errors
600 requests per minute per token. Exceeding it returns 429 with a Retry-After header. Validation failures return 422 with a field-keyed errors object; posting a journal that does not balance is a validation failure, not a server error.
Building something against the API? Write to support@primeerp.com and we will open a sandbox company with sample data for you.