Import QuickBooks Master Data
import_qbo_master_dataBring the connected QuickBooks Online company's products, vendors (as suppliers) and customers into Spark as records, and optionally QuickBooks' on-hand quantities as opening stock. Requires the governed two-step protocol. Call it with preview=true first (the default): it reads QuickBooks and reports what would be matched, created or skipped, writing nothing, and returns a single-use previewReceipt. Show the person those counts and ask; once they agree, repeat the identical call with that previewReceipt and a fresh idempotencyKey to import. The receipt covers the QuickBooks records the preview read: if QuickBooks changes before the import, the import is refused with PREVIEW_RECEIPT_REJECTED and nothing is written; preview again and show the new counts. preview=false without a receipt is refused with PREVIEW_RECEIPT_REQUIRED. Products match Spark items by Spark's link, then SKU, then name; matched records keep their values and only blanks are filled. With createUnmatchedItems=false nothing new is created (use it when a store such as Shopify is the catalog). openingStock sets Spark's quantity to QuickBooks' (zero included) at the Internal warehouse, or warehouseId when there are several; it replaces the current on-hand. Safe to run again: it matches what it brought in before. Run it before the QuickBooks sales and purchase backfills so history lands on these items. Refused on a 3PL account and without a working QuickBooks connection. Requires an operator (unpinned) write credential with imports.execute, and an admin.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "import_qbo_master_data"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | No | QuickBooks products (inventory and non-inventory items). | |
| preview | No | True (default) reports what would happen, writes nothing and returns a previewReceipt. The import itself needs previewReceipt and idempotencyKey. | |
| vendors | No | QuickBooks vendors, as Spark suppliers with email, phone and payment terms. | |
| customers | No | QuickBooks customers. Store pseudo-customers and sub-customers are skipped. | |
| warehouseId | No | With openingStock: the Internal warehouse to set stock at (from list_warehouses). Needed only when the account has several. | |
| openingStock | No | Set Spark's on-hand to QuickBooks' quantity for the products QuickBooks tracks. | |
| idempotencyKey | No | Caller-generated idempotency key; required with previewReceipt to import. A retry with the same key returns the first import's result without importing again. | |
| previewReceipt | No | Step 2 of the required two-step write: the receipt the preview returned. Supply it with a fresh idempotencyKey and the same arguments to import. | |
| createUnmatchedItems | No | With items: also create a Spark item for each QuickBooks product that matches none. False only links products to existing Spark items. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| preview | No | ||
| wouldDo | No | ||
| imported | No | ||
| nextStep | No | ||
| expiresAt | No | ||
| errorCount | No | ||
| actionItemId | No | ||
| confirmation | No | ||
| correlationId | No | ||
| approvalResult | No | ||
| idempotencyKey | No | ||
| previewReceipt | No | ||
| idempotentReplay | No | ||
| sourceFingerprint | No | ||
| ambiguousItemCount | No |