External Weight Measures
Endpoints for registering weight measurements from external scales/weighbridges and managing the verification-approval-invoicing workflow.
Endpoints
Section titled “Endpoints”| Method | Route | Description |
|---|---|---|
POST | api/external-weight-measure | Register, correct or cancel a weighing (upsert) |
GET | api/external-weight-measure/get-by-context-user | List the weighings your API client created |
POST | api/external-weight-measure/query | Search weighings |
POST | api/external-weight-measure/export | Export the search result as CSV |
PUT | api/external-weight-measure/{id} | Replace a stored weighing by Ditio id |
DELETE | api/external-weight-measure/{id} | Delete a weighing by Ditio id |
PUT | api/external-weight-measure/mark-verified | Toggle the verified mark |
PUT | api/external-weight-measure/mark-approved | Toggle the approved mark |
PUT | api/external-weight-measure/mark-invoiced | Toggle the invoiced mark |
Routes are relative to $DITIO_MASSTRANSPORT_BASE (see
Environments) and need a token with the
masstransportapiv1 scope (see Authentication).
Property names are camelCase in responses and case-insensitive in requests.
A scale system only needs POST api/external-weight-measure. The weighing
payload, the upsert key, matching rules, status codes and full examples are in
the Weighbridge Integration guide. The other
endpoints are mainly used for review inside Ditio.
The stored weighing
Section titled “The stored weighing”Every endpoint that returns weighings returns the fields you sent (see the weighing payload) plus these fields that Ditio sets:
| Field | Type | Description |
|---|---|---|
id | string | Ditio’s id for the weighing. Use it for {id} and the mark-* endpoints. |
companyId | string | The Ditio company the weighing belongs to. |
status | integer | 0 = Unmatched, 1 = Matched, 2 = External. See How a weighing is matched. |
connectedMachineId | string | The Ditio machine the weighing was matched to, or null. |
connectedTripLogId | string | The Ditio trip the weighing was matched to, or null. |
verified | boolean | Verified mark. |
approved | boolean | Approved mark. |
invoiced | boolean | Invoiced mark. |
unitOfMeasure | integer | Read-only. 0 = tonnes, 1 = m³ (when ton is 0 and cubicMeter is greater than 0). |
internalNotes | string | Notes added in Ditio. A resend through POST keeps them. |
createdBy, modifiedBy | string | The Ditio user that created or last changed the weighing. For an API client this is its user. |
createdDateTime, modifiedDateTime | string (date-time) | When the weighing was created and last changed, in UTC. |
Register
Section titled “Register”POST /api/external-weight-measureDescribed in full in the Weighbridge Integration guide, including corrections and cancellations.
List Your Own Weighings
Section titled “List Your Own Weighings”GET /api/external-weight-measure/get-by-context-userResponse: 200 OK with an array of stored weighings:
every weighing in your token’s company that was created through your API
client’s user. There is no date filter or paging, so the list grows over time;
use Query for anything other than an occasional reconciliation.
POST /api/external-weight-measure/queryBody: a filter. Every field is optional except the dates.
| Field | Type | Description |
|---|---|---|
fromDate | string (date-time) | Weighings with dateTime at or after this (UTC). |
toDate | string (date-time) | Weighings with dateTime at or before this (UTC). |
projectIds | array of string | Ditio project ids. Matched through the projects’ project numbers against projectNumber. |
dumperIds | array of string | Ditio machine ids, matched against connectedMachineId. |
taskIds | array of string | Ditio task ids. Matched through the tasks’ external ids against productNumber. |
departments | array of string | Exact department values. |
fromGeoFenceIds, toGeoFenceIds | array of string | Ditio geofence ids. Matched through the geofence codes against department. |
measureStatus | integer | 0, 1 or 2; see status above. |
verified, approved, invoiced | boolean | Filter on each mark. |
{ "fromDate": "2026-10-01T00:00:00Z", "toDate": "2026-10-31T23:59:59Z", "approved": false}Response: 200 OK with an array of stored weighings,
newest dateTime first, with no paging. Results are limited to your token’s
company. When your API client’s user is not an administrator, only weighings
whose projectNumber matches a project the user has access to are returned
(see Project numbers).
Export
Section titled “Export”POST /api/external-weight-measure/exportBody: the same filter as Query.
Response: 200 OK with a text/csv file of the same weighings:
semicolon-separated, UTF-8, Norwegian column headers and number format, and
times in the time zone of your API client’s user.
Replace by Id
Section titled “Replace by Id”PUT /api/external-weight-measure/{id}Body: the complete stored weighing, with id equal
to {id}.
Response: 200 OK with the weighing as stored.
- The stored weighing is replaced with the body. Fields you leave out are cleared, so start from the object returned by Query.
- Unlike
POST, a replace doesn’t match the weighing again and doesn’t reset its marks or its trip. To correct a weighing from your scale system, resend it throughPOSTinstead. - Send the same
idin the route and the body.
Delete by Id
Section titled “Delete by Id”DELETE /api/external-weight-measure/{id}Response: 200 OK with the deleted weighing, or 204 No Content when no
weighing has that id. If the weighing was matched to a trip, the trip’s
receipt number and verified quantity are cleared.
A scale system that only knows its own ids cancels a weighing through POST
with "recordDeleted": true instead (see
corrections and cancellations).
Workflow
Section titled “Workflow”Weight measurements follow a verification pipeline:
- Register — External system pushes weight data
- Verify — Data is reviewed and marked as verified
- Approve — Authorized user approves for invoicing
- Invoice — Records are marked as invoiced
The mark-* endpoints take a JSON array of weighing ids and return the same
array with 200 OK:
["6703a1f2c4e5d6b7a8c9d0e1", "6703a1f2c4e5d6b7a8c9d0e2"]mark-approved also approves the trips the weighings are matched to.
Clearing the approved mark doesn’t clear it on the trips.
Errors
Section titled “Errors”Error bodies, status codes and retry rules are described in Error Handling. The status codes for registering a weighing are listed in the Weighbridge Integration guide.
Related
Section titled “Related”- Weighbridge Integration guide — Integration walkthrough and payload
- Machine Data — The machines (vehicles) that weighings are matched to
- External Excavator State — Machine state integration