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.