DataShift Logo

Printing

get/print-deviceslistPrintDevices

List print devices

Returns active (non-revoked) Datashift print devices registered for the tenant, each with its full list of reported printers. Use the `id` of the desired device as `deviceId` when calling `POST /shipments/{id}/print`. Optionally use one of that device's `printers[].id` as `printerId` to override which physical printer on the device receives the label — omit it to use the device's preferred printer (`isPreferred: true`). Devices are registered from the Datashift portal (Settings → Freight → Print Devices). Each device runs the Datashift label client software and listens for print jobs over Pub/Sub. Revoked devices are excluded from this list. A device that hasn't reported its printer list yet (older label-client versions) has an empty `printers` array.

Responses

200Active print devices for this tenant
PrintDeviceListResponse
401Missing or invalid API key
Error
403Freight access is not active for this tenant, or the API key lacks the scope this endpoint requires
Error
429Too many requests for this API key — see Retry-After header
Error
post/shipments/{id}/printprintShipmentLabel

Print shipment label

Fetches the shipment label from the carrier and queues a print job to the specified device. **Prerequisites:** - Direct print must be enabled for the tenant in Settings → Freight. - The target device must be registered, active, and running the Datashift label client. **Typical flow:** Call `GET /print-devices` once during setup, store each device's `id` (and, if you need per-job printer overrides, its relevant `printers[].id`) in your WMS/ERP config keyed by workstation, then pass the relevant IDs in this request after booking. **Handling `DEVICE_NOT_FOUND`:** If the response is 404 with `code: DEVICE_NOT_FOUND`, the stored device ID is stale (device was revoked or replaced). Re-fetch `GET /print-devices`, overwrite your stored device list, and prompt the user to select a device before retrying. **Handling `LABEL_NOT_AVAILABLE`:** The label is not yet ready from the carrier — poll `GET /shipments/{id}/label` with exponential backoff and retry once available.

Parameters

NameInRequiredDescription
idpath✓Datashift shipment ID (from booking response or `GET /shipments`)

Request body

PrintRequest

Responses

201Print job queued successfully
PrintJobCreated
400Validation failed — missing deviceId, or printerId does not belong to the specified device
Error
401Missing or invalid API key
Error
403Freight access not active, or direct print not enabled for this tenant
Error
404Shipment or device not found, or label not yet available
PrintNotFoundError
409Shipment has been cancelled in DataShift — no label is queued for print for a cancelled shipment.
Error
429Too many requests for this API key — see Retry-After header
Error