Zum Inhalt springen

Check cart items against the layout before printing

POST
/api/v1/render/check
curl --request POST \
--url https://example.com/api/v1/render/check \
--header 'Content-Type: application/json' \
--header 'X-Label-Hub-Key: <X-Label-Hub-Key>' \
--data '{ "items": [ { "content_type": "qr_only", "lookup": { "app": "example", "identifier": "example" } } ], "layout_preset": "compact", "orientation": "across", "tape_mm": 1 }'

Looks up every distinct item once (at most eight lookups at a time), draws it for tape_mm with the given orientation and layout_preset, and answers one verdict per item in request order. A failing item does not fail the request: its result carries error_code (qr_payload_too_long, content_type_data_mismatch, integration_item_not_found, integration_unknown_app, integration_lookup_failed, integration_not_configured) and, where it helps, error_detail. Returns 409 (unsupported_tape) before any lookup when the tape width or the orientation is not available. Rate limit: the request’s own token pays for the first distinct lookup, each further one takes another token from the key’s bucket (never more than a full bucket); a request the remaining budget cannot cover is refused with 429 rate_limit_exceeded before any lookup. Nothing is printed and no job is created.

Media typeapplication/json
RenderCheckRequest

Cart items to check against one tape width and layout.

object
items
required
Items
Array<object>
>= 1 items <= 50 items
RenderCheckItem

One cart item: how it is drawn and which integration item feeds it.

object
content_type
required
ContentType

Tape-independent semantic content types for label rendering.

string
Allowed values: qr_only qr_one_line qr_two_lines qr_three_lines text_one_line text_two_lines qr_with_listing spool_swatch
lookup
required
RenderCheckLookup

The integration item a label is drawn from.

object
app
required
App
string
<= 32 characters
identifier
required
Identifier
string
>= 1 characters <= 256 characters
layout_preset
Any of:
QlLayoutPreset

The built-in QL 62 mm across-width layouts (docs/design/ql-layout-presets).

string
Allowed values: compact small_qr standard
orientation
Any of:
LabelOrientation

How the label content runs on endless tape.

string
Allowed values: across along
tape_mm
required
Tape Mm
integer

Successful Response

Media typeapplication/json
RenderCheckResponse

One result per request item, in request order.

object
results
required
Results
Array<object>
RenderCheckResult

Verdict for the item at index of the request.

object
error_code
Error Code
Any of:
string
error_detail
Error Detail
Any of:
object
key
additional properties
any
error_message
Error Message
Any of:
string
index
required
Index
integer
ok
required
Ok
boolean

Example generated

{
"results": [
{
"error_code": "example",
"error_detail": {},
"error_message": "example",
"index": 1,
"ok": true
}
]
}

Unsupported tape width or orientation (unsupported_tape)

Invalid body: no items, more than 50, or an identifier too long

The key’s rate limit cannot cover the lookups (rate_limit_exceeded)