Quick Start
The Tracost ERP Integration API is served via high-performance edge infrastructure. Base URL:
https://api.tracost.com/functions/v1/erp-api/v1
All endpoints accept query parameters for pagination and filtering and strictly require standard Bearer token authorization.
Authentication & Environments
Tracost supports dual environments: Sandbox / Test (using trc_test_... keys) and Production Live (using trc_live_... keys). In Sandbox mode, requests return realistic synthetic construction records so your team can test ingestion without touching live production ledgers.
Pass your API token in the HTTP Authorization header:
Authorization: Bearer trc_test_xxxxxxxxxxxxxxxxxxxxxxxx
Each key is strictly isolated to the issuing organization. Tokens are hashed with SHA-256 at rest. Any attempt to invoke non-GET methods (POST, PUT, DELETE, PATCH) is automatically rejected with 405 Method Not Allowed.
GET /v1/expenses
Retrieve financial transactions, materials purchases, labor disbursements, and site vouchers.
| Parameter | Type | Description |
|---|---|---|
from | string (YYYY-MM-DD) | Optional. Filter records on or after date. |
to | string (YYYY-MM-DD) | Optional. Filter records on or before date. |
site | string | Optional. Filter by specific project/site name. |
category | string | Optional. Filter by category (e.g. Materials, Labor, Fuel). |
limit | integer | Optional. Pagination limit (max 100, default 50). |
offset | integer | Optional. Pagination record offset. |
Example Request (cURL):
curl -X GET "https://api.tracost.com/functions/v1/erp-api/v1/expenses?limit=50&from=2026-01-01" \ -H "Authorization: Bearer trc_live_your_key_here" \ -H "Content-Type: application/json"
Sample 200 OK Response:
{
"status": "success",
"data": [
{
"id": 1042,
"date": "2026-03-12",
"amount": 4500.0,
"cat": "Materials",
"subcategory": "Cement & Aggregates",
"vendor": "Dangote Cement Ltd",
"descr": "Foundation pouring supply",
"site": "Airport Residential Towers",
"stage": "Substructure",
"phase": "Phase 1",
"unit_price": 45.0,
"qty": 100,
"method": "Bank Transfer",
"created_at": "2026-03-12T14:22:00Z"
}
],
"pagination": {
"total": 142,
"limit": 50,
"offset": 0,
"has_more": true
},
"meta": {
"org_id": "f871e6c4-93ad-4b50-aef1-2c60846f872f",
"timestamp": "2026-11-08T08:30:00Z"
}
}
GET /v1/projects
Retrieve projects and sites managed by your organization.
curl -X GET "https://api.tracost.com/functions/v1/erp-api/v1/projects" \ -H "Authorization: Bearer trc_live_your_key_here"
GET /v1/stages
Retrieve project stages, milestone progress, and stage budget caps.
GET /v1/vendors
Retrieve your organization's directory of active vendors, suppliers, and subcontractors.
Status & Error Codes
| HTTP Status | Code | Explanation |
|---|---|---|
| 200 OK | SUCCESS | Request processed successfully. |
| 401 Unauthorized | UNAUTHORIZED | Missing, expired, or invalid API key. |
| 403 Forbidden | FORBIDDEN | Key lacks required scope for this resource. |
| 405 Method Not Allowed | METHOD_NOT_ALLOWED | Only GET requests are permitted. |
| 500 Internal Error | INTERNAL_SERVER_ERROR | Edge service error. |