LedgerWire

Invoice · Add

simulated in sandbox

InvoiceAdd

Invoices record a sale on credit. QuickBooks posts them to Accounts Receivable and tracks BalanceRemaining until received payments are applied.

qbXML request

InvoiceAddRq
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
  <QBXMLMsgsRq onError="stopOnError">
    <InvoiceAddRq requestID="1">
      <InvoiceAdd>
        <CustomerRef>
          <FullName>Bayside Builders LLC</FullName>
        </CustomerRef>
        <TxnDate>2026-11-09</TxnDate>
        <RefNumber>1201</RefNumber>
        <Memo>October service</Memo>
        <InvoiceLineAdd>
          <ItemRef>
            <FullName>Installation</FullName>
          </ItemRef>
          <Quantity>6</Quantity>
          <Rate>95.00</Rate>
        </InvoiceLineAdd>
        <InvoiceLineAdd>
          <ItemRef>
            <FullName>Thermostat T6</FullName>
          </ItemRef>
          <Quantity>2</Quantity>
          <Rate>129.00</Rate>
        </InvoiceLineAdd>
      </InvoiceAdd>
    </InvoiceAddRq>
  </QBXMLMsgsRq>
</QBXML>

JSON equivalent

POST /v1/invoices
{
  "memo": "October service",
  "lines": [
    {
      "rate": 95,
      "itemRef": {
        "fullName": "Installation"
      },
      "quantity": 6
    },
    {
      "rate": 129,
      "itemRef": {
        "fullName": "Thermostat T6"
      },
      "quantity": 2
    }
  ],
  "txnDate": "2026-11-09",
  "refNumber": "1201",
  "customerRef": {
    "fullName": "Bayside Builders LLC"
  }
}
curl
curl -X POST https://ledgerwire.vibiz.app/v1/invoices \
  -H "Authorization: Bearer $LEDGERWIRE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"memo":"October service","lines":[{"rate":95,"itemRef":{"fullName":"Installation"},"quantity":6},{"rate":129,"itemRef":{"fullName":"Thermostat T6"},"quantity":2}],"txnDate":"2026-11-09","refNumber":"1201","customerRef":{"fullName":"Bayside Builders LLC"}}'

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)

InvoiceAddRs
<?xml version="1.0" ?>
<QBXML>
  <QBXMLMsgsRs>
    <InvoiceAddRs requestID="1" statusCode="0" statusSeverity="Info" statusMessage="Status OK">
      <InvoiceRet>
        <TxnID>101-1780875062</TxnID>
        <TimeCreated>2026-06-07T23:31:02+00:00</TimeCreated>
        <TimeModified>2026-06-19T23:31:02+00:00</TimeModified>
        <EditSequence>1781911862</EditSequence>
        <TxnNumber>1000</TxnNumber>
        <CustomerRef>
          <FullName>Bayside Builders LLC</FullName>
        </CustomerRef>
        <ARAccountRef>
          <ListID>80000003-1760311862</ListID>
          <FullName>Accounts Receivable</FullName>
        </ARAccountRef>
        <TemplateRef>
          <FullName>Intuit Service Invoice</FullName>
        </TemplateRef>
        <TxnDate>2026-11-09</TxnDate>
        <RefNumber>1201</RefNumber>
        <BillAddress>
          <Addr1>Clearwater Facilities Group</Addr1>
          <Addr2>8932 River Rd</Addr2>
          <City>Madison</City>
          <State>WI</State>
          <PostalCode>53703</PostalCode>
          <Country>US</Country>
        </BillAddress>
        <IsPending>false</IsPending>
        <TermsRef>
          <FullName>Net 15</FullName>
        </TermsRef>
        <DueDate>2026-07-07</DueDate>
        <Memo>October service</Memo>
        <IsToBePrinted>false</IsToBePrinted>
        <IsToBeEmailed>false</IsToBeEmailed>
        <Subtotal>24.75</Subtotal>
        <SalesTaxPercentage>0</SalesTaxPercentage>
        <SalesTaxTotal>0.00</SalesTaxTotal>
        <AppliedAmount>-24.75</AppliedAmount>
        <BalanceRemaining>0.00</BalanceRemaining>
        <IsPaid>true</IsPaid>
        <InvoiceLineRet>
          <TxnLineID>undefined</TxnLineID>
          <ItemRef>
            <FullName>Installation</FullName>
          </ItemRef>
          <Quantity>6</Quantity>
          <Rate>95.00</Rate>
        </InvoiceLineRet>
        <InvoiceLineRet>
          <TxnLineID>undefined</TxnLineID>
          <ItemRef>
            <FullName>Thermostat T6</FullName>
          </ItemRef>
          <Quantity>2</Quantity>
          <Rate>129.00</Rate>
        </InvoiceLineRet>
      </InvoiceRet>
    </InvoiceAddRs>
  </QBXMLMsgsRs>
</QBXML>

FAQ

What is required in InvoiceAdd?

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

Why does InvoiceAdd fail with status 3140?

3140 means a reference (for example CustomerRef 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 invoice?

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 InvoiceAdd 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 Invoice messages

Other Add messages

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

Get a free sandbox key