@robinpath/quickbooks
0.1.2Node.jsPublicQuickBooks module for RobinPath.
QuickBooks
QuickBooks module for RobinPath.
Package: @robinpath/quickbooks | Category: Finance | Type: Integration
Authentication
quickbooks.setCredentials "your-credentials"
Call this once at the start of your script before using any other function. Credentials persist for the duration of the script execution.
Use Cases
Use the quickbooks module when you need to:
- query -- Use
quickbooks.queryto perform this operation - getInvoice -- Use
quickbooks.getInvoiceto perform this operation - createInvoice -- Use
quickbooks.createInvoiceto perform this operation - sendInvoice -- Use
quickbooks.sendInvoiceto perform this operation - voidInvoice -- Use
quickbooks.voidInvoiceto perform this operation
Quick Reference
| Function | Description | Returns |
|---|---|---|
setCredentials | Configure quickbooks credentials. | object |
query | query | object |
getInvoice | getInvoice | object |
createInvoice | createInvoice | object |
sendInvoice | sendInvoice | object |
voidInvoice | voidInvoice | object |
getCustomer | getCustomer | object |
createCustomer | createCustomer | object |
updateCustomer | updateCustomer | object |
listCustomers | listCustomers | object |
getPayment | getPayment | object |
createPayment | createPayment | object |
getExpense | getExpense | object |
createExpense | createExpense | object |
getItem | getItem | object |
createItem | createItem | object |
listItems | listItems | object |
getCompanyInfo | getCompanyInfo | object |
getReport | getReport | object |
listAccounts | listAccounts | object |
createBill | createBill | object |
Functions
setCredentials
Configure quickbooks credentials.
Module: quickbooks | Returns: object -- API response.
quickbooks.setCredentials
| Parameter | Type | Required | Description |
|---|---|---|---|
realmId | string | Yes | realmId |
accessToken | string | Yes | accessToken |
query
query
Module: quickbooks | Returns: object -- API response.
quickbooks.query
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getInvoice
getInvoice
Module: quickbooks | Returns: object -- API response.
quickbooks.getInvoice
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
createInvoice
createInvoice
Module: quickbooks | Returns: object -- API response.
quickbooks.createInvoice
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
sendInvoice
sendInvoice
Module: quickbooks | Returns: object -- API response.
quickbooks.sendInvoice
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
voidInvoice
voidInvoice
Module: quickbooks | Returns: object -- API response.
quickbooks.voidInvoice
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getCustomer
getCustomer
Module: quickbooks | Returns: object -- API response.
quickbooks.getCustomer
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
createCustomer
createCustomer
Module: quickbooks | Returns: object -- API response.
quickbooks.createCustomer
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
updateCustomer
updateCustomer
Module: quickbooks | Returns: object -- API response.
quickbooks.updateCustomer
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
listCustomers
listCustomers
Module: quickbooks | Returns: object -- API response.
quickbooks.listCustomers
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getPayment
getPayment
Module: quickbooks | Returns: object -- API response.
quickbooks.getPayment
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
createPayment
createPayment
Module: quickbooks | Returns: object -- API response.
quickbooks.createPayment
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getExpense
getExpense
Module: quickbooks | Returns: object -- API response.
quickbooks.getExpense
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
createExpense
createExpense
Module: quickbooks | Returns: object -- API response.
quickbooks.createExpense
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getItem
getItem
Module: quickbooks | Returns: object -- API response.
quickbooks.getItem
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
createItem
createItem
Module: quickbooks | Returns: object -- API response.
quickbooks.createItem
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
listItems
listItems
Module: quickbooks | Returns: object -- API response.
quickbooks.listItems
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getCompanyInfo
getCompanyInfo
Module: quickbooks | Returns: object -- API response.
quickbooks.getCompanyInfo
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getReport
getReport
Module: quickbooks | Returns: object -- API response.
quickbooks.getReport
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
listAccounts
listAccounts
Module: quickbooks | Returns: object -- API response.
quickbooks.listAccounts
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
createBill
createBill
Module: quickbooks | Returns: object -- API response.
quickbooks.createBill
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
Error Handling
All functions throw on failure. Common errors:
| Error | Cause |
|---|---|
Quickbooks API error (${res.status}): ${t} | Check the error message for details |
quickbooks.setCredentials requires realmId, accessToken. | Check the error message for details |
quickbooks.voidInvoice requires an ID. | Check the error message for details |
quickbooks.updateCustomer requires an ID. | Check the error message for details |
Quickbooks: "..." not configured. Call quickbooks.setCredentials first. | Check the error message for details |
@desc "Query and validate result"
do
set $result as quickbooks.query
if $result != null
print "Success"
else
print "No result"
end
enddo
Recipes
1. List and iterate Invoice
Retrieve all items and loop through them.
@desc "Setup authentication"
do
quickbooks.setCredentials $token
enddo
@desc "Get invoice and iterate results"
do
set $result as quickbooks.getInvoice
each $item in $result
print $item
end
enddo
2. Create a new item with createInvoice
Create a new resource and capture the result.
@desc "Setup authentication"
do
quickbooks.setCredentials $token
enddo
@desc "Create invoice"
do
set $result as quickbooks.createInvoice
print "Created: " + $result
enddo
3. Create and update workflow
Create an item and then update it.
@desc "Setup authentication"
do
quickbooks.setCredentials $token
enddo
@desc "Create invoice and update customer"
do
set $created as quickbooks.createInvoice
# Update the created item
quickbooks.updateCustomer
enddo
4. Check before creating
List existing items and only create if needed.
@desc "Setup authentication"
do
quickbooks.setCredentials $token
enddo
@desc "Get invoice and create invoice"
do
set $existing as quickbooks.getInvoice
if $existing == null
quickbooks.createInvoice
print "Item created"
else
print "Item already exists"
end
enddo
5. Multi-step QuickBooks workflow
Chain multiple quickbooks operations together.
@desc "Setup authentication"
do
quickbooks.setCredentials $token
enddo
@desc "Query, get invoice, and more"
do
set $r_query as quickbooks.query
set $r_getInvoice as quickbooks.getInvoice
set $r_createInvoice as quickbooks.createInvoice
print "All operations complete"
enddo
6. Safe query with validation
Check results before proceeding.
@desc "Setup authentication"
do
quickbooks.setCredentials $token
enddo
@desc "Query and validate result"
do
set $result as quickbooks.query
if $result != null
print "Success: " + $result
else
print "Operation returned no data"
end
enddo
Related Modules
- xero -- Xero module for complementary functionality
- freshbooks -- FreshBooks module for complementary functionality
- invoice -- Invoice module for complementary functionality
- json -- JSON module for complementary functionality
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.2 | latest | 1 months ago |
$ robinpath add @robinpath/quickbooks
