Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.heffl.com/llms.txt

Use this file to discover all available pages before exploring further.

Document templates

Document templates are the layout and settings presets used when you create documents in Heffl — not project templates or email templates. Each template belongs to one document type, for example:
  • Quotations (type: quotations)
  • Invoices (type: invoices)
  • Proforma invoices (type: proforma_invoices)
  • Purchase orders (type: purchase_orders)
  • Bills, sales orders, documents, and other types supported in your workspace
They control PDF/HTML layout, numbering, signatures, and template-scoped custom fields. In API v2, each template has a prefixed string id (tpl_ prefix). Use it as templateId when creating records that require a template (for example POST /quotations).

List templates

Filter by document type to find templates for a specific workflow:
curl "https://api.heffl.com/api/v2/document-templates?type=quotations" \
  -H "x-api-key: YOUR_API_KEY"
Optional query parameters:
ParameterDescription
typeDocument type — quotations, invoices, proforma_invoices, purchase_orders, bills, sales_orders, documents, etc.
searchCase-insensitive prefix match on template name
includeInactiveWhen true, includes inactive templates
Response:
{
  "data": [
    {
      "id": "tpl_abc123",
      "name": "Standard quotation",
      "type": "quotations",
      "isActive": true,
      "isSignatureRequired": false,
      "valueType": "DYNAMIC"
    }
  ]
}

Get a template

Use this when you need template-scoped custom field keys before creating a quotation:
curl "https://api.heffl.com/api/v2/document-templates/tpl_abc123" \
  -H "x-api-key: YOUR_API_KEY"
The response includes a customFields array. Use each key as a top-level cf_* field on POST /quotations (same convention as Custom fields).

Create a quotation

  1. List templates with type=quotations and pick an id.
  2. Optionally call GET /document-templates/{id} for customFields.
  3. Create the quotation with templateId:
curl -X POST "https://api.heffl.com/api/v2/quotations" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "clientId": "clt_abc123",
    "templateId": "tpl_abc123",
    "date": "2026-05-31T00:00:00.000Z",
    "quotationProducts": [
      { "name": "Discovery workshop", "quantity": 1, "price": 2500 }
    ]
  }'
templateId cannot be changed after creation. See API v2 overview — Quotations.
  • ID prefixestpl_ template IDs
  • Custom fields — team-wide field definitions; template detail also lists template-scoped fields