Skip to main content

Using Template Variables in API Request Bodies for Workflows

Use template variables in Kolleno workflows to send dynamic ERP and customer data in API calls.

When building API calls within Kolleno Workflows, you can insert dynamic data directly into the request body. This allows your workflows to pass customer, invoice, credit note, payment, and other objects’ information to external systems in real time.

Please note the below only provides some examples. You can contact support for information about the field that you need.

To learn how to make an API call in a workflow, see
👉 Make an API call with Kolleno Workflows


How Template Variables Work

Kolleno uses a simple variable-tag format to let you reference fields from any object in your workflow.

You can access both Kolleno fields and ERP-synced fields using dot notation (.) to drill into nested properties.

Double-underscore notation, such as {{customer__ref}}, no longer works. The value comes out empty, and the request can still go out. If a template uses __ between object and field names, change it to the notation in this article.

General Pattern

{{object.field_name}}

Invoices, credit notes, payments, and payment charges are lists, so add .0 after the object name to read the record in the workflow:

{{invoices.0.field_name}}

Accessing ERP Source Data

ERP data is stored in source_original_data. It is available for customers, invoices, credit notes, payments, and persons.
Use this pattern:

{{object.source_original_data.FieldName}}

Example:

{   
"erp_customer_id": "{{customer.source_original_data.CustomerID}}",
"erp_invoice_number": "{{invoices.0.source_original_data.InvoiceNumber}}"
}

Object-Level Reference Guide

Below is a list of objects and examples of their accessible fields, including ERP data.


Customer Level

Standard Fields

  • {{customer.name}}

  • {{customer.balance}}

  • {{customer.ref}}

ERP Fields

  • {{customer.source_original_data.CustomerID}}

  • {{customer.source_original_data.AccountNumber}}

  • Any custom ERP field:
    ​{{customer.source_original_data.CustomField}}

Example:

{   
"customer_name": "{{customer.name}}",
"outstanding_balance": "{{customer.balance}}",
"erp_customer_id": "{{customer.source_original_data.CustomerID}}",
"erp_account_code": "{{customer.source_original_data.AccountCode}}"
}

Invoice Level

Standard Fields

  • {{invoices.0.ref}}

  • {{invoices.0.amount}}

  • {{invoices.0.balance}}

Customer fields remain available here:

  • {{customer.name}}

ERP Fields

  • {{invoices.0.source_original_data.InvoiceID}}

  • {{invoices.0.source_original_data.DocumentNumber}}

  • {{invoices.0.source_original_data.DueDate}}

Example:

{   
"invoice_ref": "{{invoices.0.ref}}",
"invoice_amount": "{{invoices.0.amount}}",
"erp_invoice_id": "{{invoices.0.source_original_data.InvoiceID}}",
"erp_document_number": "{{invoices.0.source_original_data.DocumentNumber}}"
}

Credit Note Level

Standard Fields

  • {{credit_notes.0.ref}}

  • {{credit_notes.0.amount}}

  • {{credit_notes.0.amount_remaining}}

ERP Fields

  • {{credit_notes.0.source_original_data.CreditNoteID}}

  • {{credit_notes.0.source_original_data.CreditMemoNumber}}

Example:

{   
"credit_note_ref": "{{credit_notes.0.ref}}",
"credit_amount": "{{credit_notes.0.amount}}",
"erp_credit_note_id": "{{credit_notes.0.source_original_data.CreditNoteID}}"
}

Payment Level

Standard Fields

  • {{transactions.0.amount}}

  • {{transactions.0.date_paid}}

  • {{workflow_object.transaction.status}}

ERP Fields

  • {{transactions.0.source_original_data.TransactionID}}

  • {{transactions.0.source_original_data.PaymentReference}}

  • {{transactions.0.source_original_data.PaymentMethod}}

Example:

{   
"transaction_amount": "{{transactions.0.amount}}",
"status": "{{workflow_object.transaction.status}}",
"erp_transaction_id": "{{transactions.0.source_original_data.TransactionID}}",
"erp_payment_ref": "{{transactions.0.source_original_data.PaymentReference}}"
}

Payment Charge Level

Standard Fields

  • {{payment_charges.0.amount}}

  • {{workflow_object.payment_charge.status}}

Example:

{   
"charge_amount": "{{payment_charges.0.amount}}",
"charge_status": "{{workflow_object.payment_charge.status}}"
}

Customer Group Level

Standard Fields

  • {{customer_group.count_customers}}

  • {{customer_group.balance}}

  • {{customer_group.balance_overdue}}

Example:

{   
"group_customer_count": "{{customer_group.count_customers}}",
"total_balance": "{{customer_group.balance}}"
}

Email Received Level

Standard Fields

  • {{email_received.subject}}

  • {{email_received.email_address_from}}

  • {{email_received.body_text}}

Example:

{   
"subject": "{{email_received.subject}}",
"from": "{{email_received.email_address_from}}",
"content": "{{email_received.body_text}}"
}

Email Sent Level

Standard Fields

  • {{email_sent.subject}}

  • {{email_sent.body_text}}

  • {{email_sent.date_sent}}

Example:

{   
"subject": "{{email_sent.subject}}",
"content": "{{email_sent.body_text}}",
"date_sent": "{{email_sent.date_sent}}"
}

Note Level

Standard Fields

  • {{note.content_text}}

  • {{note.date_noted}}

Example:

{   
"note_content": "{{note.content_text}}",
"note_date": "{{note.date_noted}}"
}

Payment Plan Level

Standard Fields

  • {{payment_plan.amount_total}}

  • {{payment_plan.status}}

  • {{payment_plan.amount_remaining}}

Example:

{   
"plan_amount": "{{payment_plan.amount_total}}",
"plan_status": "{{payment_plan.status}}",
"plan_amount_remaining": "{{payment_plan.amount_remaining}}"
}

Person Level

Standard Fields

  • {{person.first_name}}

  • {{person.last_name}}

  • {{person.email_address}}

ERP Fields

  • {{workflow_object.person.source_original_data.ContactID}}

  • {{workflow_object.person.source_original_data.EmployeeNumber}}

Example:

{   
"first_name": "{{person.first_name}}",
"last_name": "{{person.last_name}}",
"erp_contact_id": "{{workflow_object.person.source_original_data.ContactID}}"
}

Text Message Sent Level

Standard Fields

  • {{text_message_sent.message}}

  • {{text_message_sent.to_number}}

  • {{text_message_sent.date_sent}}

Example:

{   
"message_body": "{{text_message_sent.message}}",
"recipient": "{{text_message_sent.to_number}}"
}

Important Notes

  • Customer fields are accessible from any workflow level using {{customer.field_name}}.

  • Use dots (.) to navigate nested structures (e.g., {{customer.currency.iso}}).

  • When used in API request bodies, all values are automatically escaped for JSON.

  • ERP field names must match exactly what your ERP provides. If a field name itself contains a double underscore, keep it (e.g., {{customer.source_original_data.My_Field__c}}).

  • Nested ERP fields can be accessed with additional dots, for example:
    ​{{customer.source_original_data.Address.Street}}

Did this answer your question?