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
| Field | Type | Required | Description |
|---|---|---|---|
| dmLoadNumber | decimal | Yes | DM Load Number of the shipment |
| lineItems | array | Yes | At least one item required. Replaces all existing items. |
| lineItems[].pieces | integer | Yes | Number of pieces |
| lineItems[].weight | decimal | Yes | Weight in pounds |
| lineItems[].length / width / height | decimal | No | Dimensions in inches. Required by some carriers -- provide when known. |
| lineItems[].description | string | No | Freight description |
| lineItems[].sku | string | No | SKU or item identifier |
| lineItems[].packagingType | string | No | Defaults to "Pallet" |
| lineItems[].class | string | No | Freight class. Defaults to "UD" (undeclared). |
| lineItems[].unitValue | decimal | No | Declared value per unit |
| lineItems[].hazardousMaterial | bool | No | Defaults to false |
| lineItems[].lineNumber | integer | No | Explicit 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>