LedgerWire

Bill · Add

simulated in sandbox

BillAdd

Bills record what you owe a vendor. They post to Accounts Payable and can carry expense lines (an account) and item lines (inventory you bought).

qbXML request

BillAddRq
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
  <QBXMLMsgsRq onError="stopOnError">
    <BillAddRq requestID="1">
      <BillAdd>
        <VendorRef>
          <FullName>City Utilities</FullName>
        </VendorRef>
        <TxnDate>2026-11-01</TxnDate>
        <DueDate>2026-12-01</DueDate>
        <RefNumber>UT-1105</RefNumber>
        <ExpenseLineAdd>
          <AccountRef>
            <FullName>Utilities</FullName>
          </AccountRef>
          <Amount>312.40</Amount>
          <Memo>October electric</Memo>
        </ExpenseLineAdd>
      </BillAdd>
    </BillAddRq>
  </QBXMLMsgsRq>
</QBXML>

JSON equivalent

POST /v1/bills
{
  "dueDate": "2026-12-01",
  "txnDate": "2026-11-01",
  "refNumber": "UT-1105",
  "vendorRef": {
    "fullName": "City Utilities"
  },
  "expenseLines": [
    {
      "memo": "October electric",
      "amount": 312.4,
      "accountRef": {
        "fullName": "Utilities"
      }
    }
  ]
}
curl
curl -X POST https://ledgerwire.vibiz.app/v1/bills \
  -H "Authorization: Bearer $LEDGERWIRE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"dueDate":"2026-12-01","txnDate":"2026-11-01","refNumber":"UT-1105","vendorRef":{"fullName":"City Utilities"},"expenseLines":[{"memo":"October electric","amount":312.4,"accountRef":{"fullName":"Utilities"}}]}'

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)

BillAddRs
<?xml version="1.0" ?>
<QBXML>
  <QBXMLMsgsRs>
    <BillAddRs requestID="1" statusCode="0" statusSeverity="Info" statusMessage="Status OK">
      <BillRet>
        <TxnID>34A-1793835062</TxnID>
        <TimeCreated>2026-11-04T23:31:02+00:00</TimeCreated>
        <TimeModified>2026-11-04T23:31:02+00:00</TimeModified>
        <EditSequence>1793835062</EditSequence>
        <TxnNumber>7000</TxnNumber>
        <VendorRef>
          <FullName>City Utilities</FullName>
        </VendorRef>
        <APAccountRef>
          <ListID>80000007-1760311862</ListID>
          <FullName>Accounts Payable</FullName>
        </APAccountRef>
        <TxnDate>2026-11-01</TxnDate>
        <DueDate>2026-12-01</DueDate>
        <RefNumber>UT-1105</RefNumber>
        <TermsRef>
          <FullName>Net 30</FullName>
        </TermsRef>
        <AmountDue>1433.52</AmountDue>
        <OpenAmount>1433.52</OpenAmount>
        <IsPaid>false</IsPaid>
        <ExpenseLineRet>
          <TxnLineID>undefined</TxnLineID>
          <AccountRef>
            <FullName>Utilities</FullName>
          </AccountRef>
          <Amount>312.40</Amount>
          <Memo>October electric</Memo>
        </ExpenseLineRet>
        <ItemLineRet>
          <TxnLineID>34B-1793835062</TxnLineID>
          <ItemRef>
            <ListID>8000003D-1794871862</ListID>
            <FullName>Faucet Kitchen</FullName>
          </ItemRef>
          <Desc>Pull-down kitchen faucet</Desc>
          <Quantity>18</Quantity>
          <Cost>79.64</Cost>
          <Amount>1433.52</Amount>
        </ItemLineRet>
      </BillRet>
    </BillAddRs>
  </QBXMLMsgsRs>
</QBXML>

FAQ

What is required in BillAdd?

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

Why does BillAdd fail with status 3140?

3140 means a reference (for example VendorRef 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.

Can I set my own RefNumber on a bill?

Yes. RefNumber is free text (up to 11 characters for most transactions). If you leave it out, QuickBooks auto-numbers when the preference is on.

Sandbox fidelity

The LedgerWire sandbox simulates BillAdd 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 Bill messages

Other Add messages

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

Get a free sandbox key