---
title: "Count shipments which match a set of criteria"
method: POST
path: "/services/unified-search/v1/shipments/count"
tags: ["Shipment Search"]
---

# Count shipments which match a set of criteria

`POST /services/unified-search/v1/shipments/count`

## Request

- Base URL: `https://na12.api.project44.com`
- URL: `https://na12.api.project44.com/services/unified-search/v1/shipments/count`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `/api/v4/oauth2/token`
- TypeScript: <https://skmtc.dev/project44/apis/project44-rest-api/docs/services/unified-search/v1/shipments/count/post.ts> (a function with typed inputs; its response is checked against the schema)

A combination of criteria is expected (but not required) in the request body.

The count is implicitly limited to shipments visible to the tenant performing the call.

If no criteria is present in the request body, then the response will contain a count of shipments visible to the tenant making the request.

## Request body

- ShipmentSearchCriteria: A collection of criteria used to filter the result set of shipments. The query clauses that are generated by each field in this request are combined together using AND. Example: ([clauses from shipmentStates]) AND ([clauses from transportationModes])
  - `loadItemIdentifiers` RelatedLoadItemIdentifierFilter[]
    - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS'
    - `types` string[]
    - `values` string[]
  - `loadItemDescriptions` RelatedLoadItemDescriptionFilter[]
    - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS'
    - `values` string[]
  - `orderIdentifierTypes` RelatedOrderIdentifierTypeFilter[]
    - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS': Only the EQUALS and NOT_EQUALS operators are supported for this criterion.
    - `types` string[]
  - `orderIdentifiers` RelatedOrderIdentifierFilter[]
    - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS'
    - `type` 'PURCHASE_ORDER' | 'SALES_ORDER' | 'WAREHOUSE_MOVEMENT_ORDER' | 'ADVANCED_SHIPMENT_NOTICE' | 'INVOICE' | 'DELIVERY'
    - `values` string[]
  - `orderIds` RelatedOrderInternalIdFilter[]
    - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS': Only the EQUALS and NOT_EQUALS operators are supported for this criterion.
    - `values` string[]
  - `orderSupplierIds` RelatedOrderSupplierIdFilter[]
    - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS'
    - `values` string[]
  - `orderDateRanges` RelatedOrderDateFilter[]
    - `endDateTime` string, date-time: The tail end of an absolute time window.
    - `offsetMinutes` integer: Used to construct relative ranges where negative offset indicates time before startDateTime or Now and positive offset indicates time after startDateTime or Now.
    - `operator` 'WITHIN' | 'ON_OR_BEFORE' | 'ON_OR_AFTER'
    - `relativeDateTimeWindow` 'YESTERDAY' | 'TODAY' | 'TOMORROW' | 'LAST_WEEK' | 'THIS_WEEK' | 'NEXT_WEEK' | 'THIS_MONTH' | 'LAST_MONTH' | 'NEXT_MONTH': A sliding window that matches to common time definitions like "today" or "tomorrow".
    - `relativeWindowTimeZoneOffset` object: The timezone offset of the relativeDateTimeWindow.
      - `totalSeconds` integer
      - `id` string
      - `rules` object
        - `fixedOffset` boolean
        - `transitions` object[]
          - `offsetBefore` object
            - `totalSeconds` integer
            - `id` string
          - `offsetAfter` object
            - `totalSeconds` integer
            - `id` string
          - `instant` string, date-time
          - `duration` object
            - `seconds` integer
            - `zero` boolean
            - `nano` integer
            - `negative` boolean
            - `units` object[]
              - …
          - `gap` boolean
          - `dateTimeAfter` string, date-time
          - `dateTimeBefore` string, date-time
          - `overlap` boolean
        - `transitionRules` object[]
          - `month` 'JANUARY' | 'FEBRUARY' | 'MARCH' | 'APRIL' | 'MAY' | 'JUNE' | 'JULY' | 'AUGUST' | 'SEPTEMBER' | 'OCTOBER' | 'NOVEMBER' | 'DECEMBER'
          - `timeDefinition` 'UTC' | 'WALL' | 'STANDARD'
          - `standardOffset` object
            - `totalSeconds` integer
            - `id` string
          - `offsetBefore` object
            - `totalSeconds` integer
            - `id` string
          - `offsetAfter` object
            - `totalSeconds` integer
            - `id` string
          - `dayOfWeek` 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' | 'SUNDAY'
          - `dayOfMonthIndicator` integer
          - `localTime` LocalTime
            - `hour` integer
            - `minute` integer
            - `nano` integer
            - `second` integer
          - `midnightEndOfDay` boolean
    - `startDateTime` string, date-time: The beginning of an absolute time window (if endDateTime is populated) or the anchor of a relative offset window (if offsetMinutes is populated).
    - `type` 'SUPPLIER_READY_START_DATETIME' | 'SUPPLIER_READY_END_DATETIME' | 'ORIGINAL_DELIVERY_START_DATETIME' | 'ORIGINAL_DELIVERY_END_DATETIME' | 'LAUNCH_DATETIME' | 'ORIGINAL_DELIVERY_ESTIMATE_DATETIME'
  - `orderDeltas` RelatedOrderDeltaFilter[]: Match shipments on the differences between timestamps of related orders. Criteria are ANDed together.
    - `durationInMinutes` integer
    - `operator` 'MORE_THAN' | 'MORE_THAN_OR_EQUALS' | 'LESS_THAN' | 'LESS_THAN_OR_EQUALS' | 'EQUALS' | 'NOT_EQUALS' | 'EXISTS' | 'NOT_EXISTS'
    - `type` 'RUNNING_EARLY' | 'RUNNING_LATE'
  - `orderTags` RelatedOrderTagFilter[]
    - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS'
    - `types` string[]
    - `values` string[]
  - `orderAdditionalIdentifiers` RelatedOrderAdditionalIdentifierFilter[]
    - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS'
    - `types` string[]
    - `values` string[]
  - `searchText` string: A text-based search against a select set of fields in each shipment. If any of a shipment's select fields contain this value, then that shipment will be included in the result set.
  - `shipmentIds` ShipmentInternalIdFilter[]
    - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS': Only the EQUALS and NOT_EQUALS operators are supported for this criterion.
    - `values` string[]
  - `shipmentIdentifiers` ShipmentIdentifierFilter[]
    - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS': If values is not populated, only the EQUALS operator is supported.
    - `scopes` string[]: If multiple scopes are provided, they will be combined using OR boolean logic.
    - `types` LogisticsIdentifierTypeEnum[]
    - `values` string[]
  - `shipmentAttributes` ShipmentAttributeFilter[]
    - `name` string
    - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS': If values is not populated, the CONTAINS operator is not supported.
    - `values` string[]
  - `shipmentDates` ShipmentDateFilter[]: Match shipments which contain one or more dates that meet all criteria. Criteria are ANDed together, types are ORed together.
    - `endDateTime` string, date-time: The tail end of an absolute time window.
    - `offsetMinutes` integer: Used to construct relative ranges where negative offset indicates time before startDateTime or Now and positive offset indicates time after startDateTime or Now.
    - `operator` 'WITHIN' | 'ON_OR_BEFORE' | 'ON_OR_AFTER'
    - `relativeDateTimeWindow` 'YESTERDAY' | 'TODAY' | 'TOMORROW' | 'LAST_WEEK' | 'THIS_WEEK' | 'NEXT_WEEK' | 'THIS_MONTH' | 'LAST_MONTH' | 'NEXT_MONTH': A sliding window that matches to common time definitions like "today" or "tomorrow".
    - `relativeWindowTimeZoneOffset` object: The timezone offset of the relativeDateTimeWindow.
      - `totalSeconds` integer
      - `id` string
      - `rules` object
        - `fixedOffset` boolean
        - `transitions` object[]
          - `offsetBefore` object
            - `totalSeconds` integer
            - `id` string
          - `offsetAfter` object
            - `totalSeconds` integer
            - `id` string
          - `instant` string, date-time
          - `duration` object
            - `seconds` integer
            - `zero` boolean
            - `nano` integer
            - `negative` boolean
            - `units` object[]
              - …
          - `gap` boolean
          - `dateTimeAfter` string, date-time
          - `dateTimeBefore` string, date-time
          - `overlap` boolean
        - `transitionRules` object[]
          - `month` 'JANUARY' | 'FEBRUARY' | 'MARCH' | 'APRIL' | 'MAY' | 'JUNE' | 'JULY' | 'AUGUST' | 'SEPTEMBER' | 'OCTOBER' | 'NOVEMBER' | 'DECEMBER'
          - `timeDefinition` 'UTC' | 'WALL' | 'STANDARD'
          - `standardOffset` object
            - `totalSeconds` integer
            - `id` string
          - `offsetBefore` object
            - `totalSeconds` integer
            - `id` string
          - `offsetAfter` object
            - `totalSeconds` integer
            - `id` string
          - `dayOfWeek` 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' | 'SUNDAY'
          - `dayOfMonthIndicator` integer
          - `localTime` LocalTime
            - `hour` integer
            - `minute` integer
            - `nano` integer
            - `second` integer
          - `midnightEndOfDay` boolean
    - `startDateTime` string, date-time: The beginning of an absolute time window (if endDateTime is populated) or the anchor of a relative offset window (if offsetMinutes is populated).
    - `types` string[]: The types of dates to filter on. At least one type must be provided. If multiple types are provided, then any of the corresponding dates may match the filter.
  - `shipmentStates` ShipmentStateFilter[]
    - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS': Only the EQUALS and NOT_EQUALS operators are supported for this criterion.
    - `types` string[]
  - `shipmentEvents` ShipmentEventFilter[]: Each item in this array should represent criteria for a distinct event type.
    - `dateRanges` ShipmentEventDateCriterion[]: Each item in this array should represent a distinct date type (planned, estimated, etc.) Criteria within this array are combined using an AND operator.
      - `endDateTime` string, date-time: The tail end of an absolute time window.
      - `offsetMinutes` integer: Used to construct relative ranges where negative offset indicates time before startDateTime or Now and positive offset indicates time after startDateTime or Now.
      - `operator` 'WITHIN' | 'ON_OR_BEFORE' | 'ON_OR_AFTER'
      - `relativeDateTimeWindow` 'YESTERDAY' | 'TODAY' | 'TOMORROW' | 'LAST_WEEK' | 'THIS_WEEK' | 'NEXT_WEEK' | 'THIS_MONTH' | 'LAST_MONTH' | 'NEXT_MONTH': A sliding window that matches to common time definitions like "today" or "tomorrow".
      - `relativeWindowTimeZoneOffset` object: The timezone offset of the relativeDateTimeWindow.
        - `totalSeconds` integer
        - `id` string
        - `rules` object
          - `fixedOffset` boolean
          - `transitions` object[]
            - `offsetBefore` object
              - …
            - `offsetAfter` object
              - …
            - `instant` string, date-time
            - `duration` object
              - …
            - `gap` boolean
            - `dateTimeAfter` string, date-time
            - `dateTimeBefore` string, date-time
            - `overlap` boolean
          - `transitionRules` object[]
            - `month` 'JANUARY' | 'FEBRUARY' | 'MARCH' | 'APRIL' | 'MAY' | 'JUNE' | 'JULY' | 'AUGUST' | 'SEPTEMBER' | 'OCTOBER' | 'NOVEMBER' | 'DECEMBER'
            - `timeDefinition` 'UTC' | 'WALL' | 'STANDARD'
            - `standardOffset` object
              - …
            - `offsetBefore` object
              - …
            - `offsetAfter` object
              - …
            - `dayOfWeek` 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' | 'SUNDAY'
            - `dayOfMonthIndicator` integer
            - `localTime` LocalTime
              - …
            - `midnightEndOfDay` boolean
      - `startDateTime` string, date-time: The beginning of an absolute time window (if endDateTime is populated) or the anchor of a relative offset window (if offsetMinutes is populated).
      - `type` 'PLANNED_DATETIME' | 'PLANNED_END_DATETIME' | 'INITIAL_PLANNED_DATETIME' | 'INITIAL_PLANNED_END_DATETIME' | 'CARRIER_INITIAL_PLANNED_DATETIME' | 'CARRIER_INITIAL_PLANNED_END_DATETIME' | 'CARRIER_LATEST_PLANNED_DATETIME' | 'CARRIER_LATEST_PLANNED_END_DATETIME' | 'CUSTOMER_INITIAL_PLANNED_DATETIME' | 'CUSTOMER_INITIAL_PLANNED_END_DATETIME' | 'CUSTOMER_LATEST_PLANNED_DATETIME' | 'CUSTOMER_LATEST_PLANNED_END_DATETIME' | 'ESTIMATED_DATETIME' | 'ACTUAL_DATETIME' | 'ACTUAL_OR_ESTIMATED_DATETIME': The type of date on the event that should be searched.
    - `deltas` ShipmentEventDeltaCriterion[]: Each item in this array should represent a distinct delta type (running early, occurred late, etc.) Criteria within this array are combined using an AND operator.
      - `operator` 'MORE_THAN' | 'MORE_THAN_OR_EQUALS' | 'LESS_THAN' | 'LESS_THAN_OR_EQUALS' | 'EQUALS' | 'NOT_EQUALS' | 'EXISTS' | 'NOT_EXISTS': Only the EQUALS, LESS_THAN, and MORE_THAN operators are supported for this criterion.
      - `type` 'RUNNING_EARLY' | 'RUNNING_LATE' | 'OCCURRED_EARLY' | 'OCCURRED_LATE' | 'OCCURRED_EARLY_OR_RUNNING_EARLY' | 'OCCURRED_LATE_OR_RUNNING_LATE'
      - `value` integer
    - `descriptions` ShipmentEventDescriptionCriterion[]: Each item in this array should represent a distinct event description Criteria within this array are combined using an AND operator.
      - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS'
      - `values` string[]
    - `stopProperties` LocationCriterion[]: This criteria applies against the stop location associated with the event.
      - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS': Some fields do not support the CONTAINS operator.
      - `propertyName` 'LOCATION_NAME' | 'LOCATION_ADDRESS' | 'LOCATION_CITY' | 'LOCATION_STATE' | 'LOCATION_COUNTRY' | 'LOCATION_ZIP'
      - `propertyNames` string[]
      - `values` string[]
    - `stopIdentifiers` LocationIdentifierCriterion[]: This criteria applies against the stop location associated with the event.
      - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS': If values is not populated, the CONTAINS operator is not supported.
      - `types` string[]
      - `values` string[]
    - `stopType` StopTypeCriterion: Match shipments based on stop type. Top-level items are combined using an AND operator, but the values within each item are combined using an OR operator. Example: (stop.type EQUALS [A OR B OR C]) Example: (stop.type NOT_EQUALS A) AND (stop.type NOT_EQUALS B)
      - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS': Only the EQUALS and NOT_EQUALS operators are supported for this criterion.
      - `types` string[]
    - `scopes` string[]: If multiple scopes are provided, they will be combined using OR boolean logic.
    - `type` 'UNKNOWN' | 'TRACKING_INITIATE' | 'TRACKING_START' | 'ARRIVAL_AT_STOP' | 'DEPARTURE_FROM_STOP' | 'LOAD_ONTO_VEHICLE' | 'UNLOAD_FROM_VEHICLE' | 'TRACKING_END_DUE_TO_TIMEOUT' | 'TRACKING_END_BY_USER' | 'TRACKING_COMPLETE' | 'GATE_IN' | 'GATE_OUT' | 'FLIGHT_BOOKING' | 'MANIFEST' | 'RECEIVE_FROM_SHIPPER' | 'CONSIGNEE_NOTIFY' | 'DELIVERY' | 'WARNING' | 'EXCEPTION' | 'TRACKING_STOP' | 'EXCEPTION_LATE_DEPARTURE' | 'EXCEPTION_MISSED_CONNECTION' | 'GATE_IN_FULL' | 'GATE_IN_EMPTY' | 'GATE_OUT_EMPTY' | 'GATE_OUT_FULL' | 'LOAD' | 'DISCHARGE' | 'EXCEPTION_DELAYED' | 'EXCEPTION_DELIVERY_MISSED' | 'EXCEPTION_HELD' | 'EXCEPTION_PICKUP_MISSED' | 'AVAILABLE' | 'ENTERED_GEOFENCE' | 'EXITED_GEOFENCE' | 'INFO' | 'OUT_FOR_DELIVERY' | 'PICKED_UP' | 'RETURN_TO_SENDER' | 'TRACKING_FAILED' | 'UNAUTHORIZED' | 'PICKUP_MISSED' | 'SURVEY' | 'HELD' | 'RELEASE' | 'DELAYED' | 'DELIVERY_MISSED' | 'ENTERED_INNER_GEOFENCE' | 'EXITED_INNER_GEOFENCE' | 'ENTERED_OUTER_GEOFENCE' | 'EXITED_OUTER_GEOFENCE' | 'ENTERED_FINAL_GEOFENCE' | 'EXITED_FINAL_GEOFENCE' | 'IDLE' | 'DRIVER_DENY_TRACKING' | 'UNKNOWN_EQUIPMENT_IDENTIFIER' | 'MISSING_EQUIPMENT_IDENTIFIER' | 'DISPATCH' | 'CUSTOMS_HOLD' | 'CUSTOMS_CLEARANCE' | 'CUSTOMS_DOCS_FILING' | 'CUSTOMS_TRANSIT_DOCS_ISSUED' | 'CUSTOMS_TRANSIT_DOCS_CLOSED' | 'CARRIER_HOLD' | 'RECEIVE_FROM_CARRIER' | 'ISSUE_FREIGHT_BILL' | 'FREIGHT_ON_HAND' | 'READY_FOR_CARRIAGE' | 'LAST_FREE_DAY' | 'MISSING_CARRIER' | 'STUFF' | 'STRIP' | 'SEAL_INSPECTION' | 'SEAL_REMOVAL' | 'SEAL_RESEAL' | 'HANDOVER' | 'DOCUMENT_ADD' | 'DOCUMENT_REMOVE' | 'REMOVE_FROM_BOOKING' | 'COST_UPDATE' | 'SHARING_STOPPED' | 'ROLLED_OVER' | 'BAD_ORDER' | 'BAD_ORDER_RELEASE'
  - `shipmentTrackingStatusEvents` ShipmentTrackingStatusEventFilter[]
    - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS': Only the EQUALS and NOT_EQUALS operators are supported for this criterion.
    - `scopes` string[]
    - `types` string[]
  - `shipmentStops` ShipmentStopFilter[]
    - `identifiers` LocationIdentifierCriterion[]
      - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS': If values is not populated, the CONTAINS operator is not supported.
      - `types` string[]
      - `values` string[]
    - `properties` LocationCriterion[]
      - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS': Some fields do not support the CONTAINS operator.
      - `propertyName` 'LOCATION_NAME' | 'LOCATION_ADDRESS' | 'LOCATION_CITY' | 'LOCATION_STATE' | 'LOCATION_COUNTRY' | 'LOCATION_ZIP'
      - `propertyNames` string[]
      - `values` string[]
    - `stopType` StopTypeCriterion: Match shipments based on stop type. Top-level items are combined using an AND operator, but the values within each item are combined using an OR operator. Example: (stop.type EQUALS [A OR B OR C]) Example: (stop.type NOT_EQUALS A) AND (stop.type NOT_EQUALS B)
      - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS': Only the EQUALS and NOT_EQUALS operators are supported for this criterion.
      - `types` string[]
    - `scopes` string[]
  - `shipmentDurations` ShipmentDurationFilter[]: Match shipments which contain one or more durations that meet all criteria. Criteria are ANDed together, types are ORed together. Example: (estimated transit time >= 30 minutes AND < 1 day) AND (actual transit time does not exist) Example: (duration X OR duration Y >= 30 minutes) AND (duration Z < 3 hours)
    - `durationCriteria` TimeDurationCriterion[]: The criteria which must be met by the targeted duration(s). Criteria are ANDed together.
      - `operator` 'MORE_THAN' | 'MORE_THAN_OR_EQUALS' | 'LESS_THAN' | 'LESS_THAN_OR_EQUALS' | 'EQUALS' | 'NOT_EQUALS' | 'EXISTS' | 'NOT_EXISTS': Defines how the target field must compare to the threshold in order to be considered a match. Defaults to EQUALS if not provided.
      - `value` TimeDuration: The threshold to check against. Required unless operator is EXISTS or NOT_EXISTS. The unit UNKNOWN is not supported.
        - `amount` integer: The amount of time for a duration.
        - `unit` 'UNKNOWN' | 'MILLISECONDS' | 'SECONDS' | 'MINUTES' | 'HOURS' | 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS', enum: The unit of time measurement for a duration.
    - `types` string[]: The types of durations against which to apply the criteria. Types are ORed together.
  - `sharingContextTenants` ShipmentSharingTenantFilter[]
    - `names` string[]
    - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS'
    - `scopes` string[]
  - `transportationModes` ShipmentModeFilter[]
    - `operator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS': Only the EQUALS and NOT_EQUALS operators are supported for this criterion.
    - `scopes` string[]
    - `types` string[]

## Response `200`

OK

- ShipmentCount: Contains information about the count of shipments which match some criteria.
  - `total` integer

## Other responses

- `400`: Missing or invalid user context headers.

## Changes

- **2026-11-06** `cdf9675e2294`: 2 info
  - added the new `INBOUND_VOYAGE_NUMBER` enum value to the request property `shipmentIdentifiers/items/types/items/`
  - added the new `TRAILER_LICENSE_PLATE` enum value to the request property `shipmentIdentifiers/items/types/items/`
- **2025-06-18** `20d9e25a24eb`: 35 info
  - added the new optional request property `orderDateRanges/items/relativeDateTimeWindow`
  - added the new optional request property `orderDateRanges/items/relativeWindowTimeZoneOffset`
  - added the new optional request property `shipmentDates`
  - added the new optional request property `shipmentEvents/items/stopProperties/items/propertyNames`
  - …31 more
- **2025-03-26** `468ddb57685c`: 5 breaking, 2 warning, 35 info
  - the `shipmentDurations/items/durationCriteria/items/` request property type changed from no type to `object`
  - the `shipmentEvents/items/stopType` request property type changed from no type to `object`
  - the `shipmentStates/items/` request property type changed from no type to `object`
  - the `shipmentStops/items/` request property type changed from no type to `object`
  - …38 more

[Operation history](https://skmtc.dev/project44/apis/project44-rest-api/changes/services/unified-search/v1/shipments/count/post.md)

---

[API](https://skmtc.dev/project44/apis/project44-rest-api.md) - [All operations](https://skmtc.dev/project44/apis/project44-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/project44/apis/project44-rest-api/revisions/cdf9675e2294?raw)
