v1.0 (Strictly Read-Only)

Tracost Enterprise Read-Only API

Seamlessly integrate your custom ERP with Tracost to pull project expenditure, site budgets, stages, and suppliers in real time with complete tenant security.

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
Tenant Isolation & Security:

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.

ParameterTypeDescription
fromstring (YYYY-MM-DD)Optional. Filter records on or after date.
tostring (YYYY-MM-DD)Optional. Filter records on or before date.
sitestringOptional. Filter by specific project/site name.
categorystringOptional. Filter by category (e.g. Materials, Labor, Fuel).
limitintegerOptional. Pagination limit (max 100, default 50).
offsetintegerOptional. 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 StatusCodeExplanation
200 OKSUCCESSRequest processed successfully.
401 UnauthorizedUNAUTHORIZEDMissing, expired, or invalid API key.
403 ForbiddenFORBIDDENKey lacks required scope for this resource.
405 Method Not AllowedMETHOD_NOT_ALLOWEDOnly GET requests are permitted.
500 Internal ErrorINTERNAL_SERVER_ERROREdge service error.