JSON & XML Payloads

Docamint accepts both JSON and XML payloads. The structure of your data determines how tags resolve inside your Word templates.

JSON
JSON Structure
JSON is the most common format used with Docamint. A typical payload looks like:
{ "customer": { "name": "Acme Corporation", "address": { "street": "123 Market Street", "city": "Springfield", "state": "IL" } }, "order": { "number": "INV-2026-001", "date": "2026-07-25", "items": [ { "name": "Laptop", "qty": 1, "total": 1299.50 }, { "name": "Mouse", "qty": 2, "total": 50.00 } ], "total": 1349.50 } }

Tags inside your template match this structure exactly:

{{customer.name}} {{customer.address.city}} {{order.number}} {{#each order.items}} {{this.name}} - {{this.qty}} {{/each}}
XML
XML Structure
XML payloads follow the same logical structure:
Acme Corporation
123 Market Street Springfield IL
INV-2026-001 2026-07-25 Laptop 1 1299.50 Mouse 2 50.00 1349.50

Tags work the same way:

{{customer.name}} {{#each order.items}} {{this.name}} {{/each}}
Arrays
Arrays & Lists
Arrays in JSON or repeated XML nodes map directly to loops:
{{#each transactions}} Transaction {{this.id}} - {{this.amount | currency}} {{/each}}
Nested
Nested Objects
Docamint supports deeply nested structures:
{{#each company.divisions}} Division: {{this.name}} {{#each this.teams}} Team: {{this.name}} {{/each}} {{/each}}
Tips
Best Practices
Follow these guidelines for clean payloads:
  • Use consistent naming conventions
  • Prefer arrays for repeating content
  • Keep nested objects organized
  • Ensure dates are ISO formatted (YYYY-MM-DD)
  • Use numbers for numeric fields (not strings)