Build body

The body section is a row component, which is a horizontal layout container. It contains an array of cell (required) and horizontal spacer (optional) components to define where on invoice pages content appears. Within the cells, additional layout and elementary components define invoice content that appears on invoice pages.

Note: The body is a row component. Therefore, you can add cells and horizontal spacers to it. This differs from headers and footers which are not row components. To them, you need to add rows first, and then add cells and horizontal spacers within them. (See Build headers and Build footers.)

The body of the default invoice templates include invoice lines, tax lines, subtotals and total, and can optionally contain other components. Content in the body appears on the first page of the invoice, and the body automatically expands across as many subsequent pages as needed to display all the content.

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 body.

Prerequisites

None.

Default template JSON sample

In the Appdirect Template_EN_US default template, see lines 190-1113.

To download the default template, go to .

JSON structure context for body

Body is one of three sections in the highest-level template structure, in addition to page.

{
    "page": {},
    "header": {},
    "body": {},
    "footer": {}
}

Body JSON schema

{
  "body": {
    "type": "row",
    "style": { },
    "properties": {
        "visible": <true | false>
    },
    "components": [
        {
        // Can contain Components of 'type:cell or horizontalSpacer' only
        }
    ]
}

Elements to build body section

Element     Type Description
body     object Required. Defines content, styles, and behaviors for the body section.
  type   string

Required. Defines the component type as row.

Valid value:

row
  style   object

Required. Defines formatting for the body.

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.

Example:

"line-height": "10px"
  properties   object Required. Define visibility.
    visible boolean

Required.

Defines whether component appears on invoices.

Valid values:

true | false
  components   array

Required.

Cells and horizontal spacers, both style components, that define the location of content in the row. At least one cell is required.

Valid components:

cell
horizontalSpacer

See:

Build cell components

Build horizontal spacers