Integrations / QuickBooks
QuickBooks
QuickBooks Online accounting: company info, SQL-like queries, customers, invoices (create and email), bills, vendors, payments, accounts, items and the profit and loss report.
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "quickbooks" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
| Scope | Why it is requested |
|---|---|
com.intuit.quickbooks.accounting | Read and write the company's accounting data (customers, invoices, bills, payments, reports) |
openid | Identify which Intuit user connected |
email | Read the connected user's email address to label the connection |
profile | Read the connected user's name |
Actions
Create customerwritequickbooks.create_customerCreate a customer. DisplayName must be unique across customers, vendors and employees.
Needs scope: com.intuit.quickbooks.accounting
| Input | Type | Description | |
|---|---|---|---|
realm_id | string | Required | QuickBooks company ID (realmId). In QuickBooks Online it is the 'Company ID' shown under Settings > Account and settings > Billing & Subscription, and it is also the realmId in the connect redirect. Production calls use the production company; sandbox companies need the sandbox host. |
display_name | string | Required | Unique display name |
given_name | string | Optional | First name |
family_name | string | Optional | Last name |
company_name | string | Optional | Company name |
primary_email_addr | object | Optional | Email as {"Address": "[email protected]"} |
primary_phone | object | Optional | Phone as {"FreeFormNumber": "555-0100"} |
minorversion | string | Optional | Optional API minor version number (for example 75). Omit to use the default behaviour. |
await setu.execute({
userId: "user_1",
action: "quickbooks.create_customer",
input: {
"realm_id": "<realm_id>",
"display_name": "<display_name>"
},
});Create invoicewritequickbooks.create_invoiceCreate an invoice for a customer. Line items use QuickBooks line objects (DetailType SalesItemLineDetail with ItemRef, Qty, UnitPrice). Creating it does not email it; use send_invoice for that.
Needs scope: com.intuit.quickbooks.accounting
| Input | Type | Description | |
|---|---|---|---|
realm_id | string | Required | QuickBooks company ID (realmId). In QuickBooks Online it is the 'Company ID' shown under Settings > Account and settings > Billing & Subscription, and it is also the realmId in the connect redirect. Production calls use the production company; sandbox companies need the sandbox host. |
customer_id | string | Required | Customer Id (CustomerRef value) |
lines | array of object | Required | QuickBooks Line objects, each with Amount, DetailType and SalesItemLineDetail |
due_date | string | Optional | Due date YYYY-MM-DD |
txn_date | string | Optional | Invoice date YYYY-MM-DD |
doc_number | string | Optional | Invoice number; auto-assigned when omitted |
bill_email | object | Optional | Recipient as {"Address": "[email protected]"} |
minorversion | string | Optional | Optional API minor version number (for example 75). Omit to use the default behaviour. |
await setu.execute({
userId: "user_1",
action: "quickbooks.create_invoice",
input: {
"realm_id": "<realm_id>",
"customer_id": "<customer_id>",
"lines": []
},
});Record customer paymentwritequickbooks.create_paymentRecord a payment received from a customer, optionally linked to the invoices it pays (Line with LinkedTxn). This changes balances in the books.
Needs scope: com.intuit.quickbooks.accounting
| Input | Type | Description | |
|---|---|---|---|
realm_id | string | Required | QuickBooks company ID (realmId). In QuickBooks Online it is the 'Company ID' shown under Settings > Account and settings > Billing & Subscription, and it is also the realmId in the connect redirect. Production calls use the production company; sandbox companies need the sandbox host. |
customer_id | string | Required | Customer Id (CustomerRef value) |
total_amount | number | Required | Total amount received |
lines | array of object | Optional | Optional Line objects linking the payment to invoices: {Amount, LinkedTxn:[{TxnId, TxnType:'Invoice'}]} |
txn_date | string | Optional | Payment date YYYY-MM-DD |
minorversion | string | Optional | Optional API minor version number (for example 75). Omit to use the default behaviour. |
await setu.execute({
userId: "user_1",
action: "quickbooks.create_payment",
input: {
"realm_id": "<realm_id>",
"customer_id": "<customer_id>",
"total_amount": 1
},
});Get billreadquickbooks.get_billRead one bill by id: vendor, amount, balance and due date.
Needs scope: com.intuit.quickbooks.accounting
| Input | Type | Description | |
|---|---|---|---|
realm_id | string | Required | QuickBooks company ID (realmId). In QuickBooks Online it is the 'Company ID' shown under Settings > Account and settings > Billing & Subscription, and it is also the realmId in the connect redirect. Production calls use the production company; sandbox companies need the sandbox host. |
bill_id | string | Required | QuickBooks bill Id |
minorversion | string | Optional | Optional API minor version number (for example 75). Omit to use the default behaviour. |
await setu.execute({
userId: "user_1",
action: "quickbooks.get_bill",
input: {
"realm_id": "<realm_id>",
"bill_id": "<bill_id>"
},
});Get company inforeadquickbooks.get_company_infoRead the connected QuickBooks company's profile: name, legal name, country and email. Good first call to confirm the realm_id is right.
Needs scope: com.intuit.quickbooks.accounting
| Input | Type | Description | |
|---|---|---|---|
realm_id | string | Required | QuickBooks company ID (realmId). In QuickBooks Online it is the 'Company ID' shown under Settings > Account and settings > Billing & Subscription, and it is also the realmId in the connect redirect. Production calls use the production company; sandbox companies need the sandbox host. |
minorversion | string | Optional | Optional API minor version number (for example 75). Omit to use the default behaviour. |
await setu.execute({
userId: "user_1",
action: "quickbooks.get_company_info",
input: {
"realm_id": "<realm_id>"
},
});Get customerreadquickbooks.get_customerRead one customer by id. Returns display name, email, balance and the SyncToken needed to update it.
Needs scope: com.intuit.quickbooks.accounting
| Input | Type | Description | |
|---|---|---|---|
realm_id | string | Required | QuickBooks company ID (realmId). In QuickBooks Online it is the 'Company ID' shown under Settings > Account and settings > Billing & Subscription, and it is also the realmId in the connect redirect. Production calls use the production company; sandbox companies need the sandbox host. |
customer_id | string | Required | QuickBooks customer Id |
minorversion | string | Optional | Optional API minor version number (for example 75). Omit to use the default behaviour. |
await setu.execute({
userId: "user_1",
action: "quickbooks.get_customer",
input: {
"realm_id": "<realm_id>",
"customer_id": "<customer_id>"
},
});Get invoicereadquickbooks.get_invoiceRead one invoice by id: number, customer, totals, balance and email status.
Needs scope: com.intuit.quickbooks.accounting
| Input | Type | Description | |
|---|---|---|---|
realm_id | string | Required | QuickBooks company ID (realmId). In QuickBooks Online it is the 'Company ID' shown under Settings > Account and settings > Billing & Subscription, and it is also the realmId in the connect redirect. Production calls use the production company; sandbox companies need the sandbox host. |
invoice_id | string | Required | QuickBooks invoice Id |
minorversion | string | Optional | Optional API minor version number (for example 75). Omit to use the default behaviour. |
await setu.execute({
userId: "user_1",
action: "quickbooks.get_invoice",
input: {
"realm_id": "<realm_id>",
"invoice_id": "<invoice_id>"
},
});Get vendorreadquickbooks.get_vendorRead one vendor by id.
Needs scope: com.intuit.quickbooks.accounting
| Input | Type | Description | |
|---|---|---|---|
realm_id | string | Required | QuickBooks company ID (realmId). In QuickBooks Online it is the 'Company ID' shown under Settings > Account and settings > Billing & Subscription, and it is also the realmId in the connect redirect. Production calls use the production company; sandbox companies need the sandbox host. |
vendor_id | string | Required | QuickBooks vendor Id |
minorversion | string | Optional | Optional API minor version number (for example 75). Omit to use the default behaviour. |
await setu.execute({
userId: "user_1",
action: "quickbooks.get_vendor",
input: {
"realm_id": "<realm_id>",
"vendor_id": "<vendor_id>"
},
});List accountsreadquickbooks.list_accountsList the chart of accounts: name, type and current balance.
Needs scope: com.intuit.quickbooks.accounting
| Input | Type | Description | |
|---|---|---|---|
realm_id | string | Required | QuickBooks company ID (realmId). In QuickBooks Online it is the 'Company ID' shown under Settings > Account and settings > Billing & Subscription, and it is also the realmId in the connect redirect. Production calls use the production company; sandbox companies need the sandbox host. |
max_results | integer | Required | How many accounts to return (1 to 1000) |
await setu.execute({
userId: "user_1",
action: "quickbooks.list_accounts",
input: {
"realm_id": "<realm_id>",
"max_results": 1
},
});List billsreadquickbooks.list_billsList bills (money owed to vendors), newest query order as QuickBooks returns it. Use the query action for filters and paging.
Needs scope: com.intuit.quickbooks.accounting
| Input | Type | Description | |
|---|---|---|---|
realm_id | string | Required | QuickBooks company ID (realmId). In QuickBooks Online it is the 'Company ID' shown under Settings > Account and settings > Billing & Subscription, and it is also the realmId in the connect redirect. Production calls use the production company; sandbox companies need the sandbox host. |
max_results | integer | Required | How many bills to return (1 to 1000) |
await setu.execute({
userId: "user_1",
action: "quickbooks.list_bills",
input: {
"realm_id": "<realm_id>",
"max_results": 1
},
});List itemsreadquickbooks.list_itemsList products and services (items) with their type and unit price; invoice lines refer to these ids.
Needs scope: com.intuit.quickbooks.accounting
| Input | Type | Description | |
|---|---|---|---|
realm_id | string | Required | QuickBooks company ID (realmId). In QuickBooks Online it is the 'Company ID' shown under Settings > Account and settings > Billing & Subscription, and it is also the realmId in the connect redirect. Production calls use the production company; sandbox companies need the sandbox host. |
max_results | integer | Required | How many items to return (1 to 1000) |
await setu.execute({
userId: "user_1",
action: "quickbooks.list_items",
input: {
"realm_id": "<realm_id>",
"max_results": 1
},
});List vendorsreadquickbooks.list_vendorsList vendors (suppliers). Use the query action for filters and paging.
Needs scope: com.intuit.quickbooks.accounting
| Input | Type | Description | |
|---|---|---|---|
realm_id | string | Required | QuickBooks company ID (realmId). In QuickBooks Online it is the 'Company ID' shown under Settings > Account and settings > Billing & Subscription, and it is also the realmId in the connect redirect. Production calls use the production company; sandbox companies need the sandbox host. |
max_results | integer | Required | How many vendors to return (1 to 1000) |
await setu.execute({
userId: "user_1",
action: "quickbooks.list_vendors",
input: {
"realm_id": "<realm_id>",
"max_results": 1
},
});Profit and loss reportreadquickbooks.profit_and_lossRun the Profit and Loss report for a date range. Returns the report header and rows (income, cost of goods sold, expenses, net income).
Needs scope: com.intuit.quickbooks.accounting
| Input | Type | Description | |
|---|---|---|---|
realm_id | string | Required | QuickBooks company ID (realmId). In QuickBooks Online it is the 'Company ID' shown under Settings > Account and settings > Billing & Subscription, and it is also the realmId in the connect redirect. Production calls use the production company; sandbox companies need the sandbox host. |
start_date | string | Optional | Start date YYYY-MM-DD |
end_date | string | Optional | End date YYYY-MM-DD |
accounting_method | string | Optional | Cash or Accrual |
summarize_column_by | string | Optional | Split columns by Total, Month, Week, Days, Quarter, Year |
minorversion | string | Optional | Optional API minor version number (for example 75). Omit to use the default behaviour. |
await setu.execute({
userId: "user_1",
action: "quickbooks.profit_and_loss",
input: {
"realm_id": "<realm_id>"
},
});Run QuickBooks queryreadquickbooks.queryRun a read-only QuickBooks query written in its SQL-like language, for example "select * from Customer where DisplayName like 'A%' maxresults 20". Returns the QueryResponse with the matching entities. Use STARTPOSITION and MAXRESULTS to page.
Needs scope: com.intuit.quickbooks.accounting
| Input | Type | Description | |
|---|---|---|---|
realm_id | string | Required | QuickBooks company ID (realmId). In QuickBooks Online it is the 'Company ID' shown under Settings > Account and settings > Billing & Subscription, and it is also the realmId in the connect redirect. Production calls use the production company; sandbox companies need the sandbox host. |
query | string | Required | SQL-like query, e.g. select * from Invoice where Balance > '0' order by DueDate |
minorversion | string | Optional | Optional API minor version number (for example 75). Omit to use the default behaviour. |
await setu.execute({
userId: "user_1",
action: "quickbooks.query",
input: {
"realm_id": "<realm_id>",
"query": "<query>"
},
});Send invoice by emailwritequickbooks.send_invoiceEmail an existing invoice to the customer (to the address on the invoice, or to send_to). This sends a real email to a customer and cannot be unsent.
Needs scope: com.intuit.quickbooks.accounting
| Input | Type | Description | |
|---|---|---|---|
realm_id | string | Required | QuickBooks company ID (realmId). In QuickBooks Online it is the 'Company ID' shown under Settings > Account and settings > Billing & Subscription, and it is also the realmId in the connect redirect. Production calls use the production company; sandbox companies need the sandbox host. |
invoice_id | string | Required | QuickBooks invoice Id |
send_to | string | Optional | Email address to send to instead of the one on the invoice |
await setu.execute({
userId: "user_1",
action: "quickbooks.send_invoice",
input: {
"realm_id": "<realm_id>",
"invoice_id": "<invoice_id>"
},
});Update customerwritequickbooks.update_customerSparse-update a customer: only the fields you pass change. Needs the customer's current SyncToken (from get_customer); a stale token is rejected.
Needs scope: com.intuit.quickbooks.accounting
| Input | Type | Description | |
|---|---|---|---|
realm_id | string | Required | QuickBooks company ID (realmId). In QuickBooks Online it is the 'Company ID' shown under Settings > Account and settings > Billing & Subscription, and it is also the realmId in the connect redirect. Production calls use the production company; sandbox companies need the sandbox host. |
customer_id | string | Required | QuickBooks customer Id |
sync_token | string | Required | Current SyncToken of the customer |
display_name | string | Optional | New display name |
company_name | string | Optional | New company name |
primary_email_addr | object | Optional | Email as {"Address": "[email protected]"} |
primary_phone | object | Optional | Phone as {"FreeFormNumber": "555-0100"} |
active | boolean | Optional | false to make the customer inactive |
minorversion | string | Optional | Optional API minor version number (for example 75). Omit to use the default behaviour. |
await setu.execute({
userId: "user_1",
action: "quickbooks.update_customer",
input: {
"realm_id": "<realm_id>",
"customer_id": "<customer_id>",
"sync_token": "<sync_token>"
},
});