skuIdMap Pattern
Forquoting_extension tools that work with known SKU codes, the recommended pattern is:
- At tool init, call
products.list()and build a local{ [sku]: productId }lookup. - Your tool’s internal logic works with human-readable SKU codes (from a pricing spreadsheet, config object, or product catalogue).
- When building lines for
quotes.addLines, look up each SKU inskuIdMapand pass bothproductCode(the SKU string) andproductId(the GUID). This triggers task template injection on the host. - Fall back gracefully: if a SKU is not found in
skuIdMap, send the line withoutproductId. The line still appears in the quote as free-form text - no task injection, but no error.
DTO Shapes
Four line kinds (lineType)
When
lineType is omitted (or set to "product") and linkedItemId is null, the host falls back to the legacy productId field - keeping Ziptrak v2.1.2 and earlier extensions working unchanged.
Section grouping
Quote lines are visually grouped bysection in both the operator’s quote editor and the customer-facing quote preview. Use a small set of stable labels per tool - e.g. for an indoor blinds extension: "Blinds", "Motorisation", "Installation", "Removal", "Extras". Lines with no section render in a trailing “Ungrouped” block.
Summary-only sections
SetsummaryOnly: true on every line of a section to collapse it on customer-facing output. The section prints as a single row carrying its name and total; the individual lines are suppressed. Use this for cost groups that should not be negotiated line by line - travel, shipping and installation are the common case.
The lines still exist in full: the operator sees them itemised in the quote editor, they carry through to job costing on quote-to-job conversion, and they contribute to the quote’s grand total exactly as before. Only the customer-facing rendering changes.
Section identity is the pair (section, summaryOnly), not section alone. Two lines with the same section label but different summaryOnly values resolve to two separate sections with the same name - which lets a tool itemise part of a category and collapse the rest, but also means an inconsistent flag across a section’s lines will split it in two. Set the flag identically on every line you intend to land in one section.
A collapsed section always prints its total, even for tenants whose quote template has section subtotals or unit prices switched off.