On this page & docs navigation
On this page
ScopeEndpoints at a glanceFields & semanticsWMS integration flowMulti-language examplesFAQGetting started
OverviewQuickstartMulti-language integrationVersions & capabilitiesAPI reference
Delivery channelsREST endpointsCommands & parametersPrint parameters & defaultsCommand referenceVersion & download APIMulti-language SDKWebSocket /wsAO remote channelAgent integrationScenarios & practice
ExamplesBest practicesFeature demosRelated pages
Solutionscloud servicePricingOpen source & licenceBack
← Back to homepage Download the client →Wire client distribution into your systems
Warehouse management systems (WMS), ERP and operations distribution systems can use this set of endpoints to query the latest client version, fetch installers, verify them and distribute to workstations. The data comes from real release resources fetched live from the official site. It is read-only, with no registration or keys, and the single entry point is https://www.litchio.com/api/v1/.
Scope
These are "distribution & upgrade" layer endpoints, not printing endpoints - do not mix the two.
| Layer | Caller | Address | Purpose |
|---|---|---|---|
| Distribution / upgrade | WMS and ERP servers, operations scripts | www.litchio.com/api/v1/ | Query versions, download installers, verify, distribute to workstations |
| Runtime printing | Business systems (local machine or controlled intranet) | http://127.0.0.1:19861 | Send print jobs over REST and native WebSocket |
For runtime printing endpoints, see Quickstart, Multi-language integration; for the network boundary of the client's local service, see Developer documentation.
Endpoints at a glance
All are GET, returning JSON or a 302 redirect; all endpoints support CORS preflight OPTIONS.
| Endpoint | Returns | Description |
|---|---|---|
/api/v1/releases | JSON | All versions: latest the latest release + history an array of historical downloadable versions |
/api/v1/releases/latest | JSON | The latest release only. With ?current=1.01.000 it also returns updateAvailable |
/api/v1/download/installer | 302 | Redirects to the latest installer (?tag= you can name a real historical version). The setup wizard installs per user, with no administrator rights required, and the installer ships with the full licence text and the any-device docs site. |
/api/v1/download/portable | 302 | Redirects to the latest portable build; ?tag= you can name a real historical version |
Third parties should rely only on the official domain and the download redirect endpoints - do not parse or cache artifacts.*.url the direct origin links inside them, so your system needs no changes when the release host changes later.
Fields & semantics
Fields are fixed by the v1 contract; anything the upstream does not provide is always null, never faked with 0 or an empty string.
| Field name | Meaning |
|---|---|
apiVersion | The contract version, currently fixed at 1 |
ok / error | true on success; on failure, HTTP 502 or 404 with a reason |
source | live real time / cache online cache / seed last-resort fallback |
stale | true means this is not a live result from the past hour (upstream failure fallback or the frozen last resort); automatic upgrades should check this first |
fetchedAt | When this data was fetched, ISO 8601 |
upstreamStatus | Upstream request status, for troubleshooting; only given on a live attempt |
release.version / tag | e.g. 1.01.000 / v1.01.000 |
release.releasedAt | When the release resource was created (from the upstream created_at) |
release.platform | windows-x64, the platform the client genuinely supports |
artifacts.installer | {url, size, sha256}; the upstream provides no size or sha256 for the installer, so both are null |
artifacts.portable | Same as above; size and sha256 taken from that version's latest.json, and can be used for integrity verification |
release.sourceArchive | The source archive with the same tag as the latest version zip / targz |
history[] | Historical downloadable versions, with the same structure as release , but without sourceArchive |
updateAvailable | Only present with ?current= ; true / false, and null when the version number cannot be parsed null |
Version comparison is done segment by segment on the dot-separated numbers (1.01.000 counts as 1 / 1 / 0), not SemVer; current written as v1.01.000 is recognised too.
Current published version baseline: v1.01.023(当前源码与线上安装包一致、共 73 个命令,主源 GitHub)是 /api/v1/releases/latest currently points to. The portable build PipPrinter-win-x64-1.01.023.zip (~89MB), the installer and latest.json (real SHA256) are all on GitHub Release (the primary source, alaikis/pipprinter); a mirror keeps latest.json as a minimal backup set (the auto-update client uses GitHub by default, with the mirror as fallback). Historically, v1.01.001 / v1.01.002 released only source archives with no downloadable client; they are skipped automatically and do not affect the determination of the latest version.
WMS integration flow
The typical approach is to run "check version -> download -> verify -> distribute" on the WMS server or an operations node, rather than having every workstation reach the internet on its own.
1 - Scheduled queries
The server requests /api/v1/releases/latest?current= once a day, with the parameter set to the currently deployed version number.
2 - Judge trustworthiness
Check ok first; if stale is true, log it and skip this upgrade, then retry next time.
3 - Download & verify
updateAvailable is true, download the portable build, using artifacts.portable.sha256 to verify integrity.
4 - Internal distribution
Put verified packages on an intranet file service or a configuration management system, then distribute them to each workstation to install or replace.
5 - Write the version back
After the upgrade, write the new version back into the WMS configuration, as the next request's current.
6 - Failure fallback
If the endpoint is unavailable or the upstream falls back, keep the current version; never force-upgrade workstation clients because of a single failure.
Verify once, distribute to every workstation
Version information is served online by the official site; the installer only needs to be fetched once on a connected node, and after verification it enters the intranet distribution chain.
- The server queries centrally; workstations need no internet of their own
- The portable build provides a real SHA-256 for verification
- Historical versions roll back precisely by tag
Multi-language examples
Five implementations of the same flow: query the latest version, decide whether an upgrade is needed, download and verify the portable build.
# 1) Query the latest version and compare it with the currently deployed one
curl -s "https://www.litchio.com/api/v1/releases/latest?current=1.01.000"
# 2) Download the portable build (-L follows the 302)
curl -L -o "$PWD/PipPrinter-win-x64.zip" "https://www.litchio.com/api/v1/download/portable"
# 3) The checksum comes from release.artifacts.portable.sha256 in the previous response
sha256sum ./PipPrinter-win-x64.zip
# 4) To roll back, name a real historical version (the sample tag must match a version that was actually released)
curl -L -o older.zip "https://www.litchio.com/api/v1/download/portable?tag=v1.01.000" import { createHash } from "node:crypto";
import { writeFile } from "node:fs/promises";
const BASE = "https://www.litchio.com";
const info = await (await fetch(BASE + "/api/v1/releases/latest?current=1.01.000")).json();
if (!info.ok) throw new Error(t("版本服务暂不可用"));
if (info.stale) { console.warn(t("非实时结果,本次跳过升级"), info.source); process.exit(0); }
if (!info.updateAvailable) { console.log(t("已是最新版本"), info.release.version); process.exit(0); }
const res = await fetch(BASE + "/api/v1/download/portable"); // fetch follows 302 by default
const bytes = Buffer.from(await res.arrayBuffer());
const sha = info.release.artifacts.portable.sha256;
if (sha && createHash("sha256").update(bytes).digest("hex") !== sha) throw new Error(t("SHA-256 校验失败"));
const target = new URL(res.url).pathname.split("/").pop() || "PipPrinter-win-x64.zip";
await writeFile(target, bytes);
console.log(t("已下载便携版"), target, info.release.version); import hashlib, json, urllib.request
BASE = "https://www.litchio.com"
with urllib.request.urlopen(BASE + "/api/v1/releases/latest?current=1.01.000") as r:
info = json.load(r)
if not info["ok"]:
raise RuntimeError(t("版本服务暂不可用"))
if info["stale"]:
raise RuntimeError(t("本次为非实时结果,跳过升级:") + info["source"])
if info["updateAvailable"]:
with urllib.request.urlopen(BASE + "/api/v1/download/portable") as r:
data = r.read() # urllib follows 302 automatically
target = r.geturl().split('/')[-1] or 'PipPrinter-win-x64.zip'
sha = info["release"]["artifacts"]["portable"]["sha256"]
if sha and hashlib.sha256(data).hexdigest() != sha:
raise RuntimeError(t("SHA-256 校验失败"))
with open(target, 'wb') as f:
f.write(data)
print(t("已下载便携版"), target, info["release"]["version"]) using System;
using System.IO;
using System.Net.Http;
using System.Security.Cryptography;
using System.Text.Json;
using System.Threading.Tasks;
const string Base = "https://www.litchio.com";
using var http = new HttpClient();
using var doc = JsonDocument.Parse(
await http.GetStringAsync(Base + "/api/v1/releases/latest?current=1.01.000"));
var root = doc.RootElement;
if (!root.GetProperty("ok").GetBoolean()) throw new Exception(t("版本服务暂不可用"));
if (root.GetProperty("stale").GetBoolean()) throw new Exception(t("本次为非实时结果,跳过升级"));
var release = root.GetProperty("release");
var version = release.GetProperty("version").GetString();
var sha = release.GetProperty("artifacts").GetProperty("portable").GetProperty("sha256").GetString();
var bytes = await http.GetByteArrayAsync(Base + "/api/v1/download/portable");
if (!string.IsNullOrEmpty(sha) &&
Convert.ToHexString(SHA256.HashData(bytes)).ToLowerInvariant() != sha)
throw new Exception(t("SHA-256 校验失败"));
await File.WriteAllBytesAsync($"PipPrinter-win-x64-{version}.zip", bytes);
Console.WriteLine($t("已下载便携版 {version}")); package main
import (
"crypto/sha256"
"encoding/hex"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
const base = "https://www.litchio.com"
type info struct {
OK bool `json:"ok"`
Source string `json:"source"`
Stale bool `json:"stale"`
UpdateAvailable bool `json:"updateAvailable"`
Release struct {
Version string `json:"version"`
Artifacts struct {
Portable struct {
SHA256 *string `json:"sha256"`
} `json:"portable"`
} `json:"artifacts"`
} `json:"release"`
}
func main() {
r, err := http.Get(base + "/api/v1/releases/latest?current=1.01.000")
if err != nil { panic(err) }
defer r.Body.Close()
var v info
if err := json.NewDecoder(r.Body).Decode(&v); err != nil { panic(err) }
if !v.OK || v.Stale || !v.UpdateAvailable {
fmt.Println(t("无需升级"), v.Source)
return
}
resp, err := http.Get(base + "/api/v1/download/portable") // follows 302 by default
if err != nil { panic(err) }
defer resp.Body.Close()
data, err := io.ReadAll(resp.Body)
if err != nil { panic(err) }
if v.Release.Artifacts.Portable.SHA256 != nil {
sum := sha256.Sum256(data)
if hex.EncodeToString(sum[:]) != *v.Release.Artifacts.Portable.SHA256 {
panic(t("SHA-256 校验失败"))
}
}
if err := os.WriteFile("PipPrinter-win-x64-"+v.Release.Version+".zip", data, 0644); err != nil { panic(err) }
fmt.Println(t("已下载便携版"), v.Release.Version)
} The examples use the real official endpoints and published version numbers; installers come from third-party hosting, download requests follow the 302, and the final file name (with version and SHA-256) is whatever the 302 response says - do not hard-code it from this page.
FAQ
Do I need a key or registration?
No. This is a read-only public API: it offers no write capability and receives no business data.
Can a browser front end call it directly?
Yes. All v1 endpoints return Access-Control-Allow-Origin: * and support OPTIONS preflight. But installers are large, so real distribution should still go through a server.
How often is the data refreshed?
Every page or API request fetches the real release resources online, reusing the online cache within 60 seconds, with a 300-second HTTP response cache. When the upstream is unreachable, it falls back to the most recent success (up to 7 days) or the frozen last resort, source and stale are clearly marked, never disguised as live data.
Why are the installer's size and sha256 null?
The upstream release resource does not provide these two, and the official site does not invent them. For integrity verification, use the portable build and its real SHA-256.
?tag= Can it take any value?
No. It only accepts real tag or version that exist in the version list; unknown values return 404 JSON, and redirect targets also pass a domain allowlist check to avoid open redirects.
What if the intranet has no internet access?
Download endpoints still end up redirecting to third-party hosted release resources, and the official site provides no file proxy. Have a connected node download and verify first, then place the files on an intranet file service for workstations to fetch.
Is there an availability commitment?
This is a free read-only API provided alongside the official site, with no SLA or quota commitment. Build failure retries and local caching into your own system, and factor stale into your upgrade decision.
Does the old /api/releases still work?
That endpoint serves the official site's own pages, and its fields change as pages need. Third parties should stick to /api/v1/*, where contract changes show up as a new version number.
For client downloads and version notes, see the download section on the home page; for open source and licensing, see Open source & how it runs.