DM Web Services Documentation

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.

Symptoms of a trust failure rather than an auth failure: the error surfaces as an SSL/TLS or secure-channel exception in your HTTP client rather than a 401; no 401 body is returned; and repeated attempts produce no entry on the DM side. A genuine authentication failure always returns HTTP 401 with a specific message in the body.

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.

recordLayoutTypeShipper blockCarrier registration
0Contract / TariffRequiredNone
1Spot QuoteRequiredNone
2Fee BasedRequiredNone
3Final MileOmit -- carrier assigns terminalYes -- 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.

The shipper block is required and is now enforced. For 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:

WhereType name (exact)Meaning
dates[]Expected at TerminalDate the freight is expected to arrive at the terminal
references[]1st Leg - Carrier NameCarrier that moves the first leg to the terminal
references[]1st Leg - CarrierProFirst-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.

If registration cannot complete (missing ASN, unmapped service level, or a carrier API error), the shipment is still created and saved. The response returns 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

FieldTypeRequiredDescription
Identity
clientReferenceCodestringYesYour client code (provided by DM)
branchReferenceCodestringNoBranch code; defaults to client default branch
carrierReferenceCodestringYesCarrier code (provided by DM)
serviceLevelCodestringYesService level code (provided by DM)
Shipment Header
recordLayoutshortNo0=Contract/Tariff, 1=Spot Quote, 2=Fee Based, 3=Final Mile. Defaults to 0.
typeshortNo0=Inbound, 1=Outbound, 2=Third Party. Defaults to 1.
salesOrderReferencestringNoYour sales order number
billOfLadingstringNoBill of lading number
carrierProNumberstringNoPre-assigned carrier PRO number if known
hawbstringNoHouse Air Waybill number
vendorIDstringNoVendor identifier
requiredPickupdatetimeNoEarliest pickup date (ISO 8601)
expectedPickupdatetimeNoExpected pickup date (ISO 8601)
expectedDeliverydatetimeNoExpected delivery date (ISO 8601)
nonBillableboolNoExclude from invoicing. Default false.
loadingRequirementsstringNoSpecial loading instructions
deliveryRequirementsstringNoSpecial delivery instructions
Consignee (required)
consignee.namestringYesCompany or individual name
consignee.address1stringYesStreet address
consignee.citystringYesCity
consignee.statestringYesTwo-letter state/province code
consignee.zipstringYesPostal/ZIP code
consignee.phonestringYesPrimary phone number
consignee.address2 / email / firstName / lastNamestringNoAdditional contact details
Shipper (non-FinalMile only)
shipper.*AddressBlockConditionalSame fields as consignee. Required when recordLayout is 0, 1, or 2. Omit for recordLayout=3.
Line Items (at least one required)
lineItems[].piecesintYesNumber of units
lineItems[].weightintYesWeight in lbs
lineItems[].length / width / heightdecimalNoDimensions in inches
lineItems[].descriptionstringNoProduct description
lineItems[].skustringNoProduct SKU
References, Dates, Accessorials (all optional)
references[].referenceTypestringNoReference type name (provided by DM)
references[].datastringNoReference value
dates[].dateTypestringNoDate type name (provided by DM)
dates[].dateValuedatetimeNoISO 8601 date value
accessorials[].accessorialTypestringNoAccessorial type name (provided by DM)
accessorials[].locationTypeintNo0 = 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

FieldDescription
status"Success" or "Error"
dmLoadNumberSystem-assigned DM Load Number. Present on success.
shipmentGUIDUnique GUID for the shipment record.
carrierProNumberCarrier-assigned tracking number, when applicable.
errorsArray of error messages when status is "Error".

Status Codes

  • 200 OK -- always returned; check status field for outcome
  • 401 Unauthorized -- invalid or missing token

SOAP Interface

WSDL

CALL V2 FOR THIS FUNCTION. The endpoint above, the WSDL below and the SOAP samples further down this page are all V2. V2 splits the namespaces: the operation element and 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.

Authentication note: Pass your Bearer token as an HTTP header on the request, not inside the SOAP envelope.
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>

Integration Samples


Related Resources