LedgerWire

Language guide

QuickBooks Desktop API in Node.js: create invoices without qbXML or Windows

Read and write QuickBooks Desktop customers, invoices, bills and payments from Node.js with plain JSON over HTTPS. Free hosted sandbox, no Windows VM, no QuickBooks install.

QuickBooks Desktop has no cloud API. The official route is the QuickBooks SDK: qbXML messages delivered over COM on Windows, or over SOAP through the QuickBooks Web Connector. From Node.js that means building a SOAP server, generating schema-ordered XML and handling edit sequences yourself.

LedgerWire runs the Web Connector SOAP service for you and gives you a JSON REST API instead. Your Node.js code makes ordinary HTTPS calls; LedgerWire turns them into qbXML, queues them for your customer's Web Connector, and turns the response back into JSON.

1. Get a sandbox key

Sign up and you get a lw_test_… key plus a hosted, simulated QuickBooks Desktop company with 40 customers, 60 items, 120 invoices, bills and payments. It answers the same REST and qbXML calls as production, so you can build the whole integration before touching Windows.

2. List unpaid invoices

status=unpaid maps to qbXML PaidStatus=NotPaidOnly. Pages hold up to 150 records; follow nextCursor for more.

3. Create an invoice

Refs take an id (ListID) or a fullName. Line amounts are computed from quantity and rate when you leave amount out. Errors carry the real QuickBooks status code (3140 for a bad reference, 3100 for a duplicate name, 3200 for a stale editSequence) plus why and fix.

4. Update with editSequence

QuickBooks uses optimistic locking. Read the record, send back its editSequence with your change to POST /v1/invoices/{id}. If someone changed it in between you get HTTP 409 with qbStatusCode 3200: re-read and retry.

5. Go live

Create a connection in the dashboard and send your customer the setup link. They download a .qwc file, add it to the QuickBooks Web Connector (free from Intuit, usually already installed) and type the password. Switch your Node.js code to a lw_live_… key; nothing else changes. Calls wait up to 25 seconds for the Web Connector, otherwise you get a 202 with a job id and a job.completed webhook.

Anything not covered by REST

POST raw qbXML to /v1/qbxml. It is validated, then passed through unchanged in production, and simulated in the sandbox for the core objects.

List unpaid invoices (Node.js)
const res = await fetch('https://ledgerwire.vibiz.app/v1/invoices?status=unpaid&limit=20', {
  headers: { Authorization: `Bearer ${process.env.LEDGERWIRE_KEY}` },
});
const { data, nextCursor } = await res.json();
for (const inv of data) console.log(inv.refNumber, inv.customerRef.fullName, inv.balanceRemaining);
Create an invoice (Node.js)
const res = await fetch('https://ledgerwire.vibiz.app/v1/invoices', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.LEDGERWIRE_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    customerRef: { fullName: 'Bayside Builders LLC' },
    lines: [{ itemRef: { fullName: 'Installation' }, quantity: 4, rate: 95 }],
  }),
});
if (!res.ok) {
  const { error } = await res.json();
  throw new Error(`${error.message} Fix: ${error.fix}`); // e.g. qbStatusCode 3140
}
const invoice = await res.json();

Run these calls against a hosted QuickBooks Desktop sandbox now.

Get a free sandbox key

More language guides