CreateShipment
Creates a new shipment record in the DM Web Services system. Available via both REST and SOAP. Supports two shipment types -- see Shipment Types: Standard vs Final Mile below.
All responses are HTTP 200. Check the status field in the response body for Success or Error. Error details appear in the errors array.
Function Overview
- Purpose: Create a new shipment and return a system load number and GUID.
- REST Endpoint:
POST /api/public/v2/shipping/CreateShipment - SOAP Operation:
CreateShipment(CreateShipmentRequest) - Authentication: Required -- Bearer token in HTTP Authorization header
TLS and Certificate Requirements
All requests are made over HTTPS. Your client must trust the certificate chain presented by the server, and the trust must be visible to the account the calling process actually runs under.
This matters because a certificate-trust failure happens during the TLS handshake, before your request reaches the service. When that occurs there is no HTTP status code, no response body, and nothing recorded in the request log -- so the symptom is easy to mistake for an authentication problem even though the token was never transmitted.
Two points worth checking when a service or daemon fails but an interactive test of the same code succeeds:
- A certificate installed only in a specific user's trust store is not visible to a process running as a service account. Install into the machine-level trusted root store when the caller is a Windows service, scheduled task, or container.
- Trust decisions are commonly cached for the lifetime of the process, and a long-lived HTTP client holds its connections open. Restart the calling process after changing certificate trust.
Shipment Types: Standard vs Final Mile
The recordLayout field selects how CreateShipment behaves.
| recordLayout | Type | Shipper block | Carrier registration |
|---|---|---|---|
| 0 | Contract / Tariff | Required | None |
| 1 | Spot Quote | Required | None |
| 2 | Fee Based | Required | None |
| 3 | Final Mile | Omit -- carrier assigns terminal | Yes -- last-mile carrier |
Standard shipments (recordLayout 0-2)
Provide both a shipper (origin) and a consignee (destination) block. The shipment is created and saved; no carrier API call is made. This is the default when recordLayout is omitted.
recordLayout 0, 1, or 2 a request with no shipper block returns status: "Error" and is not saved. Earlier releases accepted such a request and saved the shipment with empty shipper values, so an integration that relied on omitting the block must be updated to supply it. All address blocks are validated identically -- required values plus maximum field lengths -- and the response lists every problem found in one pass.
Final Mile shipments (recordLayout 3)
When recordLayout is 3 and a last-mile carrier code (provided by DM) is supplied, CreateShipment saves the shipment and then registers it with the last-mile carrier in the same call -- the equivalent of calling BookLastMile immediately after creation. On success the carrier's terminal is written into the shipper fields and the carrier PRO number is returned in carrierProNumber.
Do not send a shipper block for Final Mile. The last-mile carrier assigns the origin terminal, and the service overwrites the shipper fields with that terminal address.
ASN is required for Final Mile. All three of the following entries must be present on the request, or carrier registration is skipped:
| Where | Type name (exact) | Meaning |
|---|---|---|
dates[] | Expected at Terminal | Date the freight is expected to arrive at the terminal |
references[] | 1st Leg - Carrier Name | Carrier that moves the first leg to the terminal |
references[] | 1st Leg - CarrierPro | First-leg carrier's PRO / BOL number |
The service level must also have a last-mile carrier mapping configured (provided by DM). An unmapped service level causes registration to be skipped.
status: "Success" with the dmLoadNumber, but carrierProNumber is null and a warning describing the problem appears in the errors array. You can complete the booking afterward with BookLastMile once the data is corrected.
REST Interface
Headers
Authorization: Bearer <token>
Content-Type: application/json
Minimal Request (standard shipment)
{
"clientReferenceCode": "YOUR-CLIENT-CODE",
"carrierReferenceCode": "CARRIER-CODE",
"serviceLevelCode": "OHN",
"recordLayout": 0,
"consignee": {
"name": "John Smith",
"address1": "123 Main Street",
"city": "Austin",
"state": "TX",
"zip": "78701",
"phone": "5125551234"
},
"lineItems": [
{
"pieces": 1,
"weight": 65,
"length": 24,
"width": 12,
"height": 10,
"description": "Furniture piece"
}
]
}
Request Field Reference
| Field | Type | Required | Description |
|---|---|---|---|
| Identity | |||
| clientReferenceCode | string | Yes | Your client code (provided by DM) |
| branchReferenceCode | string | No | Branch code; defaults to client default branch |
| carrierReferenceCode | string | Yes | Carrier code (provided by DM) |
| serviceLevelCode | string | Yes | Service level code (provided by DM) |
| Shipment Header | |||
| recordLayout | short | No | 0=Contract/Tariff, 1=Spot Quote, 2=Fee Based, 3=Final Mile. Defaults to 0. |
| type | short | No | 0=Inbound, 1=Outbound, 2=Third Party. Defaults to 1. |
| salesOrderReference | string | No | Your sales order number |
| billOfLading | string | No | Bill of lading number |
| carrierProNumber | string | No | Pre-assigned carrier PRO number if known |
| hawb | string | No | House Air Waybill number |
| vendorID | string | No | Vendor identifier |
| requiredPickup | datetime | No | Earliest pickup date (ISO 8601) |
| expectedPickup | datetime | No | Expected pickup date (ISO 8601) |
| expectedDelivery | datetime | No | Expected delivery date (ISO 8601) |
| nonBillable | bool | No | Exclude from invoicing. Default false. |
| loadingRequirements | string | No | Special loading instructions |
| deliveryRequirements | string | No | Special delivery instructions |
| Consignee (required) | |||
| consignee.name | string | Yes | Company or individual name |
| consignee.address1 | string | Yes | Street address |
| consignee.city | string | Yes | City |
| consignee.state | string | Yes | Two-letter state/province code |
| consignee.zip | string | Yes | Postal/ZIP code |
| consignee.phone | string | Yes | Primary phone number |
| consignee.address2 / email / firstName / lastName | string | No | Additional contact details |
| Shipper (non-FinalMile only) | |||
| shipper.* | AddressBlock | Conditional | Same fields as consignee. Required when recordLayout is 0, 1, or 2. Omit for recordLayout=3. |
| Line Items (at least one required) | |||
| lineItems[].pieces | int | Yes | Number of units |
| lineItems[].weight | int | Yes | Weight in lbs |
| lineItems[].length / width / height | decimal | No | Dimensions in inches |
| lineItems[].description | string | No | Product description |
| lineItems[].sku | string | No | Product SKU |
| References, Dates, Accessorials (all optional) | |||
| references[].referenceType | string | No | Reference type name (provided by DM) |
| references[].data | string | No | Reference value |
| dates[].dateType | string | No | Date type name (provided by DM) |
| dates[].dateValue | datetime | No | ISO 8601 date value |
| accessorials[].accessorialType | string | No | Accessorial type name (provided by DM) |
| accessorials[].locationType | int | No | 0 = Pickup, 1 = Delivery |
Final Mile Request (recordLayout 3)
No shipper block. Includes the required ASN date and two references. Use your last-mile carrier code for carrierReferenceCode.
{
"clientReferenceCode": "YOUR-CLIENT-CODE",
"carrierReferenceCode": "CARRIER-CODE",
"serviceLevelCode": "OHN",
"recordLayout": 3,
"consignee": {
"name": "John Smith",
"address1": "123 Main Street",
"city": "Austin",
"state": "TX",
"zip": "78701",
"phone": "5125551234"
},
"lineItems": [
{
"pieces": 1,
"weight": 65,
"length": 24,
"width": 12,
"height": 10,
"description": "Furniture piece"
}
],
"dates": [
{ "dateType": "Expected at Terminal", "dateValue": "2026-04-20T00:00:00Z" }
],
"references": [
{ "referenceType": "1st Leg - Carrier Name", "data": "Acme LTL Freight" },
{ "referenceType": "1st Leg - CarrierPro", "data": "BOL-987654" }
]
}
Response
{
"status": "Success",
"dmLoadNumber": 4363968,
"shipmentGUID": "ae7e3813-198b-4c62-a203-5e7206dfca01",
"carrierProNumber": null,
"errors": []
}
Response Fields
| Field | Description |
|---|---|
| status | "Success" or "Error" |
| dmLoadNumber | System-assigned DM Load Number. Present on success. |
| shipmentGUID | Unique GUID for the shipment record. |
| carrierProNumber | Carrier-assigned tracking number, when applicable. |
| errors | Array of error messages when status is "Error". |
Status Codes
- 200 OK -- always returned; check
statusfield for outcome - 401 Unauthorized -- invalid or missing token
SOAP Interface
WSDL
request are in
http://dmwebservices.com/shipping/public/v2/operations while everything
inside request is in http://dmwebservices.com/shipping/public/v2,
which is why the samples prefix the outer two and set a default namespace on
request. ELEMENT ORDER MATTERS: the samples follow the WSDL sequence
(RecordLayout before ServiceLevelCode, Shipper
before Consignee, References before Dates); an
out-of-order element is silently ignored. V2 also carries additional optional members;
the V2 WSDL is authoritative.
Live V2 WSDL -- /soap/public/v2/shipping?wsdl
Prefer one self-contained document? Use ?singleWsdl, which inlines every schema rather than referencing them.
Authorization: Bearer <token>
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:op="http://dmwebservices.com/shipping/public/v2/operations">
<soapenv:Header/>
<soapenv:Body>
<op:CreateShipment>
<op:request xmlns="http://dmwebservices.com/shipping/public/v2">
<ClientReferenceCode>YOUR-CLIENT-CODE</ClientReferenceCode>
<CarrierReferenceCode>CARRIER-CODE</CarrierReferenceCode>
<RecordLayout>0</RecordLayout>
<ServiceLevelCode>OHN</ServiceLevelCode>
<Consignee>
<Name>John Smith</Name>
<Address1>123 Main Street</Address1>
<City>Austin</City>
<State>TX</State>
<Zip>78701</Zip>
<Phone>5125551234</Phone>
</Consignee>
<LineItems>
<LineItem>
<Pieces>1</Pieces>
<Weight>65</Weight>
<Length>24</Length>
<Width>12</Width>
<Height>10</Height>
<Description>Furniture piece</Description>
</LineItem>
</LineItems>
</op:request>
</op:CreateShipment>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<CreateShipmentResponse xmlns="http://dmwebservices.com/shipping/public/v2/operations">
<result xmlns:a="http://dmwebservices.com/shipping/public/v2">
<a:Status>Success</a:Status>
<a:DMLoadNumber>4363968</a:DMLoadNumber>
<a:ShipmentGUID>ae7e3813-198b-4c62-a203-5e7206dfca01</a:ShipmentGUID>
<a:CarrierProNumber i:nil="true" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/>
<a:Errors/>
<a:CarrierName>Carrier Name</a:CarrierName>
<a:CarrierReferenceCode>CARRIER-CODE</a:CarrierReferenceCode>
<a:ServiceLevel>OHN</a:ServiceLevel>
</result>
</CreateShipmentResponse>
</s:Body>
</s:Envelope>
SOAP Request (Final Mile)
Omit the Shipper element; include the ASN date and references.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:op="http://dmwebservices.com/shipping/public/v2/operations">
<soapenv:Header/>
<soapenv:Body>
<op:CreateShipment>
<op:request xmlns="http://dmwebservices.com/shipping/public/v2">
<ClientReferenceCode>YOUR-CLIENT-CODE</ClientReferenceCode>
<CarrierReferenceCode>CARRIER-CODE</CarrierReferenceCode>
<RecordLayout>3</RecordLayout>
<ServiceLevelCode>OHN</ServiceLevelCode>
<Consignee>
<Name>John Smith</Name>
<Address1>123 Main Street</Address1>
<City>Austin</City>
<State>TX</State>
<Zip>78701</Zip>
<Phone>5125551234</Phone>
</Consignee>
<LineItems>
<LineItem>
<Pieces>1</Pieces>
<Weight>65</Weight>
<Length>24</Length>
<Width>12</Width>
<Height>10</Height>
<Description>Furniture piece</Description>
</LineItem>
</LineItems>
<References>
<ShipmentReference>
<ReferenceType>1st Leg - Carrier Name</ReferenceType>
<Data>Acme LTL Freight</Data>
</ShipmentReference>
<ShipmentReference>
<ReferenceType>1st Leg - CarrierPro</ReferenceType>
<Data>BOL-987654</Data>
</ShipmentReference>
</References>
<Dates>
<ShipmentDate>
<DateType>Expected at Terminal</DateType>
<DateValue>2026-04-20T00:00:00Z</DateValue>
</ShipmentDate>
</Dates>
</op:request>
</op:CreateShipment>
</soapenv:Body>
</soapenv:Envelope>