# Inputs / Shelf Tickets

# Shelf Tickets

**Object**
## TicketTemplateBuilderArgumentInput

| Fields | Type | Description |
| --- | --- | --- |
| name | *String!* | The name of the function's argument |
| source | [TicketTemplateBuilderArgumentSourceEnum!](/documentation/Enums/Ticket-Template-Builder-Argument-Source-Enum#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](/documentation/Inputs/Shelf-Tickets#TicketTemplateBuilderFieldReferenceInput) | The field of a `FIELD` argument |
| call | [TicketTemplateBuilderFunctionCallInput](/documentation/Inputs/Shelf-Tickets#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!](/documentation/Enums/Ticket-Template-Builder-Element-Kind-Enum#TicketTemplateBuilderElementKindEnum) | The kind of element, which decides which of `field`, `text`, `function` or `custom` is used |
| box | [TicketTemplateBuilderBoxInput!](/documentation/Inputs/Shelf-Tickets#TicketTemplateBuilderBoxInput) | Where the element is placed on the ticket |
| style | [TicketTemplateBuilderStyleInput!](/documentation/Inputs/Shelf-Tickets#TicketTemplateBuilderStyleInput) | How the element is styled |
| format | [TicketTemplateBuilderFormatInput!](/documentation/Inputs/Shelf-Tickets#TicketTemplateBuilderFormatInput) | How the element's text is formatted |
| field | [TicketTemplateBuilderFieldReferenceInput](/documentation/Inputs/Shelf-Tickets#TicketTemplateBuilderFieldReferenceInput) | The field shown by a `FIELD` element |
| text | [TicketTemplateBuilderTextInput](/documentation/Inputs/Shelf-Tickets#TicketTemplateBuilderTextInput) | The text shown by a `TEXT` element |
| function | [TicketTemplateBuilderFunctionCallInput](/documentation/Inputs/Shelf-Tickets#TicketTemplateBuilderFunctionCallInput) | The function shown by a `FUNCTION` element |
| parts | [[TicketTemplateBuilderPartInput!]](/documentation/Inputs/Shelf-Tickets#TicketTemplateBuilderPartInput) | Styles for the parts of a `FUNCTION` element with a multi-part result, part names must be unique |
| custom | [TicketTemplateBuilderCustomInput](/documentation/Inputs/Shelf-Tickets#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](/documentation/Enums/Ticket-Template-Builder-Text-Case-Enum#TicketTemplateBuilderTextCaseEnum) | Changes the case of the text |



**Object**
## TicketTemplateBuilderFunctionCallInput

| Fields | Type | Description |
| --- | --- | --- |
| name | [TicketTemplateBuilderFunctionEnum!](/documentation/Enums/Ticket-Template-Builder-Function-Enum#TicketTemplateBuilderFunctionEnum) | The function to call |
| arguments | [[TicketTemplateBuilderArgumentInput!]!](/documentation/Inputs/Shelf-Tickets#TicketTemplateBuilderArgumentInput) | The arguments passed to the function |



**Object**
## TicketTemplateBuilderLayoutInput

| Fields | Type | Description |
| --- | --- | --- |
| version | *Int!* | The version of the layout format |
| elements | [[TicketTemplateBuilderElementInput!]!](/documentation/Inputs/Shelf-Tickets#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!](/documentation/Inputs/Shelf-Tickets#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](/documentation/Enums/Ticket-Template-Builder-Vertical-Align-Enum#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](/documentation/Enums/Ticket-Template-Builder-Text-Align-Enum#TicketTemplateBuilderTextAlignEnum) | The horizontal alignment of the content |
| verticalAlign | [TicketTemplateBuilderVerticalAlignEnum](/documentation/Enums/Ticket-Template-Builder-Vertical-Align-Enum#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](/documentation/Inputs/Shelf-Tickets#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 |