Getting Started
This guide walks through your first integration with DM Web Services, from receiving your credentials to creating your first shipment. All examples show both the REST and SOAP interfaces.
API Versioning
All DM Web Services endpoints are versioned. The version appears in the URL path:
/api/public/v2/shipping/CreateShipment -- REST V2
/api/public/v1/shipping/BookLastMile -- REST V1
/soap/public/v2/shipping?wsdl -- SOAP V2 WSDL
/soap/public/v1/shipping?wsdl -- SOAP V1 WSDL
VERSIONS ARE PER FUNCTION, NOT PER SERVICE. A version carries only the functions whose request or response contract actually changed. Everything else stays on the version it was last changed in, because publishing an identical copy under a new number would give you nothing to migrate to and us two contracts to maintain.
So a normal integration calls more than one version, and that is correct rather
than a transitional state. Today, on shipping: CreateShipment and
CreateMultipleStopShipment are V2; every other shipping function is
V1. Rating, Reports and Documents are V1 throughout.
Authentication, error handling and the Status/Errors response shape are identical on both versions, so mixing them costs you no extra handling.
Each function's own documentation page states the version to call. If a function is not listed as V2, there is no V2 of it.
Step 1 -- Obtain Your Credentials
Contact your DM Web Services administrator to receive:
- Your Bearer token -- a custom signed token issued by DM
- Your Client Reference Code -- identifies your account on all shipment calls
- Your Carrier Reference Code(s) -- one or more carrier codes you are authorized to use
- Your Service Level Code(s) -- the service levels available under each carrier
Tokens are provisioned and managed by DM. They cannot be self-generated. See the Authentication Guide for format details.
Step 2 -- Verify Connectivity
Ping does not require authentication. Use it to confirm the service is reachable before making authenticated calls.
REST -- Ping
curl -X GET {BASE_URL}/api/public/v1/shipping/ping
Expected Response
"Pong"
SOAP -- Ping
No Authorization header required.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<Ping xmlns="http://dmwebservices.com/shipping/public/v1"/>
</soapenv:Body>
</soapenv:Envelope>
Expected Response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<PingResponse xmlns="http://dmwebservices.com/shipping/public/v1">
<result>Pong</result>
</PingResponse>
</s:Body>
</s:Envelope>
Step 3 -- Create Your First Shipment
Replace the placeholder values with your actual credentials and consignee details.
REST -- CreateShipment
Include your token in the Authorization header on every authenticated call.
curl -X POST {BASE_URL}/api/public/v1/shipping/CreateShipment \
-H "Authorization: Bearer {YOUR_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"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"
},
"shipper": {
"name": "Acme Warehouse",
"address1": "456 Industrial Blvd",
"city": "Dallas",
"state": "TX",
"zip": "75201",
"phone": "2145559876"
},
"lineItems": [
{
"pieces": 1,
"weight": 65,
"length": 24,
"width": 12,
"height": 10,
"description": "Furniture piece"
}
]
}'
SOAP -- CreateShipment
Pass your token as an HTTP header on the request, not inside the SOAP envelope.
<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>
<Shipper>
<Name>Acme Warehouse</Name>
<Address1>456 Industrial Blvd</Address1>
<City>Dallas</City>
<State>TX</State>
<Zip>75201</Zip>
<Phone>2145559876</Phone>
</Shipper>
<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>
Step 4 -- Read the Response
All shipping operations return HTTP 200. The outcome is in the status field of the response body.
REST -- Success
{
"status": "Success",
"dmLoadNumber": 4363968,
"shipmentGUID": "ae7e3813-198b-4c62-a203-5e7206dfca01",
"carrierProNumber": null,
"errors": []
}
Save the dmLoadNumber -- you will need it for BookLastMile and shipment update operation calls.
REST -- Validation Error
{
"status": "Error",
"dmLoadNumber": 0,
"shipmentGUID": null,
"carrierProNumber": null,
"errors": [
"ClientReferenceCode is required.",
"Consignee address is required."
]
}
SOAP -- Success
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<CreateShipmentResponse xmlns="http://dmwebservices.com/shipping/public/v1">
<result>
<Status>Success</Status>
<DMLoadNumber>4363968</DMLoadNumber>
<ShipmentGUID>ae7e3813-198b-4c62-a203-5e7206dfca01</ShipmentGUID>
<CarrierProNumber i:nil="true" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/>
<Errors/>
</result>
</CreateShipmentResponse>
</s:Body>
</s:Envelope>
Step 5 -- Next Steps
- BookLastMile -- register a shipment with the last-mile carrier
- Shipment Update Operations -- modify addresses, dates, references, carrier PRO, and line items before pickup
- Authentication Guide -- token format, 401 responses, and troubleshooting
- Error Handling -- understanding status codes and error arrays
- Download integration samples -- JSON, XML, curl, and OpenAPI files per function