Endpoints
All endpoints are GET, return JSON with Cache-Control: no-store, and return the newest records first. List endpoints accept limit and before (see Pagination). A field is omitted when the record has no value for it.
GET /api/v1/me
Checks a key and shows what it can do.
{"ok":true,"organizationId":"<factory id>","scopes":["read:customers"]}
GET /api/v1/customers
Scope read:customers.
| Field | Notes |
|---|---|
id | FactoraERP record id |
customerCode | |
name | |
email | |
phone | |
taxPin | KRA PIN |
status | |
_creationTime | Creation time, ms since epoch. Used for paging. |
GET /api/v1/inventory-items
Scope read:inventory.
| Field | Notes |
|---|---|
id | FactoraERP record id |
code | |
name | |
unit | |
category | |
isActive | boolean |
currentStock | number |
reorderLevel | number |
_creationTime | Creation time, ms since epoch. Used for paging. |
GET /api/v1/sales-invoices
Scope read:sales.
| Field | Notes |
|---|---|
id | FactoraERP record id |
invoiceNumber | |
buyerName | |
issuedDate | |
dueDate | |
status | |
currency | |
totalAmount | number |
amountPaid | number |
etimsStatus | KRA eTIMS submission status |
_creationTime | Creation time, ms since epoch. Used for paging. |
Example
curl -H "X-API-Key: $FACTORA_API_KEY" "https://brazen-raven-302.convex.site/api/v1/sales-invoices?limit=2"
{
"ok": true,
"data": [
{"id": "<id>", "invoiceNumber": "<number>", "buyerName": "<name>", "status": "<status>", "currency": "KES", "totalAmount": 0, "amountPaid": 0, "_creationTime": 1793000000000.0},
{"id": "<id>", "invoiceNumber": "<number>", "...": "...", "_creationTime": 1792900000000.0}
],
"nextBefore": 1792900000000.0
}
Values above are placeholders, not real data.