1. Cloud Printing
  2. Print Stations

Cloud Printing

Print Stations

Print stations represent computers or devices running the PackageX Print Station application. Each station can manage multiple physical printers and receive print jobs via push notifications.

Endpoints

Method Endpoint Description
GET /v1/cloud-printing/stations List all print stations
POST /v1/cloud-printing/stations Create a new print station
GET /v1/cloud-printing/stations/:station_id Retrieve a print station
POST /v1/cloud-printing/stations/:station_id Update a print station

Required Scopes

  • print_stations:read - For listing and retrieving stations
  • print_stations:write - For creating and updating stations

Create Print Station

        POST /v1/cloud-printing/stations

      

Creates a new print station with one or more printers.

Request Body

        {
  "name": "Station-001",
  "display_name": "Front Desk Printer",
  "location_id": "loc_abc123",
  "device_token": "pushy_device_token_here",
  "status": "online",
  "allow_all_users": true,
  "configuration": {
    "pooling_enabled": false
  },
  "printers": [
    {
      "name": "HP LaserJet Pro",
      "model": "HP LaserJet Pro M404dn",
      "status": "online",
      "configuration": {
        "dpi": "600",
        "speed": "40",
        "color_print": false,
        "double_sided": true,
        "spooling": true,
        "port": 9100,
        "priority": 1,
        "type": "laser"
      },
      "page_size": {
        "letter": true,
        "legal": true,
        "a4": true
      }
    }
  ]
}

      

Parameters

Parameter Type Required Description
name string Unique station name (max 191 chars)
display_name string Display name (max 191 chars)
location_id string Location where station is installed
device_token string Pushy device token for push notifications
status string online (default) or offline
allow_all_users boolean Allow all location users (default: true)
configuration object Station configuration
printers array Array of printer objects

Printer Parameters

Parameter Type Required Description
name string Unique printer name within station
model string Printer model name
configuration object Printer configuration
page_size object Supported paper sizes
status string online, offline, busy, error

Response

        {
  "data": {
    "object": "print_station",
    "id": "prnt_stn_abc123",
    "name": "Station-001",
    "display_name": "Front Desk Printer",
    "location_id": "loc_abc123",
    "status": "online",
    "printers": [...],
    "created_at": "2024-01-15T10:30:00.000Z",
    "updated_at": "2024-01-15T10:30:00.000Z"
  },
  "status": 201,
  "message": "Print station created"
}

      

Update Print Station

        POST /v1/cloud-printing/stations/:station_id

      

Updates an existing print station. All fields are optional.

Request Body

        {
  "display_name": "Updated Display Name",
  "status": "offline",
  "device_token": "new_pushy_token",
  "printers": [...]
}

      

Important: When updating printers, provide the complete list. Printers not included in the request will be soft-deleted, and any queued jobs for those printers will be aborted.

Managing Allowed Users

You can control which users have access to the station:

        // Add users to allowed list
{
  "allow_all_users": false,
  "allowed_users": {
    "add": ["prf_user1", "prf_user2"]
  }
}

// Remove users from allowed list
{
  "allowed_users": {
    "remove": ["prf_user1"]
  }
}

// Replace entire allowed list
{
  "allowed_users": {
    "set": ["prf_user3", "prf_user4"]
  }
}

// Allow all users (clears allowed list)
{
  "allow_all_users": true
}

      

List Print Stations

        GET /v1/cloud-printing/stations

      

Returns a paginated list of print stations.

Query Parameters

Parameter Type Description
page integer Page number (default: 1)
limit integer Results per page (default: 20, max: 100)
order_by string Sort field: created_at, updated_at, name
direction string Sort direction: asc, desc
location_id string Filter by location ID
status string Filter by status: online, offline
include_print_jobs_count boolean Include count of print jobs
created_at[gte] string Filter by creation date (greater than or equal)
created_at[lte] string Filter by creation date (less than or equal)
updated_at[gte] string Filter by update date
updated_at[lte] string Filter by update date

Example Request

        curl -H "PX-API-KEY: your_api_key" \
     "https://api.packagex.io/v1/cloud-printing/stations?location_id=loc_abc123&status=online"

      

Response

        {
  "data": [
    {
      "object": "print_station",
      "id": "prnt_stn_abc123",
      "name": "Station-001",
      "display_name": "Front Desk Printer",
      "status": "online",
      "printers": [...],
      ...
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "has_more": false
  },
  "message": "1 print station retrieved"
}

      

Retrieve Print Station

        GET /v1/cloud-printing/stations/:station_id

      

Retrieves a single print station by ID.

Example Request

        curl -H "PX-API-KEY: your_api_key" \
     "https://api.packagex.io/v1/cloud-printing/stations/prnt_stn_abc123"

      

Response

        {
  "data": {
    "object": "print_station",
    "id": "prnt_stn_abc123",
    "name": "Station-001",
    "display_name": "Front Desk Printer",
    "location_id": "loc_abc123",
    "location": {
      "id": "loc_abc123",
      "name": "Main Warehouse",
      "code": "MW001"
    },
    "status": "online",
    "allow_all_users": true,
    "device_token": "pushy_token",
    "configuration": {
      "pooling_enabled": false
    },
    "printers": [
      {
        "id": "019b1234-5678-...",
        "name": "HP LaserJet Pro",
        "model": "HP LaserJet Pro M404dn",
        "status": "online",
        "configuration": {...},
        "page_size": {...}
      }
    ],
    "allowed_users": [],
    "created_at": "2024-01-15T10:30:00.000Z",
    "updated_at": "2024-01-15T10:30:00.000Z"
  },
  "message": "Print station retrieved"
}

      

Error Codes

Code Status Description
station.exists 400 Station name or display_name already exists at this location
location.cloud_printing_disabled 400 Cloud printing is not enabled at this location
location_access 403 You don't have access to this location
not_found 404 Print station not found