Shelf Tickets

Object

TicketTemplateBuilderArgumentInput

Fields Type Description

name

String!

The name of the function's argument

source

TicketTemplateBuilderArgumentSourceEnum!

Where the argument's value comes from, which decides which of value, field or call is used

value

String

The value of a CONSTANT argument

field

TicketTemplateBuilderFieldReferenceInput

The field of a FIELD argument

call

TicketTemplateBuilderFunctionCallInput

The function of a FUNCTION argument

Object

TicketTemplateBuilderBoxInput

Fields Type Description

x

Float!

The distance from the left of the ticket, in mm

y

Float!

The distance from the top of the ticket, in mm

width

Float!

The width of the element, in mm

height

Float!

The height of the element, in mm

rotation

Float!

The rotation of the element, in degrees

zIndex

Int!

The stacking order of the element, higher values are shown above lower ones

locked

Boolean!

Whether the element is locked from being moved in the builder

hideWhenEmpty

Boolean!

Whether the element is hidden when it has no content

Object

TicketTemplateBuilderCustomInput

Fields Type Description

script

String!

A JavaScript expression that provides the element's content

css

String!

CSS that's scoped to the element

Object

TicketTemplateBuilderElementInput

Fields Type Description

id

String!

The ID of the element, only letters and numbers, used as the el_<id> field of the template

name

String

A name for the element, shown in the builder

kind

TicketTemplateBuilderElementKindEnum!

The kind of element, which decides which of field, text, function or custom is used

box

TicketTemplateBuilderBoxInput!

Where the element is placed on the ticket

style

TicketTemplateBuilderStyleInput!

How the element is styled

format

TicketTemplateBuilderFormatInput!

How the element's text is formatted

field

TicketTemplateBuilderFieldReferenceInput

The field shown by a FIELD element

text

TicketTemplateBuilderTextInput

The text shown by a TEXT element

function

TicketTemplateBuilderFunctionCallInput

The function shown by a FUNCTION element

parts

[TicketTemplateBuilderPartInput!]

Styles for the parts of a FUNCTION element with a multi-part result, part names must be unique

custom

TicketTemplateBuilderCustomInput

The script and styles of a CUSTOM element

Object

TicketTemplateBuilderFieldReferenceInput

Fields Type Description

keys

[String!]!

The ticket fields to use, the first one that isn't empty is shown

fallback

String

Shown when all of the fields are empty

Object

TicketTemplateBuilderFormatInput

Fields Type Description

prefix

String

Text added before the content when it isn't empty

suffix

String

Text added after the content when it isn't empty

textCase

TicketTemplateBuilderTextCaseEnum

Changes the case of the text

Object

TicketTemplateBuilderFunctionCallInput

Fields Type Description

name

TicketTemplateBuilderFunctionEnum!

The function to call

arguments

[TicketTemplateBuilderArgumentInput!]!

The arguments passed to the function

Object

TicketTemplateBuilderLayoutInput

Fields Type Description

version

Int!

The version of the layout format

elements

[TicketTemplateBuilderElementInput!]!

The elements placed on the ticket, element IDs must be unique and functions can only be nested 3 deep

Object

TicketTemplateBuilderPartInput

Fields Type Description

name

String!

The part of the function's result, e.g. cents for SPLIT_CURRENCY

style

TicketTemplateBuilderPartStyleInput!

How the part is styled, on top of the element's style

Object

TicketTemplateBuilderPartStyleInput

Fields Type Description

fontSize

Float

The font size, in pt, the element's font size is used when not set

fontWeight

Int

The font weight, e.g. 700 for bold

italic

Boolean

Whether the text is italic

color

String

The text colour, as a CSS colour

verticalAlign

TicketTemplateBuilderVerticalAlignEnum

Where the part sits against the other parts, e.g. TOP to raise the cents

marginLeft

Float

The space before the part, in mm, negative to move it closer to the part before

marginRight

Float

The space after the part, in mm, negative to move the next part closer

Object

TicketTemplateBuilderShrinkToFitInput

Fields Type Description

minSize

Float!

The smallest font size, in pt

maxSize

Float!

The largest font size, in pt

maxLines

Int!

The most lines the text can wrap onto

Object

TicketTemplateBuilderStyleInput

Fields Type Description

fontFamily

String

The font family, from the template's fonts

fontSize

Float

The font size, in pt

fontWeight

Int

The font weight, e.g. 700 for bold

italic

Boolean

Whether the text is italic

color

String

The text colour, as a CSS colour

textAlign

TicketTemplateBuilderTextAlignEnum

The horizontal alignment of the content

verticalAlign

TicketTemplateBuilderVerticalAlignEnum

The vertical alignment of the content

lineHeight

Float

The line height, relative to the font size

backgroundColor

String

The background colour, as a CSS colour

borderWidth

Float

The border width, in mm

borderColor

String

The border colour, as a CSS colour

borderRadius

Float

The border radius, in mm

padding

Float

The padding inside the element, in mm

shrinkToFit

TicketTemplateBuilderShrinkToFitInput

Shrinks the font size so the text fits within the element

Object

TicketTemplateBuilderTextInput

Fields Type Description

text

String!

The text to show, {field} is replaced with the field's value and {a|b|"text"} uses the first value that isn't empty