Skip to main content

Read Methods

All read methods are available to both standalone and quoting_extension tool types.

context.get()

Returns the current user and tenant context.
const ctx = await window.pipeline.context.get();
// Returns:
// {
//   userName: "Jane Smith",
//   userEmail: "jane@example.com",
//   userRole: "H_Admin",
//   tenantName: "Acme Corp",
//   tenantId: "abc-123",
//   cultureCode: "en-NZ"
// }

customers.list(options?)

Returns a paginated list of customers.
const result = await window.pipeline.customers.list({ page: 1, pageSize: 50 });
// Returns:
// {
//   items: [{ id: "...", name: "John Doe", email: "john@example.com", phone: "021..." }],
//   totalCount: 150,
//   page: 1,
//   pageSize: 50
// }

products.list(options?)

Returns a paginated list of products/services. The sku field is the human-readable product code from Stock_SKU.SKU — use this for stable cross-environment product references (GUIDs can vary between environments).
const result = await window.pipeline.products.list({ page: 1, pageSize: 50 });
// Returns:
// {
//   items: [
//     { id: "a1b2c3d4-...", sku: "WGT-001", name: "Widget A", price: 29.99, unit: "T_ITEM" }
//   ],
//   totalCount: 42,
//   page: 1,
//   pageSize: 50
// }
Response item fields: id (GUID), sku (human-readable code), name, price (retail sell price), unit (UOM token).

jobs.list(options?)

Returns a paginated list of active jobs for the tenant. Available to all tool types.
const result = await window.pipeline.jobs.list({ page: 1, pageSize: 50 });
// Returns:
// {
//   items: [
//     {
//       id: "e5f6a7b8-...",
//       ref: "JOB-0042",
//       customerName: "Acme Corp",
//       customerIdGuid: "c1d2e3f4-...",
//       status: "InProgress"
//     }
//   ],
//   totalCount: 12,
//   page: 1,
//   pageSize: 50
// }
Response item fields: id (GUID), ref (human-readable job reference), customerName, customerIdGuid (GUID), status.

quotes.list(options?)

Returns a paginated list of quotes.
const result = await window.pipeline.quotes.list({ page: 1, pageSize: 50 });
// Returns:
// {
//   items: [{ id: "...", ref: "QR-001", customerName: "John Doe", total: 115.00, status: "Draft", date: "2026-04-16T00:00:00" }],
//   totalCount: 25,
//   page: 1,
//   pageSize: 50
// }

Write Methods

quotes.create(request)

Creates a new quote in Pipeline. Available to all tool types. Marketplace tools do NOT need API keys or inbound tokens — the bridge handles all authentication through the current user’s Pipeline session.
const result = await window.pipeline.quotes.create({
  customerName: "John Doe",
  customerEmail: "john@example.com",
  customerPhone: "021 123 4567",
  upsertByEmail: true,
  title: "Quick Quote",
  quoteRef: "",
  lines: [
    {
      description: "Widget A",
      productCode: "WGT-001",
      qty: 2,
      unitPrice: 29.99,
      taxRate: 0.15
    }
  ]
});
// Returns:
// {
//   id: "abc-123-...",
//   ref: "QR-042",
//   total: 68.98
// }
Request fields:
FieldTypeRequiredDescription
customerNamestringNoCustomer display name
customerEmailstringConditionalRequired when upsertByEmail is true
customerPhonestringNoCustomer phone number
upsertByEmailbooleanNoIf true, creates or matches customer by email
titlestringNoQuote title
quoteRefstringNoCustom quote reference
linesarrayYesAt least one line item required
Line item fields:
FieldTypeRequiredDescription
descriptionstringNoLine item description
productCodestringNoProduct code reference
qtynumberYesQuantity (1-10000)
unitPricenumberYesUnit price (0-1000000)
taxRatenumberYesTax rate as decimal (e.g. 0.15 for 15%)
Validation rules:
  • Lines array must not be empty
  • Maximum 200 line items per quote
  • Quantity must be > 0 and <= 10,000
  • Unit price must be >= 0 and <= 1,000,000

quotes.addLines(lines)

Available to quoting_extension tools only. Appends one or more lines to the currently-open quote. No server round-trip — the host merges the lines into its in-memory quote and the user saves normally. Calling this method from a standalone tool will return an error.
await window.pipeline.quotes.addLines([
  {
    description: "Widget A",
    productCode: "WGT-001",
    productId: "a1b2c3d4-...",
    qty: 2,
    unitPrice: 59.99,
    costPrice: 35.00,
    taxRate: 15,
    location: "Kitchen",
    specification: "White, 600x900",
    unit: "T_ITEM",
    groupKey: "item-1"
  }
]);
BridgeAddLineDto fields — all 11 fields:
FieldTypeRequiredDescription
descriptionstringoptionalFree-text line description. Displayed as the line name in the quote.
productCodestringoptionalHuman-readable SKU code. Stored as WorkObjectCode on the quote line. Pair with productId for full SKU linking.
productIdstring (GUID)optionalProduct GUID from products.list(). When set, the host injects the SKU’s task template sequence into the line — scheduling tasks, material requirements, etc. When omitted, the line is free-form with no task injection.
qtynumberrequiredLine quantity. Must be > 0.
unitPricenumberrequiredRetail/sell price per unit. Markup must already be applied — the host does not re-mark up.
costPricenumberoptionalBuy/cost price per unit. When provided: BUY column = costPrice, SELL column = unitPrice (real margin visible in COB panel). When omitted: both BUY and SELL use unitPrice (legacy behaviour, zero margin).
taxRatenumberrequiredTax rate. Accepted as percentage (e.g. 15) or decimal fraction (e.g. 0.15) — the host normalises.
locationstringoptionalLocation or zone label. Maps to QuoteLine.FreeTextField2. Use for room, area, or zone labels (e.g. "Patio", "Living Room").
specificationstringoptionalConfiguration or specification detail. Maps to QuoteLine.FreeTextField. Use for dimensions, colours, or model info.
unitstringoptionalUnit of measure token. Valid values: "T_ITEM" (default, each/unit), "T_SQUARE_METRE" (m²), "T_LINEAR_METRE" (lm).
groupKeystringoptionalArbitrary stable string identifier. Lines sharing the same groupKey receive the same QuoteLine.GroupId on the host, keeping related lines visually grouped in the quote UI (e.g. a blind, its pelmet, and injected install task all share one group). Lines without a groupKey are ungrouped (GroupId = 0).