D&D Calculation Status

Overview

The D&D calculation status shows how complete the Detention and Demurrage (D&D) fees of a tracked shipment are. It is calculated per shipment from its contract mappings and calculated fees, and you can filter on it, so you can fetch only the shipments whose D&D data changed since your last request.

For the fee breakdown itself, see the D&D Fees API.

API Response Structure

Top-level Response Object

  • Each response includes a list of trackedShipments, while each shipment contains a rates object.
  • The status is under rates.destination.dnd.calculationStatus. There is one status per shipment, covering both the buy and sell sides.
  • Shipments with no D&D data return dnd as null.

Status Codes

Status CodeDescription
DND_EMPTYNo READY contract mappings
DND_IN_PROGRESSMapped, some fees not calculated yet, shipment still active
DND_INCOMPLETEMapped, some fees not calculated, shipment no longer active
DND_CALCULATEDEvery mapped fee is calculated

Status Fields

FieldDescription
codeThe current status code
previousCodeThe status before the last change. Can be null
readyMappingsNumber of READY contract mappings for the shipment
calculatedFeesNumber of calculated fees linked to those mappings
ratioreadyMappings:calculatedFees, for example 3:3
changedAt, lastChangedAtTimestamps (UTC) of the status updates. Filter on lastChangedAt
lastChangeReason, reason, reasonSourceWhat triggered the last status update, and which part of the system raised it. reasonSource can be null

Request Example

query DndCalculatedSince($limit: PositiveInt!, $offset: NonNegativeInt!, $filterBy: [FilterByInput!]) {
  trackedShipments(limit: $limit, offset: $offset, includeDnd: true, filterBy: $filterBy) {
    totalFiltered
    data {
      shipment {
        id
        rates {
          destination {
            dnd {
              calculationStatus {
                code
                previousCode
                readyMappings
                calculatedFees
                ratio
                lastChangedAt
              }
            }
          }
        }
      }
    }
  }
}

Use shipment { id } in your selection, not shipmentId.

GraphQL Variables

{
  "limit": 100,
  "offset": 0,
  "filterBy": [
    { "field": "SHIPMENT_DND_CALCULATION_STATUS_CODE", "values": ["DND_CALCULATED"] },
    { "field": "SHIPMENT_DND_CALCULATION_STATUS_LAST_CHANGED_AT", "ranges": [{ "gte": "2026-10-29T00:00:00Z" }] }
  ]
}

Filter Fields

Filter fieldValues
SHIPMENT_DND_CALCULATION_STATUS_CODEOne or more status codes, for example ["DND_CALCULATED"]
SHIPMENT_DND_CALCULATION_STATUS_LAST_CHANGED_ATA date range, for example [{ "gte": "2026-10-29T00:00:00Z" }]

How to Fetch Only Shipments That Changed

  • Combine the two filters above: the status code you care about, and lastChangedAt on or after the time of your last request.
  • Save the latest lastChangedAt you received, and use it as the start of your next request.
  • Results are not returned in time order.