DM Web Services Documentation

ReplaceShipmentLineItems

Replaces the entire product/line item collection on an existing shipment. All existing items are removed and rebuilt from the supplied list.

All responses are HTTP 200. Check the status field for Success or Error.

Full replacement: This call removes all existing line items and replaces them with the list you provide. Send the complete desired set -- not just the changed items. At least one item is required.
Lock rule: This call fails if ActualPickup is set and on or before today. References and dates are not affected by this operation.

Function Overview

  • Purpose: Update the freight/product details on an existing shipment by replacing the full line item collection.
  • REST Endpoint: POST /api/public/v1/shipping/ReplaceShipmentLineItems
  • SOAP Operation: ReplaceShipmentLineItems(ReplaceShipmentLineItemsRequest)
  • Authentication: Required -- Bearer token in HTTP Authorization header

REST Interface

Headers

Authorization: Bearer <token>
Content-Type: application/json

Request Body

{
  "dmLoadNumber": 4363968,
  "lineItems": [
    {
      "pieces": 2,
      "weight": 120,
      "length": 48,
      "width": 40,
      "height": 36,
      "description": "Office Chair",
      "sku": "CHAIR-001",
      "packagingType": "Pallet",
      "class": "92.5",
      "unitValue": 299.99,
      "hazardousMaterial": false,
      "lineNumber": 1
    }
  ]
}

Request Fields

FieldTypeRequiredDescription
dmLoadNumberdecimalYesDM Load Number of the shipment
lineItemsarrayYesAt least one item required. Replaces all existing items.
lineItems[].piecesintegerYesNumber of pieces
lineItems[].weightdecimalYesWeight in pounds
lineItems[].length / width / heightdecimalNoDimensions in inches. Required by some carriers -- provide when known.
lineItems[].descriptionstringNoFreight description
lineItems[].skustringNoSKU or item identifier
lineItems[].packagingTypestringNoDefaults to "Pallet"
lineItems[].classstringNoFreight class. Defaults to "UD" (undeclared).
lineItems[].unitValuedecimalNoDeclared value per unit
lineItems[].hazardousMaterialboolNoDefaults to false
lineItems[].lineNumberintegerNoExplicit line number. Auto-assigned if omitted.

Response -- Success

{
  "status": "Success",
  "dmLoadNumber": 4363968,
  "errors": []
}

Response -- Error

{
  "status": "Error",
  "dmLoadNumber": 4363968,
  "errors": ["At least one LineItem is required."]
}

SOAP Interface

WSDL

/soap/public/v1/shipping?singlewsdl

Authentication note: Pass your Bearer token as an HTTP header, not inside the SOAP envelope.

SOAP Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Header/>
  <soapenv:Body>
    <ReplaceShipmentLineItems xmlns="http://dmwebservices.com/shipping/public/v1">
      <request>
        <DMLoadNumber>4363968</DMLoadNumber>
        <LineItems>
          <LineItem>
            <Pieces>2</Pieces>
            <Weight>120</Weight>
            <Length>48</Length>
            <Width>40</Width>
            <Height>36</Height>
            <Description>Office Chair</Description>
            <SKU>CHAIR-001</SKU>
            <PackagingType>Pallet</PackagingType>
            <Class>92.5</Class>
            <UnitValue>299.99</UnitValue>
            <HazardousMaterial>false</HazardousMaterial>
            <LineNumber>1</LineNumber>
          </LineItem>
        </LineItems>
      </request>
    </ReplaceShipmentLineItems>
  </soapenv:Body>
</soapenv:Envelope>

Integration Samples


Related Resources