Draft Document Configuration

Draft document rules let you control when a document should require review before final release.

In the web portal, this is configured under Configuration > Billing > Draft Document.

The rules are based on JSONata expressions and evaluate document data from the invoice structure of the Document API.

When to use draft document rules

Draft document rules are useful when certain documents should be reviewed before they are finalized.

Typical examples include:

  • high invoice amounts
  • specific currencies
  • specific billing groups
  • country-specific checks

Where to find the configuration

In the web portal, navigate to:

Configuration > Billing > Draft Document

On this page, you can:

  • create a new rule
  • edit an existing rule
  • delete a rule
  • view the configured JSONata expression and description

Create a draft document rule

When creating or editing a rule, the following fields are available:

Description

Use this field to document the purpose of the rule.

Example:

Create draft documents for invoices above 10,000 EUR

JSONata Rule

Define the condition that determines whether a document should be created as a draft.

Example:

currency = "EUR" and documentTotals.totalNetSum > 10000

If the expression evaluates to true, the document is created as a draft.

If the expression is invalid, the UI displays a validation error.

How rule evaluation works

You can configure multiple draft document rules per tenant.

Rules are evaluated with OR logic: • if at least one rule evaluates to true, the document is created as a draft • if no rule evaluates to true, the document is processed without draft enforcement

JSONata examples

  1. Create a draft for all documents with a net amount above 10,000 EUR
    currency = "EUR" and documentTotals.totalNetSum > 10000
  2. Create a draft for all documents in a specific billing group
    billingGroupIdent = "xy"
  3. Create a draft for all CHF documents with a net amount above 5,000 CHF
    currency = "CHF" and documentTotals.totalNetSum > 5000
  4. Create a draft for all documents with invoice country Romania
    customerDetail.invoiceAddress.country = "RO"