Build text components

To display text on invoices, add text components to cells. Text components display plain text, tokens that display database data, or both, through simple and compound binding. The tokens that are valid for text components depends on which component type the text components are in. For more information, see Tokens.

Text components are elementary components so they cannot contain components.

Note: You can create more than one active version of an invoice template per locale, and use conditional expressions to determine which fields appear on a version of an invoice template. You can only use conditional expressions in templates that you create or that you copy from a marketplace-provided default template. You cannot add conditional expressions to marketplace default templates. For more information, see Build text components.

Prerequisites

You can add text components to cell components. See Build cell components.

Default template JSON samples

In the Appdirect Template_EN_US default template, see lines 79-90, 247-259, and 306-316.

To download the default template, go to .

Text component JSON schema

{
  "type": "text",
  "properties": {
     "visible" : "true",
   },
  "style": {
    "color": "#333"
    "font-size": "12px"
  }
  "data": "Hello {{First Name}} {{Last Name}}. Your invoice is due on {{Invoice Due Date}}.",
}

Elements to populate text components

Element     Type Description
text     object Defines styles, behaviors, and content for text components.
 

type 

  string

Required. Defines the component type as text.

Valid value:

text
 

properties

  object Required. Define visibility.
    visible boolean

Required.

Defines whether component appears on invoices.

Valid values:

true | false
  style   object

Required. Defines formatting for the text.

Valid values: HTML element names and CSS styles for the named HTML element.

All HTML styles. Only relevant styles that the Invoice Builder can render appear in the user interface preview and the PDF.

Examples:

"color": "#333"
"font-size": "12pt"
  data   string

Required. Text, one or more tokens, or both.

Token format:

{{Token Name}}

Valid values:

All text and tokens from a token category that is valid for the component that contains the text component. For example, invoice lines table component or footer. See Tokens.

Examples: See the Data property examples section in this topic.

Data property examples

Examples of how you can combine text and tokens are shown in the following table.

Example type JSON value Output
Text (simple binding) Please pay by the due date. Please pay by the due date.
Data (simple binding) {{Invoice Due Date}} July 1, 2030
Text and data (compound binding) Due date: {{Invoice Due Date}} Due date: July 1, 2030