Skip to main content

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. For more infofrmation, 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.

Default template JSON sample​

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

To download the default template

πŸ“ Note: If the AppDirect logo appears in the upper-left corner of the page, when Manage > Marketplace appears in this topic, click the grid icon > Switch to | Store, instead.

  1. Go to Manage > Marketplace > Settings > Invoice templates > Appdirect Template_EN_US | Gear icon | Download JSON .

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​

ElementTypeDescription
bodyobjectRequired. Defines content, styles, and behaviors for the body section.
typestringRequired. Defines the component type as row.
Valid value: row
styleobjectRequired. 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"
propertiesobjectRequired. Define visibility.
visiblebooleanRequired. Defines whether component appears on invoices.
Valid values: true | false
componentsarrayRequired. Cells and horizontal spacers, both style components, that define the location of content in the row. At least one cell is required.
Valid components: cellhorizontalSpacer

For information on cell components and horizontal spacers, see:
Build cell components
Build horizontal spacers

Was this page helpful?