import { TillcastClient } from "@tillcast/sdk";
const client = new TillcastClient({
token: process.env.TILLCAST_API_KEY!
});
await client.jobs.create({
printer: "prn_01J8ZQ4M7K",
document: [
{ type: "text",
text: "Harbour Cafe",
align: "center", size: 2 },
{ type: "text", text: "Table 7",
align: "center" },
{ type: "table",
columns: ["*",
{ width: 9, align: "right" }],
rows: [
["Flat white", "3.40"],
["Lemon cake", "4.20"],
{ type: "rule" },
["Total", "7.60"],
] },
],
});Example request: import { TillcastClient } from "@tillcast/sdk";
const client = new TillcastClient({
token: process.env.TILLCAST_API_KEY!
});
await client.jobs.create({
printer: "prn_01J8ZQ4M7K",
document: [
{ type: "text",
text: "Harbour Cafe",
align: "center", size: 2 },
{ type: "text", text: "Table 7",
align: "center" },
{ type: "table",
columns: ["*",
{ width: 9, align: "right" }],
rows: [
["Flat white", "3.40"],
["Lemon cake", "4.20"],
{ type: "rule" },
["Total", "7.60"],
] },
],
});
{ "id": "job_01J8ZQ6W2P", "status": "queued", ... }import os
from tillcast import Tillcast
client = Tillcast(
token=os.environ["TILLCAST_API_KEY"]
)
client.jobs.create(
printer="prn_01J8ZQ4M7K",
document=[
{"type": "text",
"text": "Harbour Cafe",
"align": "center", "size": 2},
{"type": "text", "text": "Table 7",
"align": "center"},
{"type": "table",
"columns": [
"*",
{"width": 9, "align": "right"},
],
"rows": [
["Flat white", "3.40"],
["Lemon cake", "4.20"],
{"type": "rule"},
["Total", "7.60"],
]},
],
){ "id": "job_01J8ZQ6W2P", "status": "queued", ... }curl https://api.tillcast.com/v1/printers/prn_01J8ZQ4M7K/jobs \
-H "Authorization: Bearer $TILLCAST_API_KEY" \
-H "Content-Type: application/json" \
-d @- <<'EOF'
{
"document": [
{"type": "text",
"text": "Harbour Cafe",
"align": "center", "size": 2},
{"type": "text", "text": "Table 7",
"align": "center"},
{"type": "table",
"columns": [
"*",
{"width": 9, "align": "right"}
],
"rows": [
["Flat white", "3.40"],
["Lemon cake", "4.20"],
{"type": "rule"},
["Total", "7.60"]
]}
]
}
EOF{ "id": "job_01J8ZQ6W2P", "status": "queued", ... }