Weight Measures
When trucks cross a weighbridge, the ticket data usually lives in the scale vendor’s system — while the project’s mass balance lives in Ditio. The External Weight Measure API connects the two: your scale system pushes each measurement into Ditio, where it enters the verification → approval → invoicing workflow alongside the mass-transport data registered in the field.
When to use this
Section titled “When to use this”- You operate a weighbridge or mobile scale and want tickets to appear in Ditio automatically
- You’re a scale-system vendor building a standard Ditio connector
- You need weight data verified and approved in one place before invoicing
Prerequisites
Section titled “Prerequisites”- API credentials with the
masstransportapiv1scope — see Authentication - Company and project identifiers in Ditio, plus the Mass Transport API base URL — both provided by your Ditio contact during onboarding
Endpoints
Section titled “Endpoints”| Method | Route | Description |
|---|---|---|
POST | api/external-weight-measure | Register a weight measurement |
POST | api/external-weight-measure/query | Search weight data |
POST | api/external-weight-measure/export | Export as CSV |
PUT | api/external-weight-measure/mark-verified | Mark records as verified |
PUT | api/external-weight-measure/mark-approved | Mark records as approved |
PUT | api/external-weight-measure/mark-invoiced | Mark records as invoiced |
The workflow
Section titled “The workflow”Weight measurements move through a pipeline:
- Register — your scale system pushes the measurement
- Verify — the data is reviewed and marked as verified
- Approve — an authorized user approves it for invoicing
- Invoice — records are marked as invoiced
Each mark-* endpoint advances records one step, so both Ditio users and
your system always agree on where a ticket stands.
Getting a token
Section titled “Getting a token”# Test (default) — production: https://identity.ditio.appexport DITIO_IDENTITY_BASE="https://identity.ditio.dev"
TOKEN=$(curl -s -X POST "$DITIO_IDENTITY_BASE/connect/token" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials" \ -d "client_id=YOUR_CLIENT_ID" \ -d "client_secret=YOUR_CLIENT_SECRET" \ -d "scope=masstransportapiv1" | jq -r '.access_token')Registering a measurement
Section titled “Registering a measurement”# DITIO_MASSTRANSPORT_BASE is provided during onboardingcurl -X POST "$DITIO_MASSTRANSPORT_BASE/api/external-weight-measure" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ ... }' # measurement payload — see the interactive referenceFor the full request and response schemas, use the interactive API reference or the endpoint page: External Weight Measures.
Common issues
Section titled “Common issues”| Issue | Cause | Fix |
|---|---|---|
401 Unauthorized | Token missing/expired, or missing the masstransportapiv1 scope | Request the scope explicitly; refresh expired tokens |
403 Forbidden | Client not enabled for mass-transport writes | Contact your Ditio contact to enable the integration |
| Records stuck as unverified | Verification step not wired | Call mark-verified from your side, or agree with the site who verifies |
Related
Section titled “Related”- External Weight Measures — endpoint reference
- Machine Integration — pushing excavator state data
- Authentication — credentials and scopes