DataShift
FreightAPI Reference

Printing | Freight API

Freight API reference for printing: fetch con-notes and labels for a booked shipment in the format your printer needs.

List print devices

GET
/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. 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.

Authorization

FreightApiKey
headerAuthorizationBearer <dsfrt_<64-hex-chars>>

API key issued from Settings → Freight → API Keys. The raw key is shown once at creation.

Response Body

Active print devices for this tenant

application/json
  1. response
devices*array<>
Example Request
curl -X GET 'https://datashift.com.au/api/freight/print-devices'
Example Response
{  "devices": [    {      "id": "dev_abc123",      "label": "Warehouse A",      "printerName": "Zebra ZT411",      "lastUsedAt": "2026-06-25T06:00:00.000Z",      "createdAt": "2026-01-10T00:00:00.000Z",      "printers": [        {          "id": "prn_abc123",          "name": "Zebra ZT411",          "isPreferred": true,          "isOnline": true,          "lastSeenAt": "2026-09-08T00:00:00.000Z"        },        {          "id": "prn_def456",          "name": "HP LaserJet Office",          "isPreferred": false,          "isOnline": true,          "lastSeenAt": "2026-09-08T00:00:00.000Z"        }      ]    },    {      "id": "dev_def456",      "label": "Dispatch Desk",      "printerName": null,      "lastUsedAt": null,      "createdAt": "2026-03-01T00:00:00.000Z",      "printers": []    }  ]}
POST
/shipments/{id}/print

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.

Authorization

FreightApiKey
headerAuthorizationBearer <dsfrt_<64-hex-chars>>

API key issued from Settings → Freight → API Keys. The raw key is shown once at creation.

Path Parameters

id*string

Datashift shipment ID (from booking response or GET /shipments)

Request Body

application/json
  1. body
deviceId*string

ID of the print device to send the label to (from GET /print-devices)

printerId?string

Optional id of a specific printer on the target device; defaults to the device's preferred printer when omitted.

Response Body

Print job queued successfully

application/json
  1. response
jobId*string

Datashift print job ID

Example Request
curl -X POST 'https://datashift.com.au/api/freight/shipments/string/print' \  -H 'Content-Type: application/json' \  -d '{  "deviceId": "dev_abc123",  "printerId": "prn_def456"}'
Example Response
{  "jobId": "pj_xyz789"}