Upsert Items
upsert_itemsCreate or update catalog items by SKU (max 500 per call) — the direct seeding path for catalogs that don't arrive via import_historical_sales_orders or a channel sync, and the way to enrich existing items. Besides cost, price, barcodes and type, a row can set the built-in attributes: dimensions (length/width/height/diameter + dimensionUom), weight + weightUom, volume + volumeUom, cartonQuantity, tags, preferredLocation (bin), listPrice, shortDescription, note, taxable, salesTaxRate, isBackorderAllowed, isECommerceAvailable, manufacturingLeadTimeDays, launchDate and carryingCostPerUnitPerMonth. Use these rather than creating custom fields for the same facts. Whether an item is built, bought or transferred is not an item field: an item with a primary bill of materials is built (set_bill_of_materials), any other is bought, and a Transfer-mode warehouse is stocked by transfer (set_warehouse_supply_route). A bought item is ordered from defaultSupplierId, or at a warehouse listed in warehouseSuppliers from that warehouse's supplier (reorder POs, reorder-point lead time, reorder list). Identity is the SKU within the credential's client namespace; matching is case-insensitive. Existing items are preserve-on-omit — omitted fields keep their current values; supplied upcs REPLACE the barcode list. New items default to type=inventory and the tenant's default tax/UoM; missing standard UoMs (Each/oz/lb/fl oz/in/ft) are bootstrapped automatically (reported via uomsCreated). An optional per-row imageUrl (absolute http/https, default port only) downloads and sets the item's main product image, replacing any current one; image failures are reported per-row via imageStatus and never fail the row. Image downloading for the whole call is time-budgeted: once it is spent, later rows still create/update but report imageStatus=failed — resubmit those rows in a smaller batch. Set validateOnly=true first to get every row's would_create/would_update/invalid verdict without writing — including the one tenant-level create blocker (no tax rate configured; fix it with upsert_tax_rates) — then re-call without it to apply. An optional per-row customFields map (see list_custom_fields, entity=item) writes tenant-defined field values; an unknown fieldName fails just that row. Partial success: valid rows land even when siblings fail; resubmitting is safe (the upsert converges). A client-pinned credential seeds its own client's namespace; an operator credential on a 3PL tenant passes clientId to name the target client.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"items": "<items>"
},
"name": "upsert_items"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | Item rows to create/update (max 500). sku is required per row. | |
| clientId | No | Operator (unpinned) credentials on 3PL tenants: the target client id (GUID) the rows belong to — get ids from list_clients. Client-pinned credentials omit this; the credential decides. | |
| validateOnly | No | true = dry-run: validate + probe every row and report would_create/would_update per row, writing nothing. Recommended before the first real call. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | ||
| total | No | ||
| failed | No | ||
| created | No | ||
| updated | No | ||
| uomsCreated | No | ||
| validateOnly | No | ||
| enabledCustomers | No |