CertaCal help Back to CertaCal

QuickBooks through Make

CertaCal works with QuickBooks Online through Make (make.com), an automation service. You connect your own QuickBooks Online company in Make, and a Make scenario does the QuickBooks side:

  • When a job closes, CertaCal sends the visit's invoice (or estimate, or sales receipt) to your scenario: the customer, and one line per scale with its serial and certificate number, or the service agreement's or quote's lines. Each line names the QuickBooks product/service it bills on.
  • The scenario finds or creates the customer in QuickBooks, creates the invoice, and tells CertaCal its QuickBooks number and total.
  • Optionally, a second scenario tells CertaCal when an invoice is paid, so each job, the customer's page and Office › Money show paid, unpaid or overdue.
  • An accepted quote can go to QuickBooks as an estimate the same way.

QuickBooks doesn't email anything: you review each invoice in QuickBooks and send it from there, as before.

What you need

  • A Make account. The free plan is enough to try it; a busy company will want a paid plan, because each invoice uses several Make operations (about one per invoice line, plus five).
  • Your QuickBooks Online sign-in.
  • In CertaCal: Settings › Integrations.
  • The starter scenario: certacal-quickbooks-make.json. Save it to your computer (right-click › Save link as).

1. Make a Make account

  1. Go to make.com and click Get started free. Sign up with your work email.
  2. When asked where your data should be kept, pick the region nearest you (for example US). Note your Make address, for example us1.make.com.
  3. You land on your Make Organization dashboard.

2. Connect QuickBooks Online in Make

  1. In Make, open Connections in the left menu and click Add.
  2. Search for QuickBooks and pick it.
  3. Name the connection, for example QuickBooks: <your company>, and click Save.
  4. QuickBooks' sign-in opens. Sign in, pick your company, and click Connect.

The connection appears in the list. Make keeps the QuickBooks sign-in; CertaCal never sees it.

3. Get what Make needs from CertaCal

You need two things from CertaCal: an API key, so Make can tell CertaCal what it made, and your company's write-back address.

  1. In CertaCal, open Settings › Integrations.
  2. Under API keys, type the name Make, pick Read and write, and click Make key.
  3. Copy the key that appears (it starts cck_). It's shown only once: paste it straight into Make in step 4 below, and don't email it or save it in a document. If it's lost, switch it off and make a new one.
  4. At the top, under QuickBooks Online (through Make), note the address after Make writes back to, for example https://yourcompany.certacal.net/api/v1/quickbooks/documents/.

4. Build the invoice scenario

The starter scenario has the two CertaCal steps already set up: the webhook that receives each invoice, and the call that writes the result back. You add the QuickBooks steps between them.

Import the starter scenario

  1. In Make, open Scenarios and click Create a new scenario.
  2. Click the … (more) button at the bottom and pick Import Blueprint. Choose the certacal-quickbooks-make.json file you saved, and click Save.
  3. Click the first step, CertaCal: invoice ready. Click Create a webhook, name it CertaCal invoices, and click Save. Make shows the webhook's address, such as https://hook.us1.make.com/abc123…. Click Copy address to clipboard.

Tell CertaCal to send invoices to Make

  1. In CertaCal, Settings › Integrations › Webhooks: name it Make invoices, paste the address into Address to call, tick A closed job's invoice is ready for QuickBooks, and click Add webhook. (A signing secret is shown; Make doesn't need it, so you can close it.)
  2. Under QuickBooks Online (through Make), pick what to make (An invoice, An estimate or A sales receipt), and type your QuickBooks product/service names (see Products and services below).
  3. Switch When a job closes on.

Show Make what an invoice looks like

  1. In Make, click the webhook step and then Redetermine data structure. Make waits for a call.
  2. In CertaCal, under Send a closed job now, type the number of a recent closed job and click Send to QuickBooks.
  3. Make shows Successfully determined. Each later step can now pick CertaCal's fields, all under data: data › customer, data › lines, data › date, data › memo and so on (see What CertaCal sends below). Below, customer.display_name means data › customer › display_name from the webhook step.

Add the QuickBooks steps

