API Documentation

Everything you need to integrate the NuxPrint API into your application.

Quick Start

1. Create an account and get your API Key.

2. Install the NuxPrint Agent on a computer and sign in.

3. Printers are automatically registered with the API.

4. Send print requests using your API Key.

Authentication

All API requests require the X-API-Key header or Authorization: Bearer <jwt>.

curl https://nuxprint.com/api/auth/me -H "X-API-Key: pk_your_api_key_here"

Response

{
  "customer": {
    "id": "69fd0574c975...",
    "email": "user@example.com",
    "name": "John Doe",
    "apiKey": "pk_ed6e857fa921..."
  }
}

Endpoints

Devices

GET/api/devicesList all devices
GET/api/devices/:idDevice detail + printers
// GET /api/devices
{
  "devices": [
    {
      "_id": "69fd0673...",
      "deviceId": "ba58920a-0375-...",
      "deviceName": "DESKTOP-ABC123",
      "platform": "windows",
      "isOnline": true,
      "lastSeenAt": "2025-05-09T10:00:00Z"
    }
  ]
}

Printers

GET/api/printersList all printers
GET/api/printers/:idPrinter detail
// GET /api/printers
{
  "printers": [
    {
      "_id": "69fd0673...",
      "externalId": "847291",
      "name": "Xprinter XP-DT325B",
      "printerModel": "Generic / Text Only",
      "status": "online",
      "connectionType": "USB",
      "isActive": true,
      "deviceId": "69fd0673...",
      "device": {
        "_id": "69fd0673...",
        "deviceName": "DESKTOP-ABC123",
        "isOnline": true,
        "platform": "windows"
      }
    }
  ]
}

Print Jobs

POST/api/print-jobsCreate print job
GET/api/print-jobsList jobs (filtered)
GET/api/print-jobs/:idJob detail
POST/api/print-jobs/:id/retryRetry failed job

Print Example

First get the externalId from the /api/printers endpoint, then send the following request:

Request — PDF

curl -X POST https://nuxprint.com/api/print-jobs \
  -H "X-API-Key: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "printerId": "847291",
    "documentName": "invoice.pdf",
    "documentType": "pdf",
    "documentData": "JVBERi0xLjQK...",
    "copies": 1
  }'

documentData — the base64-encoded content of the document (PDF bytes, ZPL text, ESC-POS bytes).

documentType — optional, defaults to pdf. Supported: pdf, zpl, epl, escpos, raw. Non-PDF types are sent straight to the Windows spooler (raw) on the agent — for label (Zebra/TSC) and receipt (Epson TM) printers.

Print options

options — an optional object with per-job print settings. Every field is optional; omit the object to keep the defaults.

curl -X POST https://nuxprint.com/api/print-jobs \
  -H "X-API-Key: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "printerId": "847291",
    "documentName": "invoice.pdf",
    "documentType": "pdf",
    "documentData": "JVBERi0xLjQK...",
    "copies": 2,
    "options": {
      "duplex": "long-edge",
      "paperSize": "A4",
      "tray": "Tray 2",
      "color": false,
      "orientation": "portrait",
      "fitToPage": true,
      "pages": "1-3"
    }
  }'
duplex2-sided printing: "one-sided", "long-edge" (portrait duplex) or "short-edge" (landscape duplex).
paperSizePaper size, e.g. "A4", "A5", "Letter", "Legal".
trayInput tray / bin name or number, e.g. "Tray 2".
colorBoolean. false forces grayscale/monochrome; true prints in color.
orientation"portrait" or "landscape". When omitted, orientation is auto-detected from the document.
fitToPageBoolean, default true. Scales the document to fit the sheet; false prints at actual size.
pagesPage range, e.g. "1,3-5". Applies to PDF documents.

Options apply to PDF jobs. Raw/ZPL/EPL/ESC-POS jobs carry their settings inside the document itself, so options are ignored for them.

Request — ZPL (Zebra label)

curl -X POST https://nuxprint.com/api/print-jobs \
  -H "X-API-Key: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "printerId": "847291",
    "documentName": "label-12345.zpl",
    "documentType": "zpl",
    "documentData": "XlhBXkZPNTAsNTBeQTBOLDQwLDQwXkZETnV4cHJpbnQgVGVzdF5GU15YWg==",
    "copies": 1
  }'

Request — ESC-POS (Epson receipt)

curl -X POST https://nuxprint.com/api/print-jobs \
  -H "X-API-Key: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "printerId": "847291",
    "documentName": "receipt.bin",
    "documentType": "escpos",
    "documentData": "G0BIZWxsbywgTnV4cHJpbnQhCgoKHVYA",
    "copies": 1
  }'

Response

{
  "printJob": {
    "id": "69fd5726b3cc...",
    "status": "queued",
    "documentType": "pdf",
    "documentName": "invoice.pdf",
    "copies": 1,
    "createdAt": "2025-05-09T10:30:00Z"
  }
}

Get Job Status

// GET /api/print-jobs/69fd5726b3cc...
{
  "printJob": {
    "_id": "69fd5726b3cc...",
    "status": "done",
    "documentName": "invoice.pdf",
    "documentSize": 24576,
    "copies": 1,
    "errorMessage": null,
    "retryCount": 0,
    "printerId": {
      "_id": "69fd0673...",
      "name": "Xprinter XP-DT325B",
      "status": "online",
      "externalId": "847291"
    },
    "deviceId": {
      "_id": "69fd0673...",
      "deviceName": "DESKTOP-ABC123",
      "isOnline": true
    },
    "createdAt": "2025-05-09T10:30:00Z",
    "completedAt": "2025-05-09T10:30:03Z"
  }
}

Job Statuses

pendingRequest received, not yet queued
queuedAdded to queue, waiting
processingBeing sent to printer
donePrint successful
failedPrint failed (can be retried)