Skip to content

External Weight Measures

Endpoints for registering weight measurements from external scales/weighbridges and managing the verification-approval-invoicing workflow.

MethodRouteDescription
POSTapi/external-weight-measureRegister, correct or cancel a weighing (upsert)
GETapi/external-weight-measure/get-by-context-userList the weighings your API client created
POSTapi/external-weight-measure/querySearch weighings
POSTapi/external-weight-measure/exportExport the search result as CSV
PUTapi/external-weight-measure/{id}Replace a stored weighing by Ditio id
DELETEapi/external-weight-measure/{id}Delete a weighing by Ditio id
PUTapi/external-weight-measure/mark-verifiedToggle the verified mark
PUTapi/external-weight-measure/mark-approvedToggle the approved mark
PUTapi/external-weight-measure/mark-invoicedToggle 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.

Every endpoint that returns weighings returns the fields you sent (see the weighing payload) plus these fields that Ditio sets:

FieldTypeDescription
idstringDitio’s id for the weighing. Use it for {id} and the mark-* endpoints.
companyIdstringThe Ditio company the weighing belongs to.
statusinteger0 = Unmatched, 1 = Matched, 2 = External. See How a weighing is matched.
connectedMachineIdstringThe Ditio machine the weighing was matched to, or null.
connectedTripLogIdstringThe Ditio trip the weighing was matched to, or null.
verifiedbooleanVerified mark.
approvedbooleanApproved mark.
invoicedbooleanInvoiced mark.
unitOfMeasureintegerRead-only. 0 = tonnes, 1 = m³ (when ton is 0 and cubicMeter is greater than 0).
internalNotesstringNotes added in Ditio. A resend through POST keeps them.
createdBy, modifiedBystringThe Ditio user that created or last changed the weighing. For an API client this is its user.
createdDateTime, modifiedDateTimestring (date-time)When the weighing was created and last changed, in UTC.
POST /api/external-weight-measure

Described in full in the Weighbridge Integration guide, including corrections and cancellations.

GET /api/external-weight-measure/get-by-context-user

Response: 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/query

Body: a filter. Every field is optional except the dates.

FieldTypeDescription
fromDatestring (date-time)Weighings with dateTime at or after this (UTC).
toDatestring (date-time)Weighings with dateTime at or before this (UTC).
projectIdsarray of stringDitio project ids. Matched through the projects’ project numbers against projectNumber.
dumperIdsarray of stringDitio machine ids, matched against connectedMachineId.
taskIdsarray of stringDitio task ids. Matched through the tasks’ external ids against productNumber.
departmentsarray of stringExact department values.
fromGeoFenceIds, toGeoFenceIdsarray of stringDitio geofence ids. Matched through the geofence codes against department.
measureStatusinteger0, 1 or 2; see status above.
verified, approved, invoicedbooleanFilter 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).

POST /api/external-weight-measure/export

Body: 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.

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 through POST instead.
  • Send the same id in the route and the body.
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).

Weight measurements follow a verification pipeline:

  1. Register — External system pushes weight data
  2. Verify — Data is reviewed and marked as verified
  3. Approve — Authorized user approves for invoicing
  4. 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.

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.