Add these between the two CertaCal steps (hover over the link between them and click the +, or drag the write-back step to the right to make room). For each QuickBooks step, pick the QuickBooks connection from step 2.

  1. QuickBooks › Search for customers. Search by Query: DisplayName = '{{customer.display_name}}' (map display_name from the webhook). Limit 1. Tick Continue the execution of the route even if the module finds no results.
  2. Flow control › Router. It splits the scenario in two routes, run one after the other.
  3. On the first route, click the link to set a filter: Label New customer, condition Id (from Search for customers) Does not exist. Add QuickBooks › Create a customer: Display name customer.display_name, Email customer.email, and the Billing address fields from customer.billing_address (line1, line2, city, state, postal_code, country). After it, add Tools › Set variable: name customer_id, value Id from Create a customer.
  4. On the second route (no filter):
  5. 1. Tools › Get variable: customer_id.

    2. Flow control › Iterator: Array = lines from the webhook.

    3. QuickBooks › Search for items: Query Name = '{{item}}' (map item from the Iterator). Limit 1.

    4. Flow control › Array aggregator: Source module = the Iterator; Target structure type = Create an invoice › Line items (pick it after adding the next step, then come back). Map: Item = Id from Search for items; Description = description; Quantity = quantity; Unit price = {{ifempty(rate; UnitPrice)}}, using UnitPrice from Search for items, so a scale line takes your QuickBooks price.

    5. QuickBooks › Create an invoice (or Create an estimate, or Create a sales receipt, to match CertaCal's Make setting): Customer = ifempty(quickbooks_id; ifempty(Id; customer_id)), built in Make's mapping panel: the ifempty function, then data › customer › quickbooks_id from the webhook, then Id from Search for customers, then customer_id from Get variable (click each from the panel; don't type the names); Invoice date = date; Line items = the aggregator's array; Customer memo = memo; Private note = private_note; Bill email = bill_email (or the customer's email when it's empty).

    6. Drag the CertaCal: write back step onto the end of this route.

  6. Click CertaCal: write back:
  7. • URL: your write-back address from step 3.

    • Headers › Authorization: replace PASTE-YOUR-CERTACAL-KEY with your key, leaving Api-Key in front.

    • Request content: replace each MAP: … with the value from Create an invoice: Id, Doc number, Total amount, Balance, and, for customer_quickbooks_id, the customer Id you mapped into the invoice. Keep the quote marks around each value.

  8. Click Save (bottom left), then switch the scenario On (Immediately as data arrives).

Products and services

Each line in lines has an item: the QuickBooks product/service it bills on. Make finds it by name, so it must match QuickBooks exactly.

  • Each scale (Settings › Integrations › QuickBooks): the product/service for a calibration, for example Scale calibration. Blank means Calibration. A scale line has no price (rate is empty): QuickBooks' price for the product/service is used, which is why the aggregator maps ifempty(rate; UnitPrice).
  • A different product/service for some scale types: a truck scale can bill on Truck scale calibration, for example.
  • Service agreements and quotes: Service, Labor, Truck charge, Travel labor, Mileage, Per diem, Materials and your three agreement lines. A blank box sends CertaCal's own name (shown in grey). These lines carry CertaCal's price in rate and amount.

5. Test it

  1. In CertaCal, close a real job (or use Send a closed job now with a recent one).
  2. In Make, open the scenario's History: the run should be green. Click it to see each step's input and output.
  3. In QuickBooks, open Sales › Invoices: the invoice is there, dated the visit day, with one line per scale.
  4. In CertaCal, the job's row in Settings › Integrations › Recent shows Invoice 1001, $…, and the job shows a QuickBooks chip.

Try it first with QuickBooks' sample company (sign in to developer.intuit.com and open the sandbox), or with a customer you can void afterwards.

Estimates for accepted quotes (optional)

  1. In Make, open the invoice scenario, click … › Clone, and name the copy CertaCal estimates.
  2. On the webhook step, Create a webhook (a new one, CertaCal estimates) and copy its address.
  3. Replace Create an invoice with Create an estimate; add Expiration date = expires.
  4. In the write-back step, change "job": {{1.data.job}} to "quote": {{1.data.quote}}, and drop balance.
  5. In CertaCal, add a webhook with the new address and tick An accepted quote's estimate is ready for QuickBooks, and leave Accepted quotes on under QuickBooks.
  1. Make a new scenario. First step: QuickBooks › Watch payments.
  2. Flow control › Iterator over the payment's Line array; each line's Linked transactions names the invoice it paid.
  3. QuickBooks › Get an invoice: the Id of the linked invoice.
  4. HTTP › Make a request: POST to your write-back address with the same Authorization header, and the body {"quickbooks_id": "{{Id}}", "type": "invoice", "balance": "{{Balance}}", "due_date": "{{Due date}}"} from Get an invoice.
  5. Save and switch it on.

When an invoice is voided or deleted in QuickBooks, send "status": "void" or "status": "deleted" the same way, and the job shows it.

Locations as sub-customers (optional)

With Bill locations as sub-customers on, each invoice also has a location with display_name, fallback_name (used when another customer already has that name), quickbooks_id and bill_with_parent. In the scenario, search for the location first, create it as a sub-customer (Parent = the customer's Id, Bill with parent as sent) when it's missing, bill the invoice to it, and write its Id back as location_quickbooks_id. When the setting is off, location is empty and nothing changes.

What CertaCal sends

Each call is a JSON body with event (invoice.ready or estimate.ready) and data:

FieldWhat it is
typeinvoice, estimate or receipt: what to make.
job / quoteThe CertaCal job or quote it's for. Send it back when writing back.
reference, private_noteCertaCal job 1234 and the location: put it in the private note to find the job later.
date, expiresThe visit day (or the quote's acceptance) and a quote's valid-until date.
customerid, display_name, quickbooks_id (empty the first time), email, billing_address.
locationOnly with sub-customers on (see above).
bill_emailThe service agreement's accounting contact, when there is one.
memoFor the customer memo: the visit date, any quote or agreement reference, and a note that each certificate can be checked online.
linesEach with item (QuickBooks product/service name), description, quantity, rate and amount (empty for a scale line, priced by QuickBooks), and key (CertaCal's name for the line: calibration, service, labor…).
totalThe total, or empty while any line is priced by QuickBooks.

You can see the invoice CertaCal sends for any closed job at https://<your company>.certacal.net/api/v1/jobs/<job number>/invoice/ (with the API key), and the whole API at /api/v1/docs/.

When it doesn't work

What you seeWhat to do
CertaCal's Recent says No Make scenario is listeningNo active webhook ticks A closed job's invoice is ready for QuickBooks. Add it (step 4) and click Send again.
Recent says Sent to Make, waiting for QuickBooks, and the Attention page says invoices never came backMake didn't finish. Open the scenario's History in Make: a red step says why. Fix it, then click Send again in CertaCal.
The webhook's Recent calls in CertaCal show Answered 410 or 404The Make webhook was deleted or the scenario is off. Switch it on, or make a new webhook and update the address in CertaCal.
Make: Invalid Reference: Item, or QuickBooks says an item is missingA product/service name doesn't match QuickBooks. See Products and services.
Make: Duplicate Name ExistsA customer of that name exists but the search didn't find it (a different spelling, or it's inactive). Make it active, or fix the name in CertaCal or QuickBooks.
Make: the write-back step answers 401The API key is wrong or switched off. Make a new Read and write key and paste it into the Authorization header.
Make: the write-back step answers 403The key is Read only. Make a Read and write key.
Make: the write-back step answers 400A value isn't what CertaCal expects, for example a total with a currency sign. The answer says which field.
QuickBooks asks to reconnectIn Make, Connections › Reauthorize.
Make stopped the scenario after errorsFix the cause, switch the scenario back on, and in Make's Incomplete executions retry the waiting runs, or click Send again in CertaCal.

CertaCal retries a call to Make for several hours if Make doesn't answer. Send again (or Send a closed job now) sends a job's invoice again; if the first one did reach QuickBooks, void the duplicate there.