> Tillcast is live: the API at https://api.tillcast.com/v1 and the dashboard at https://dashboard.tillcast.com. A key prints on real printers, so do not call the API unless asked. A job carries its receipt as "document", an array of blocks (the recommended way), or as "receiptline", ReceiptLine text, exactly one of the two: read https://docs.tillcast.com/create-a-print-job.md and https://docs.tillcast.com/concepts/documents.md before you write a job body. Do not code against what does not exist yet: webhooks, a template language, stored templates (a job has no template field), OAuth connections and connectors for Make, Zapier and n8n, and OAuth sign-in for the MCP server. SDKs for TypeScript (@tillcast/sdk, version 0.2.0 or later for blocks) and Python (tillcast) exist as pre-1.0 versions. To show a receipt in a web page without printing, there are the npm packages @tillcast/preview and @tillcast/html-render (0.x, no API key, no call to Tillcast to draw): read https://docs.tillcast.com/preview-a-receipt.md. The docs are the source of truth: check the index https://docs.tillcast.com/llms.txt and https://docs.tillcast.com/roadmap.md before you code against anything. For clean Markdown of any page, append .md to the page URL. The Tillcast MCP server is live at https://api.tillcast.com/mcp and takes an API key as a bearer token (setup: https://docs.tillcast.com/connect-an-ai-assistant.md). It acts on the live account and its tools print on real paper, so do not connect to it or call its tools unless the owner asked you to. The MCP server at https://docs.tillcast.com/_mcp/server is a different one: it only searches these docs and cannot call the Tillcast API.

# Create a job

POST https://api.tillcast.com/v1/printers/{printer}/jobs
Content-Type: application/json

Queues a job for a printer. The document is `document`, an array of blocks, or `receiptline`, text in ReceiptLine, the markup language of receipt printers; exactly one of the two is sent, and both or neither is `422 document_invalid`. Tillcast turns it into the commands of the printer's profile when it accepts the request.

**Blocks.** `document` is an array in print order. Each block is one visible unit and says its `type`: `text`, `row`, `table`, `rule`, `image`, `barcode`, `qr`, `cut` or `feed`. The text of a block prints as it is written, whatever characters it has: a `|`, a `{`, a line of `-` or a `~` in a name is a character and not markup. A block that is not valid is `422 document_invalid`, and `param` is the path of a problem (the first by block and cell), such as `document[3].rows[1][0].size`. A document has at most 1000 blocks, and the same receipt written in ReceiptLine is at most 256 KB (`413 document_too_large`).

**Text.** `receiptline` is 1 byte to 256 KB of UTF-8 after the JSON is decoded and not only white space. The markup characters of ReceiptLine apply in it, so text of your own must be escaped; it is for documents written for other ReceiptLine tools, pasted from the ReceiptLine demo, or made by software of yours that writes the language. Its warnings count lines and columns of this text; for blocks they count those of the same receipt written in ReceiptLine.

The `command` property of ReceiptLine, which would send raw printer commands, is refused (`422 document_command_not_allowed`), and so is a hexadecimal escape that rebuilds a control character inside a text. The document is not stored and is never returned. The answer says which `profile` and `transport` the job was rendered with and lists its `warnings`: the places where the renderer did something other than the document says. The printer prints the job the next time it polls. A request body may be up to 800 KB. The rendered job may be up to 256 KB, or less for a profile that says so (90 KB for `epson-legacy-80mm-42`); a larger one is `413 rendered_too_large`. Send an `Idempotency-Key` so that a retry does not queue a second job: a replay returns the job that was made, with its warnings, and renders nothing. `{printer}` is the printer's id; a MAC address is not accepted there.

**Scope:** `jobs:write`.

Reference: https://docs.tillcast.com/api-reference/jobs/create

## Authentication

