You can use cliqo with bash to automate many tasks in QuickBooks online. Here, we will discuss a few of the more common tasks, including:

Creating Invoices With cliqo and bash

The following example demonstrates how to create a new invoice:

$ ./cliqo new invoice new_invoice.json
Invoice created with id 170

And here's the new_invoice.json supplied to the new command above:

{
    "CustomerRef": {
        "name": "Amy's Bird Sanctuary",
        "type": "",
        "value": "1"
    },
    "Line": [
        {
            "Amount": 100.0,
            "Description": "Weekly Gardening Service",
            "DetailType": "SalesItemLineDetail",
            "Id": "1",
            "LineNum": 1,
            "SalesItemLineDetail": {
                "ItemRef": {
                    "name": "Gardening",
                    "type": "",
                    "value": "6"
                },
                "Qty": 4,
                "ServiceDate": "",
                "TaxCodeRef": {
                    "name": "",
                    "type": "",
                    "value": "TAX"
                },
                "TaxInclusiveAmt": 0,
                "UnitPrice": 25
            }
        }
    ]
}

Tip: In order to create your JSON input for the new command, we recommend first creating a sample of your new record using the QuickBooks Online web interface. then use the get command to show the JSON, as follows:

$ ./cliqo --format=json --fields=all get customer 1
{
    "Active": true,
    "Balance": 1086.0,
    "BalanceWithJobs": 1086.0,
    "BillAddr": {
        "City": "Bayside",
        "Country": "",
        "CountrySubDivisionCode": "",
        "Id": "99",
        "Lat": "",
        "Line1": "101 Ocean View",
        "Line2": "Suite 400",
        "Line3": "",
        "Line4": "",
        "Line5": "",
        "Long": "",
        "Note": "",
        "PostalCode": "11360"
    },
    "BillWithParent": false,
    "CompanyName": "Amy's Bird Sanctuary",
    "CurrencyRef": {
        "name": "United States Dollar",
        "type": "",
        "value": "USD"
    },
    "DefaultTaxCodeRef": {
        "name": "",
        "type": "",
        "value": "2"
    },
    "DisplayName": "Amy's Bird Sanctuary",
    "FamilyName": "Lauterbach",
    "FullyQualifiedName": "Amy's Bird Sanctuary",
    "GivenName": "Amy",
    "Id": "1",
    "Job": false,
    "Level": 0,
    "MetaData": {
        "CreateTime": "2017-08-30T16:48:43-07:00",
        "LastUpdatedTime": "2021-03-04T11:02:44-08:00"
    },
    "MiddleName": "",
    "Notes": "",
    "OpenBalanceDate": "",
    "PreferredDeliveryMethod": "Print",
    "PrimaryEmailAddr": {
        "Address": "Birds@Intuit.com"
    },
    "PrimaryPhone": {
        "FreeFormNumber": "(650) 555-3311"
    },
    "PrimaryTaxIdentifier": "",
    "PrintOnCheckName": "Amy's Bird Sanctuary",
    "ResaleNum": "",
    "ShipAddr": {
        "City": "Bayshore",
        "Country": "",
        "CountrySubDivisionCode": "CA",
        "Id": "97",
        "Lat": "",
        "Line1": "4581 Finch St.",
        "Line2": "",
        "Line3": "",
        "Line4": "",
        "Line5": "",
        "Long": "",
        "Note": "",
        "PostalCode": "94326"
    },
    "Suffix": "",
    "SyncToken": "3",
    "Taxable": true,
    "Title": "",
    "domain": "QBO",
    "sparse": false
}

Creating Accounts With cliqo and bash

Creating new general ledger accounts is similarly straightforward. First we'll create a json file representing our new account. The file should look like this.

{
    "Name": "Customer Deposits 1",
    "AccountType": "Other Current Liability",
    "AccountSubType": "OtherCurrentLiabilities"
}

Then we'll run this command to create the account:

./cliqo new account new_account.json

Printing Invoices With cliqo and bash

The following example demonstrates how to download invoice with id 103.

$ ./cliqo print invoice 103 invoice_103.pdf
Invoice printed with id 103 to invoice_103.pdf

Note: the id is not the same as the invoice number. To get the Id for a given invoice number (DocNumber), perform a select query like this:

$ ./cliqo select invoice --where "DocNumber='1033'"
103     Geeta Kalapatapu        629.1

Running Reports With cliqo and bash

The following example demonstrates how to run an Accounts Receivable Aging report:

$ ./cliqo report ar
Aged Receivables
2021-03-12
Printed 2021-03-12 06:40:48-08:00

        Current 1 - 30  31 - 60 61 - 90 91 and over     Total
Amy's Bird Sanctuary    500.00          100.00          786.00  1386.00
Bill's Windsurf Shop                                    85.00   85.00
Freeman Sporting Goods                                          0.00
 0969 Ocean View Road                                   477.50  477.50
 55 Twin Lane                                   85.00   85.00
Total Freeman Sporting Goods    0.00    0.00    0.00    0.00    562.50  562.50
Geeta Kalapatapu                                        629.10  629.10
Jeff's Jalopies                                 81.00   81.00
John Melton                                     450.00  450.00
Kookies by Kathy                                        75.00   75.00
Mark Cho                                        314.28  314.28
Paulsen Medical Supplies                                        954.75  954.75
Red Rock Diner                                  226.00  226.00
Rondonuwu Fruit and Vegi                                        78.60   78.60
Shara Barnett                                           0.00
 Barnett Design                                 274.50  274.50
Total Shara Barnett     0.00    0.00    0.00    0.00    274.50  274.50
Sonnenschein Family Store                                       362.07  362.07
Sushi by Katsuyuki                                      160.00  160.00
Travis Waldron                                  414.72  414.72
Weiskopf Consulting                                     375.00  375.00
TOTAL   500.00  0.00    100.00  0.00    5828.52 6428.52

Extracting Data With cliqo and bash

The following bash commands can be used to retrieve customer with Id 1 and display its name and balance:

#!/bin/bash
# Get QuickBooks Online customer info with bash

customer=`cliqo --format=json get customer 1`
echo $customer | jq -r '.FullyQualifiedName'
echo $customer | jq -r '.Balance'

Additional Tips for bash

When using cliqo with bash, you can pipe the output through other filters such as grep to limit results. In addition, using the --format=json option and the jq utility, you can create more interesting solutions.

For example, you might use the following in bash to output 2 customers with a Balance greater than 0:

#!/bin/bash

# List 2 customers with Balance > 0
cliqo \
--fields=all \
--format=json \
select customer \
--where "Balance > '0.0'" \
--max 2 \
> customers.json

And the following command to extract the customer names:

#!/bin/bash

jq '.customers[] | .FullyQualifiedName' customers.json

Start Your Free Trial Today

cliqo is free for one month and just $30/month thereafter*.

* for up to 5 connected QuickBooks companies.

Getting Started

To get started, follow these steps:

  1. Visit the downloads page to obtain cliqo for your operating system

  2. Extract the cliqo executable from the zip file

  3. Run "./cliqo quickstart" to authorize access to your QuickBooks Online company

  4. Once authorized, you can use any of the other commands:

    • Example 1: ./cliqo get customer 1

    • Example 2: ./cliqo select vendor

    • Example 3: ./cliqo select invoice --max 5

    • Example 4: ./cliqo print invoice 103 invoice_103.pdf

    • Example 5: ./cliqo report ar"

  5. for more usage help, run "cliqo -h" or see the full cliqo documentation