Document Service — User Guide
The Document Service lets you store, retrieve, and manage files associated with your shipments. Use it to attach documents like Bills of Lading, Shipping Labels, and Proof of Delivery records to a shipment, then retrieve them individually or as a single combined PDF.
What Can I Do With the Document Service?
- Upload a document — attach a file (PDF, TIFF, Excel, etc.) to a shipment record.
- Retrieve documents — get a list of documents associated with a shipment, invoice, or date range.
- Download a file — retrieve the raw file bytes for a specific document version.
- Get a merged PDF — retrieve all documents for a shipment combined into a single PDF, ready to print or archive.
- Update a document — upload a new version of a document and update its metadata.
- Delete a document — mark a document or a specific version as deleted (it is not permanently removed).
How Do I Find Documents for a Shipment?
Most retrieval operations accept the same request format. You tell the service how you want to identify the shipment, and it searches using the first match it finds in this order:
-
DM Load Number — the most direct identifier. If you have it, use it.
Example:DMLoadNumber: "4363968" -
Invoice Number — finds all documents linked to a specific invoice.
Example:InvoiceNumber: "INV-20260101" -
Date Range + Client Reference — finds documents for all shipments within a date window for your account.
All three fields are required together:
InvoiceFromDate,InvoiceToDate, andClientReference. - Document ID — a specific GUID identifying a single document. Useful when you already have the ID from a previous upload or lookup.
If none of these fields are provided, the service will return an error.
Getting a Merged PDF
The most common use case is downloading all documents for a shipment as a single PDF. You can request this in a few different ways:
| How to Request | Example URL |
|---|---|
| By DM Load Number (simple GET) | /api/public/v1/documents/get-all-documents/dmload/4363968 |
| By Invoice Number (simple GET) | /api/public/v1/documents/get-all-documents/invoice/INV-20260101 |
| By any supported search field (POST) | POST /api/public/v1/documents/get-all-documents with a JSON body |
The service automatically converts non-PDF files (such as images and spreadsheets) to PDF before merging. Documents are arranged in a standard order — Bill of Lading first, then Shipping Label, Manifest, Weight and Measure, Proof of Delivery, Invoice, and then any remaining documents. In the rare case a file cannot be converted to PDF, a placeholder page is inserted in its place. The original file remains safely stored and can still be downloaded individually using get-original-document.
Each page in the merged PDF is stamped with the DM Load number it belongs to, which helps when a merged PDF spans multiple loads (for example, when you search by invoice).
Uploading a Document
To upload a document, you send the file and some identifying information together in a single request. The service links the file to the parent entity you specify — a shipment, carrier, client, claim, or other record.
What you need to provide:
- The file itself — any document or image file you would normally work with
- Parent entity — either a
parentGuid(works for any entity type) or admLoadNumber(shipments only, resolved internally) - Document name — a label for the document as it appears in the system
- Category type — what kind of document it is (loaded from the system via the
/categoriesendpoint) - Subject and Description — optional; the service generates these automatically if you don't provide them
What you get back:
On success, the service returns a Document ID (a unique identifier for the new document). Keep this ID if you plan to update or reference the document later.
Updating a Document
If a document needs to be corrected or replaced, use the update endpoint. You must provide:
- The new file (a replacement file is always required — updating always creates a new version)
- The Document ID of the existing document (returned when you originally uploaded it)
- The category type
The original document and its history are preserved. Updating creates a new version rather than overwriting the previous one.
Deleting a Document
Documents can be deleted at two levels:
- Delete a specific version — removes one version while keeping the document record and other versions.
- Delete an entire document — marks all versions of the document as deleted.
Deletions are soft-deletes — the data is marked as deleted and hidden from results, but is not permanently removed from the database.
Authentication
All document endpoints (except Ping, Health, and Version) require a Bearer token in the
Authorization header of every request:
Authorization: Bearer <your-token>
Your token is issued by the DM Web Services team. If you do not have a token, contact your DM integration coordinator. See the Authentication Guide for details.
Common Questions
What file types can I upload?
The service accepts any file you can upload — documents, images, spreadsheets, and so on. The file is stored exactly as you provide it.
What happens if I search and there are no documents?
The service returns an empty result list. It does not return an error simply because no documents were found.
What is the difference between get-original-document and get-all-documents?
get-original-document— returns the raw original file, exactly as it was uploaded, with no modifications. Use this when you need the original.get-all-documents— combines all matching documents into a single PDF, converting non-PDF files along the way. Use this when you need a single printable package.
Why does the merged PDF have a label on each page?
Each page is stamped with the DM Load Number it belongs to. This makes it easy to identify which shipment each page came from when multiple loads are merged together (for example, when you retrieve all documents for an invoice that covers several shipments).
I deleted a document by mistake. Can it be recovered?
Deletes are soft — the data is still in the database. Contact the DM Web Services team to request recovery.