LedgerWire

ItemInventory · Add

simulated in sandbox

ItemInventoryAdd

Inventory items are stock QuickBooks tracks with quantity on hand and average cost. They need an income, a COGS and an asset account.

qbXML request

ItemInventoryAddRq
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
  <QBXMLMsgsRq onError="stopOnError">
    <ItemInventoryAddRq requestID="1">
      <ItemInventoryAdd>
        <Name>Thermostat T8</Name>
        <SalesDesc>Smart thermostat</SalesDesc>
        <SalesPrice>189.00</SalesPrice>
        <IncomeAccountRef>
          <FullName>Sales Income</FullName>
        </IncomeAccountRef>
        <PurchaseCost>104.00</PurchaseCost>
        <COGSAccountRef>
          <FullName>Cost of Goods Sold</FullName>
        </COGSAccountRef>
        <AssetAccountRef>
          <FullName>Inventory Asset</FullName>
        </AssetAccountRef>
      </ItemInventoryAdd>
    </ItemInventoryAddRq>
  </QBXMLMsgsRq>
</QBXML>

JSON equivalent

POST /v1/items
{
  "name": "Thermostat T8",
  "type": "inventory",
  "salesDesc": "Smart thermostat",
  "salesPrice": 189,
  "purchaseCost": 104,
  "cogsAccountRef": {
    "fullName": "Cost of Goods Sold"
  },
  "assetAccountRef": {
    "fullName": "Inventory Asset"
  },
  "incomeAccountRef": {
    "fullName": "Sales Income"
  }
}
curl
curl -X POST https://ledgerwire.vibiz.app/v1/items \
  -H "Authorization: Bearer $LEDGERWIRE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Thermostat T8","type":"inventory","salesDesc":"Smart thermostat","salesPrice":189,"purchaseCost":104,"cogsAccountRef":{"fullName":"Cost of Goods Sold"},"assetAccountRef":{"fullName":"Inventory Asset"},"incomeAccountRef":{"fullName":"Sales Income"}}'

Run this request against your own sandbox

Add and Mod requests change data, so they run in a private sandbox, not the shared demo. Get a free key (10 seconds), then POST the request above to /v1/qbxml.

qbXML response (from the sandbox seed data)

ItemInventoryAddRs
<?xml version="1.0" ?>
<QBXML>
  <QBXMLMsgsRs>
    <ItemInventoryAddRs requestID="1" statusCode="0" statusSeverity="Info" statusMessage="Status OK">
      <ItemInventoryRet>
        <ListID>8000002D-1794871862</ListID>
        <TimeCreated>2026-02-04T23:59:57+00:00</TimeCreated>
        <TimeModified>2026-02-04T23:59:57+00:00</TimeModified>
        <EditSequence>1770249597</EditSequence>
        <Name>Thermostat T8</Name>
        <FullName>Copper Pipe 1/2in</FullName>
        <IsActive>true</IsActive>
        <Sublevel>0</Sublevel>
        <QuantityOnHand>108</QuantityOnHand>
        <AverageCost>18.20</AverageCost>
        <AssetAccountRef>
          <FullName>Inventory Asset</FullName>
        </AssetAccountRef>
        <COGSAccountRef>
          <FullName>Cost of Goods Sold</FullName>
        </COGSAccountRef>
        <IncomeAccountRef>
          <FullName>Sales Income</FullName>
        </IncomeAccountRef>
        <PurchaseCost>104.00</PurchaseCost>
        <PurchaseDesc>Copper pipe, 1/2 in x 10 ft</PurchaseDesc>
        <ReorderPoint>2</ReorderPoint>
        <SalesDesc>Smart thermostat</SalesDesc>
        <SalesPrice>189.00</SalesPrice>
      </ItemInventoryRet>
    </ItemInventoryAddRs>
  </QBXMLMsgsRs>
</QBXML>

FAQ

What is required in ItemInventoryAdd?

`name`, `type` at minimum. Elements must appear in the order the qbXML schema lists them; LedgerWire orders them for you when you send JSON.

Why does ItemInventoryAdd fail with status 3140?

3140 means a reference (for example ParentRef or an ItemRef) points at something that does not exist in the company file. Look the record up first, or create it, and pass its ListID.

Why does ItemInventoryAdd fail with status 3100?

The Name is already in use. QuickBooks requires unique names across customers, vendors, employees and other names, and within each item list. Query for the existing record and update it instead.

Sandbox fidelity

The LedgerWire sandbox simulates ItemInventoryAdd with QuickBooks rules: required fields, element names, refs that must exist (3140), unique names (3100), field lengths (3070) and EditSequence locking (3200). Tax calculation, custom fields and preferences are not simulated.

More ItemInventory messages

Other Add messages

Skip the XML: call POST /v1/items with JSON.

Get a free sandbox key