- `Authorization` header (bearer token, required) — A restricted API key, `tc_rk_live_` and 32 characters. Send it as `Authorization: Bearer <key>`. A key lists its scopes, and each operation below names the one it needs; a key may also be limited to one customer. An owner or a developer of the organization makes a key in the dashboard, under API keys, after a code sent to their e-mail. The key is shown once, when it is made. An owner or a developer can revoke it there, and a revoked key stops working within a minute.

## Request

### Path parameters

- `printer` (string, required) — The printer's id.

### Headers

- `Idempotency-Key` (string, optional, nullable) — A string of 1 to 64 visible ASCII characters that identifies this request. A retry with the same key and the same body returns the first result (200, with `Idempotent-Replayed: true`) instead of making a second object; the same key with a different body is an error (422). Keys are remembered for 24 hours.

### Body (application/json)

This endpoint expects a CreateJob.

- `client_reference_id` (string, optional, nullable) — The id of this job in your own system, such as an order number: 1 to 128 characters. It is not unique and never refused for being used already, so a retry that is a new request makes a second job; send an `Idempotency-Key` to make a retry safe. Find the jobs that carry it with `GET /v1/jobs?client_reference_id=`. No personal data.
- `document` (list of Block, optional) — What to print, as blocks: an array in print order, each block one visible unit that says its `type` (`text`, `row`, `table`, `rule`, `image`, `barcode`, `qr`, `cut`, `feed`). Tillcast turns it into the commands of the printer when it accepts the request. The text of a block prints as it is written: nothing in it is markup. Send this or `receiptline`, not both; one of them is required.
- `expires_in` (long, optional, nullable) — Seconds the job can be offered to the printer: 60 to 604800. The default is 86400 (24 hours). A whole number: `3600.0` is `3600`, a fraction is `400 parameter_invalid`.
- `metadata` (map from string to string, optional, nullable) — Up to 10 pairs, 1 KB in all. No personal data.
- `receiptline` (string, optional) — What to print, as text in ReceiptLine, the markup language of receipt printers: 1 byte to 256 KB of UTF-8 and not only white space. The markup characters of the language apply in it (`|`, `{`, `}`, `-` alone on a line, `~`, `_`, `"`, a backtick, `^`, `\`): text of your own must be escaped, which `document` does for you. For documents written for other ReceiptLine tools, pasted from the ReceiptLine demo, or made by software of yours that writes the language. The `command` property is refused (`422 document_command_not_allowed`). Send this or `document`, not both.

## Response

### 200

A replay of an earlier request with the same Idempotency-Key.

- `client_reference_id` (string, required, nullable) — The id of this job in your own system, such as an order number, or `null`. Not unique: the same value can be on many jobs, and `GET /v1/jobs?client_reference_id=` lists every job that carries it (the last 7 days). No personal data.
- `completed_at` (string, required, nullable)
- `created_at` (string, required)
- `customer` (string, required)
- `delivered_at` (string, required, nullable)
- `expires_at` (string, required) — When the job stops being offered to the printer.
- `id` (string, required)
- `kind` (string, required) — `api` (yours), `welcome` (the first-connection receipt) or `test` (a test print: never billed).
- `location` (string, required)
- `metadata` (map from string to string, required, nullable)
- `object` (string, required)
- `printer` (string, required)
- `profile` (string, required, nullable) — The profile the document was rendered for: the id of a preset (`x-tillcast-profiles` lists them). A plain string and not an enum, so that a profile that is retired never breaks a client. `null` for a job that was queued as ready printer data and not rendered from a document, such as every job from before documents were rendered.
- `reason` (string, required, nullable) — Why the job did not print.
- `result_code` (string, required, nullable) — The printer's own status code for the job.
- `size_bytes` (long, required) — The size in bytes of what the printer is sent: the rendered document, after the transport step. Not the size of the document you sent.
- `status` (string, required) — `queued`, `delivered`, `printed`, `failed`, `expired` or `cancelled`.
- `transport` (string, required, nullable) — The transport step applied to the rendered bytes: its id and revision, such as `cloudprnt-star.1`. A later correction of a step changes new jobs only, and this tells which jobs were rendered with which. `null` where `profile` is.
- `warnings` (list of DocumentWarning, required) — What the renderer noticed in the document, in the order it happened: at most 21 (the first 20, and a `too_many_warnings` that says there were more). Always there, an empty list for a document with nothing to say. Kept with the job: a replay of the request and every later read return the same list.

### 201

The job that was queued.

- `client_reference_id` (string, required, nullable) — The id of this job in your own system, such as an order number, or `null`. Not unique: the same value can be on many jobs, and `GET /v1/jobs?client_reference_id=` lists every job that carries it (the last 7 days). No personal data.
- `completed_at` (string, required, nullable)
- `created_at` (string, required)
- `customer` (string, required)
- `delivered_at` (string, required, nullable)
- `expires_at` (string, required) — When the job stops being offered to the printer.
- `id` (string, required)
- `kind` (string, required) — `api` (yours), `welcome` (the first-connection receipt) or `test` (a test print: never billed).
- `location` (string, required)
- `metadata` (map from string to string, required, nullable)
- `object` (string, required)
- `printer` (string, required)
- `profile` (string, required, nullable) — The profile the document was rendered for: the id of a preset (`x-tillcast-profiles` lists them). A plain string and not an enum, so that a profile that is retired never breaks a client. `null` for a job that was queued as ready printer data and not rendered from a document, such as every job from before documents were rendered.
- `reason` (string, required, nullable) — Why the job did not print.
- `result_code` (string, required, nullable) — The printer's own status code for the job.
- `size_bytes` (long, required) — The size in bytes of what the printer is sent: the rendered document, after the transport step. Not the size of the document you sent.
- `status` (string, required) — `queued`, `delivered`, `printed`, `failed`, `expired` or `cancelled`.
- `transport` (string, required, nullable) — The transport step applied to the rendered bytes: its id and revision, such as `cloudprnt-star.1`. A later correction of a step changes new jobs only, and this tells which jobs were rendered with which. `null` where `profile` is.
- `warnings` (list of DocumentWarning, required) — What the renderer noticed in the document, in the order it happened: at most 21 (the first 20, and a `too_many_warnings` that says there were more). Always there, an empty list for a document with nothing to say. Kept with the job: a replay of the request and every later read return the same list.

## Errors

### 400 Bad Request Error

The request is malformed or a parameter is invalid.

- `error` (ErrorObject, required)

### 401 Unauthorized Error

The key (or token) is missing or not valid.

- `error` (ErrorObject, required)

### 402 Payment Required Error

The organization has no payment method, and what the call asks is more than its trial allows. Nothing was made or queued. The `code` is one of `payment_method_required`, `trial_limit_reached`.

- `error` (ErrorObject, required)

### 403 Forbidden Error

Not allowed.

- `error` (ErrorObject, required)

### 404 Not Found Error

There is no such object, or it is another organization's.

- `error` (ErrorObject, required)

### 409 Conflict Error

A conflict with the state of an object. The `code` is one of `customer_suspended`, `location_suspended`.

- `error` (ErrorObject, required)

### 413 Content Too Large Error

The request body, the document or what it renders to is too large. The `code` is one of `document_too_large`, `request_too_large`, `rendered_too_large`.

- `error` (ErrorObject, required)

### 422 Unprocessable Entity Error

The request is understood but refused. The `code` is one of `document_invalid`, `document_command_not_allowed`, `document_empty`, `render_timeout`, `profile_mismatch`, `idempotency_key_reused`.

- `error` (ErrorObject, required)

### 429 Too Many Requests Error

The printer has too many jobs waiting (`queue_full`), or this organization is making too many jobs at the same moment (`rate_limited`, which only an organization with no payment method meets). `Retry-After` says when to try again, and a retry with the same `Idempotency-Key` is safe. The `code` is one of `queue_full`, `rate_limited`.

- `error` (ErrorObject, required)

### 500 Internal Server Error

A problem on Tillcast's side.

- `error` (ErrorObject, required)

## Types

### Block

One visible unit of a document, told by its `type`: `text`, `row`, `table`, `rule`, `image`, `barcode`, `qr`, `cut` or `feed`. A document is an array of them, in print order.

- `type`: `barcode` (barcode)
  - `data` (string, required) — What the bars say. The rules depend on `symbology`. The width of the symbol is not checked: it is the printer's paper that it must fit, and one that is wider may be cut, shrunk or missing.
  - `align` (enum, optional) — Where the barcode sits. Not said: left.
    - Allowed values: `left`, `center`, `right`
  - `height` (integer, optional) — The height of the bars in dots, 24 to 240. Not said: 72.
  - `hri` (boolean, optional) — Print the data under the bars. Not said: no.
  - `module_width` (integer, optional) — The width of the thinnest bar in dots, 2 to 4. Not said: 2.
  - `symbology` (enum, optional) — The kind of barcode. Not said: `code128`.
    - Allowed values: `upc`, `ean`, `code39`, `itf`, `codabar`, `code93`, `code128`
- `type`: `cut` (cut)
- `type`: `feed` (feed)
  - `lines` (integer, optional) — How many blank lines, 1 to 20. Not said: 1.
- `type`: `image` (image)
  - `data` (string, required) — The PNG file, in base64.
  - `align` (enum, optional) — Where the image sits. Not said: left.
    - Allowed values: `left`, `center`, `right`
- `type`: `qr` (qr)
  - `data` (string, required) — What the code says: text, a URL. At most 2048 characters, and as many bytes (UTF-8) as a symbol of the `level` holds: 2953 at `l`, 2331 at `m`, 1663 at `q`, 1273 at `h`.
  - `align` (enum, optional) — Where the code sits. Not said: left.
    - Allowed values: `left`, `center`, `right`
  - `cell` (integer, optional) — The size of one square in dots, 3 to 8. Not said: 3.
  - `level` (enum, optional) — The error correction. Not said: `l`.
    - Allowed values: `l`, `m`, `q`, `h`
- `type`: `row` (row)
  - `cells` (list of TableCell, required) — The cells, left to right: at most as many as `columns` has.
  - `align` (enum, optional) — Where the row sits on the paper when every column has a width and the paper is wider. Not said: left.
    - Allowed values: `left`, `center`, `right`
  - `bold` (boolean, optional) — Bold, for every cell that does not say.
  - `columns` (list of TableColumn, optional) — The columns. Not said: the cells share the line equally.
  - `invert` (boolean, optional) — White on black.
  - `size` (BlockSize, optional) — The size of the characters.
  - `underline` (boolean, optional) — Underlined.
  - `wrap` (boolean, optional) — `false` cuts a cell at the end of its column instead of wrapping it; no cell then has a line break, because the language prints only the first line of a text it must not wrap. Not said: wraps.
- `type`: `rule` (rule)
- `type`: `table` (table)
  - `columns` (list of TableColumn, required) — The columns, such as `["*", 9]`: a name that takes the rest of the line and a price of 9 characters.
  - `rows` (list of TableRow, required) — The rows. A row has at most as many cells as there are columns; a shorter one leaves the last columns empty.
  - `align` (enum, optional) — Where the table sits on the paper when every column has a width and the paper is wider. Not said: left.
    - Allowed values: `left`, `center`, `right`
  - `bold` (boolean, optional) — Bold, for every cell that does not say.
  - `border` (enum, optional) — What is drawn between the columns. Not said: `space`.
    - Allowed values: `none`, `space`, `line`
  - `invert` (boolean, optional) — White on black.
  - `size` (BlockSize, optional) — The size of the characters.
  - `underline` (boolean, optional) — Underlined.
  - `wrap` (boolean, optional) — `false` cuts a cell at the end of its column instead of wrapping it; no cell then has a line break, because the language prints only the first line of a text it must not wrap. Not said: wraps.
- `type`: `text` (text)
  - `text` (TextContent, required) — What to print. A line break in it is a line break on the paper; a long text wraps at the edge of the paper.
  - `align` (enum, optional) — Where the line sits. Not said: left.
    - Allowed values: `left`, `center`, `right`
  - `bold` (boolean, optional) — Bold.
  - `invert` (boolean, optional) — White on black.
  - `size` (BlockSize, optional) — The size of the characters.
  - `underline` (boolean, optional) — Underlined.
  - `wrap` (boolean, optional) — `false` cuts a long line at the edge of the paper instead of wrapping it; the text then has no line break, because the language prints only the first line of a text it must not wrap. Not said: wraps.

### DocumentWarning

Where the renderer did something other than the document says. A warning never changes what the renderer would print; it tells where it fell back quietly (a line with a stray brace is dropped, a column is made narrower, a character the printer cannot print becomes `?`). The message is a fixed text per code: it holds no part of the document, so it is safe to show or log.

- `code` (string, required) — A stable code to branch on. The ones known today are listed in `x-codes` of this schema; a new one can be added, so a client treats a code it does not know as a warning in general.
- `column` (integer, required, nullable) — The column on that line, from 1, counted in Unicode characters of the document (normalised to NFC); `null` when the document was rewritten at that place and the position cannot be told.
- `line` (integer, required) — The line of the document, from 1.
- `message` (string, required) — A sentence for a person. Do not parse it.

### ErrorObject

- `code` (string, required) — A stable code to branch on. The ones known today are listed in `x-codes` of this schema; a new one can be added, so a client treats a code it does not know by the HTTP status.
- `message` (string, required) — A sentence for a person. Do not parse it.
- `param` (string, required, nullable) — The request parameter the error is about, if one.
- `request_id` (string, required) — Quote it when you ask for help.
- `type` (string, required) — The kind of error: `invalid_request_error`, `authentication_error`, `permission_error`, `conflict_error`, `idempotency_error`, `rate_limit_error` or `api_error`.

### TableCell

A cell: a string, or an object with a style or an alignment of its own.

- string
- StyledCell: StyledCell

### TableColumn

A column: a width in characters, `"*"` for the rest of the line, or an object with a width and an alignment.

- integer
- RestOfLine: enum
  - Allowed values: `*`
- ColumnSpec: ColumnSpec

### BlockSize

The size of the characters.

- integer
- SizeSpec: SizeSpec

### TableRow

A row of a table: the cells of one row, left to right, or a rule between two rows, `{"type": "rule"}`.

- list of TableCell
- RuleBlock: RuleBlock

### TextContent

What a text says: one string, or a list of pieces that can each have a style, such as `["Total ", {"text": "90.00", "bold": true}]`.

- string
- list of TextRun

### StyledCell

A cell with a style or an alignment of its own.

- `text` (TextContent, required) — What the cell says.
- `align` (enum, optional) — Where the text sits in the column. Not said: the column's.
  - Allowed values: `left`, `center`, `right`
- `bold` (boolean, optional) — Bold. Not said: the block's.
- `invert` (boolean, optional) — White on black.
- `size` (BlockSize, optional) — The size of the characters.
- `underline` (boolean, optional) — Underlined.

### ColumnSpec

A column with a width, an alignment, or both.

- `align` (enum, optional) — Where the text sits in the column. Not said: left.
  - Allowed values: `left`, `center`, `right`
- `width` (integer, optional) — The width in characters, 1 to 96. Not said: the rest of the line.

### SizeSpec

A size the language can print in one direction only: twice as wide or twice as high.

- `height` (integer, optional) — 1 or 2 times as high as a normal character.
- `width` (integer, optional) — 1 or 2 times as wide as a normal character.

### RuleBlock

A rule across the paper, or between the rows of a table.

- `type` (enum, required) — `rule`.
  - Allowed values: `rule`

### TextRun

A piece of a text: a string, or a string with a style of its own.

- string
- StyledRun: StyledRun

### StyledRun

A piece of a text with a style of its own.

- `text` (string, required) — What the piece says.
- `bold` (boolean, optional) — Bold. Not said: the text around it decides.
- `invert` (boolean, optional) — White on black.
- `size` (BlockSize, optional) — The size of the characters.
- `underline` (boolean, optional) — Underlined.

## Examples

**Request**

```json
{
  "client_reference_id": "order-1042",
  "document": [
    {
      "type": "text",
      "text": "Harbour Cafe",
      "align": "center",
      "bold": true,
      "size": 2
    },
    {
      "type": "text",
      "text": "Old Town 1",
      "align": "center"
    },
    {
      "type": "table",
      "columns": [
        "*",
        {
          "align": "right",
          "width": 9
        }
      ],
      "rows": [
        [
          "Flat white",
          "3.40"
        ],
        [
          "Lemon cake",
          "4.20"
        ],
        {
          "type": "rule"
        },
        [
          {
            "bold": true,
            "text": "Total"
          },
          {
            "bold": true,
            "text": "7.60"
          }
        ]
      ]
    },
    {
      "type": "qr",
      "data": "https://tillcast.com/",
      "align": "center"
    }
  ],
  "expires_in": 3600,
  "metadata": {
    "table": "7"
  }
}
```

**Response**

```json
{
  "client_reference_id": "order-1042",
  "completed_at": null,
  "created_at": "2026-10-11T10:00:00Z",
  "customer": "cus_c3x9k2m3",
  "delivered_at": null,
  "expires_at": "2026-10-11T11:00:00Z",
  "id": "job_01M466JX008T2V5X7Z9C1E3G5H",
  "kind": "api",
  "location": "loc_01M42YMFP03Q1P9N7M5K3H1G0F",
  "metadata": {
    "table": "7"
  },
  "object": "job",
  "printer": "prn_01M44X7TQ0A9R2H5J8K1M4N7P0",
  "profile": "star-starprnt-utf8-80mm",
  "reason": null,
  "result_code": null,
  "size_bytes": 1378,
  "status": "queued",
  "transport": "cloudprnt-star.1",
  "warnings": []
}
```

**SDK Code**

```python
import requests

url = "https://api.tillcast.com/v1/printers/prn_01M44X7TQ0A9R2H5J8K1M4N7P0/jobs"

payload = {
    "client_reference_id": "order-1042",
    "document": [
        {
            "type": "text",
            "text": "Harbour Cafe",
            "align": "center",
            "bold": True,
            "size": 2
        },
        {
            "type": "text",
            "text": "Old Town 1",
            "align": "center"
        },
        {
            "type": "table",
            "columns": [
                "*",
                {
                    "align": "right",
                    "width": 9
                }
            ],
            "rows": [["Flat white", "3.40"], ["Lemon cake", "4.20"], { "type": "rule" }, [
                    {
                        "bold": True,
                        "text": "Total"
                    },
                    {
                        "bold": True,
                        "text": "7.60"
                    }
                ]]
        },
        {
            "type": "qr",
            "data": "https://tillcast.com/",
            "align": "center"
        }
    ],
    "expires_in": 3600,
    "metadata": { "table": "7" }
}
headers = {
    "Idempotency-Key": "order-1042",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.tillcast.com/v1/printers/prn_01M44X7TQ0A9R2H5J8K1M4N7P0/jobs';
const options = {
  method: 'POST',
  headers: {
    'Idempotency-Key': 'order-1042',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"client_reference_id":"order-1042","document":[{"type":"text","text":"Harbour Cafe","align":"center","bold":true,"size":2},{"type":"text","text":"Old Town 1","align":"center"},{"type":"table","columns":["*",{"align":"right","width":9}],"rows":[["Flat white","3.40"],["Lemon cake","4.20"],{"type":"rule"},[{"bold":true,"text":"Total"},{"bold":true,"text":"7.60"}]]},{"type":"qr","data":"https://tillcast.com/","align":"center"}],"expires_in":3600,"metadata":{"table":"7"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.tillcast.com/v1/printers/prn_01M44X7TQ0A9R2H5J8K1M4N7P0/jobs"

	payload := strings.NewReader("{\n  \"client_reference_id\": \"order-1042\",\n  \"document\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"Harbour Cafe\",\n      \"align\": \"center\",\n      \"bold\": true,\n      \"size\": 2\n    },\n    {\n      \"type\": \"text\",\n      \"text\": \"Old Town 1\",\n      \"align\": \"center\"\n    },\n    {\n      \"type\": \"table\",\n      \"columns\": [\n        \"*\",\n        {\n          \"align\": \"right\",\n          \"width\": 9\n        }\n      ],\n      \"rows\": [\n        [\n          \"Flat white\",\n          \"3.40\"\n        ],\n        [\n          \"Lemon cake\",\n          \"4.20\"\n        ],\n        {\n          \"type\": \"rule\"\n        },\n        [\n          {\n            \"bold\": true,\n            \"text\": \"Total\"\n          },\n          {\n            \"bold\": true,\n            \"text\": \"7.60\"\n          }\n        ]\n      ]\n    },\n    {\n      \"type\": \"qr\",\n      \"data\": \"https://tillcast.com/\",\n      \"align\": \"center\"\n    }\n  ],\n  \"expires_in\": 3600,\n  \"metadata\": {\n    \"table\": \"7\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Idempotency-Key", "order-1042")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.tillcast.com/v1/printers/prn_01M44X7TQ0A9R2H5J8K1M4N7P0/jobs")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = 'order-1042'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"client_reference_id\": \"order-1042\",\n  \"document\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"Harbour Cafe\",\n      \"align\": \"center\",\n      \"bold\": true,\n      \"size\": 2\n    },\n    {\n      \"type\": \"text\",\n      \"text\": \"Old Town 1\",\n      \"align\": \"center\"\n    },\n    {\n      \"type\": \"table\",\n      \"columns\": [\n        \"*\",\n        {\n          \"align\": \"right\",\n          \"width\": 9\n        }\n      ],\n      \"rows\": [\n        [\n          \"Flat white\",\n          \"3.40\"\n        ],\n        [\n          \"Lemon cake\",\n          \"4.20\"\n        ],\n        {\n          \"type\": \"rule\"\n        },\n        [\n          {\n            \"bold\": true,\n            \"text\": \"Total\"\n          },\n          {\n            \"bold\": true,\n            \"text\": \"7.60\"\n          }\n        ]\n      ]\n    },\n    {\n      \"type\": \"qr\",\n      \"data\": \"https://tillcast.com/\",\n      \"align\": \"center\"\n    }\n  ],\n  \"expires_in\": 3600,\n  \"metadata\": {\n    \"table\": \"7\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.tillcast.com/v1/printers/prn_01M44X7TQ0A9R2H5J8K1M4N7P0/jobs")
  .header("Idempotency-Key", "order-1042")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"client_reference_id\": \"order-1042\",\n  \"document\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"Harbour Cafe\",\n      \"align\": \"center\",\n      \"bold\": true,\n      \"size\": 2\n    },\n    {\n      \"type\": \"text\",\n      \"text\": \"Old Town 1\",\n      \"align\": \"center\"\n    },\n    {\n      \"type\": \"table\",\n      \"columns\": [\n        \"*\",\n        {\n          \"align\": \"right\",\n          \"width\": 9\n        }\n      ],\n      \"rows\": [\n        [\n          \"Flat white\",\n          \"3.40\"\n        ],\n        [\n          \"Lemon cake\",\n          \"4.20\"\n        ],\n        {\n          \"type\": \"rule\"\n        },\n        [\n          {\n            \"bold\": true,\n            \"text\": \"Total\"\n          },\n          {\n            \"bold\": true,\n            \"text\": \"7.60\"\n          }\n        ]\n      ]\n    },\n    {\n      \"type\": \"qr\",\n      \"data\": \"https://tillcast.com/\",\n      \"align\": \"center\"\n    }\n  ],\n  \"expires_in\": 3600,\n  \"metadata\": {\n    \"table\": \"7\"\n  }\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.tillcast.com/v1/printers/prn_01M44X7TQ0A9R2H5J8K1M4N7P0/jobs', [
  'body' => '{
  "client_reference_id": "order-1042",
  "document": [
    {
      "type": "text",
      "text": "Harbour Cafe",
      "align": "center",
      "bold": true,
      "size": 2
    },
    {
      "type": "text",
      "text": "Old Town 1",
      "align": "center"
    },
    {
      "type": "table",
      "columns": [
        "*",
        {
          "align": "right",
          "width": 9
        }
      ],
      "rows": [
        [
          "Flat white",
          "3.40"
        ],
        [
          "Lemon cake",
          "4.20"
        ],
        {
          "type": "rule"
        },
        [
          {
            "bold": true,
            "text": "Total"
          },
          {
            "bold": true,
            "text": "7.60"
          }
        ]
      ]
    },
    {
      "type": "qr",
      "data": "https://tillcast.com/",
      "align": "center"
    }
  ],
  "expires_in": 3600,
  "metadata": {
    "table": "7"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => 'order-1042',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.tillcast.com/v1/printers/prn_01M44X7TQ0A9R2H5J8K1M4N7P0/jobs");
var request = new RestRequest(Method.POST);
request.AddHeader("Idempotency-Key", "order-1042");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"client_reference_id\": \"order-1042\",\n  \"document\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"Harbour Cafe\",\n      \"align\": \"center\",\n      \"bold\": true,\n      \"size\": 2\n    },\n    {\n      \"type\": \"text\",\n      \"text\": \"Old Town 1\",\n      \"align\": \"center\"\n    },\n    {\n      \"type\": \"table\",\n      \"columns\": [\n        \"*\",\n        {\n          \"align\": \"right\",\n          \"width\": 9\n        }\n      ],\n      \"rows\": [\n        [\n          \"Flat white\",\n          \"3.40\"\n        ],\n        [\n          \"Lemon cake\",\n          \"4.20\"\n        ],\n        {\n          \"type\": \"rule\"\n        },\n        [\n          {\n            \"bold\": true,\n            \"text\": \"Total\"\n          },\n          {\n            \"bold\": true,\n            \"text\": \"7.60\"\n          }\n        ]\n      ]\n    },\n    {\n      \"type\": \"qr\",\n      \"data\": \"https://tillcast.com/\",\n      \"align\": \"center\"\n    }\n  ],\n  \"expires_in\": 3600,\n  \"metadata\": {\n    \"table\": \"7\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Idempotency-Key": "order-1042",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "client_reference_id": "order-1042",
  "document": [
    [
      "type": "text",
      "text": "Harbour Cafe",
      "align": "center",
      "bold": true,
      "size": 2
    ],
    [
      "type": "text",
      "text": "Old Town 1",
      "align": "center"
    ],
    [
      "type": "table",
      "columns": [
        "*",
        [
          "align": "right",
          "width": 9
        ]
      ],
      "rows": [["Flat white", "3.40"], ["Lemon cake", "4.20"], ["type": "rule"], [
          [
            "bold": true,
            "text": "Total"
          ],
          [
            "bold": true,
            "text": "7.60"
          ]
        ]]
    ],
    [
      "type": "qr",
      "data": "https://tillcast.com/",
      "align": "center"
    ]
  ],
  "expires_in": 3600,
  "metadata": ["table": "7"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.tillcast.com/v1/printers/prn_01M44X7TQ0A9R2H5J8K1M4N7P0/jobs")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```