SDK and CLI
Printags SDK and CLI for the API
Call the Printags API from Node.js or from the command line. One npm package, no dependency.
Install
Node.js 18 or later. The package contains the SDK and the printags command.
npm install printags
SDK for Node.js
Each method is one operation of the OpenAPI document, under the operation's own name. Errors are PrintagsError objects with the HTTP status and the API's error code.
import { Printags } from "printags";
const printags = new Printags({ apiKey: process.env.PRINTAGS_API_KEY });
const { orders } = await printags.listOrders("@me", { perPage: 10 });
// A draft prints and charges nothing until it is validated.
// The idempotency key makes a retry safe: the same key returns the order already created.
const { orderId } = await printags.createOrder("@me", {
isDraft: true,
reference: "Order-2026-001",
shipTo: { name: "Jean Dupont", phone: "+33612345678", email: "[email protected]",
address: { addressLine1: "12 rue de la Paix", city: "Paris", postcode: "75002", countryCode: "FR" } },
items: [{ productId: "ntag213_pvccard_white", quantity: 10, printingVisuals: [fileId],
nfc: { type: "uri", content: "https://example.com/jean" } }]
}, { idempotencyKey: "order-2026-001" });Command line
The same operations from a terminal or a script. Output is JSON.
export PRINTAGS_API_KEY=sk_test_... export PRINTAGS_SANDBOX=1 npx printags statuses npx printags carriers --to-country FR npx printags orders list --per-page 5 npx printags orders create --file order.json --idempotency-key order-2026-001
Sandbox
A test key (sk_test_...) creates test orders that are neither charged nor manufactured. With the sandbox option, the SDK and the CLI use sandbox-api.printags.com, which only accepts test keys: a real key is refused before any request leaves your machine.
Questions
SDK and CLI: your questions
Is there an official Printags SDK?
Yes: the npm package printags, for Node.js 18 or later, with no dependency. The API itself is a plain REST API described by an OpenAPI document, so any language can call it.
Can I try the SDK without ordering real cards?
Yes. Use a test key (sk_test_...) with the sandbox option: the orders created are test orders, neither charged nor manufactured.
Under which license is the package published?
MIT. The source code is on GitHub at printags/printags-js.