QuickBooks Accounting Integration

QuickBooks Accounting Integration

The QuickBooks Accounting Integration implements three separate functions on the Quickbooks Online platform. These functions - defined as process streams on the integration settings in OMS - are 'Purchase Order', 'Sales Ledger (Invoice)', and 'Purchase Order And Invoices' streams. The 'Purchase Order And Invoices' stream should only be used for items that are tracked (i.e inventory items) on the Quickbooks platform. A client can only integrate with one or these streams at any one time..

Integration Setup and Authentication

Step 1:
Ensure the client has a Quickbooks online account.

- Login to the account and create an Intuit Developer account from the Quickbooks online plaform.

- On the Intuit developer account, create a new app and give the app any name of your choosing.

- Once the app is created, find the Production -> Keys & OAuth page and verify a Client ID and a Client Secret key is generated.

Please Note that access to the Production page may not be allowed until a privacy and  a user endpoint agreement URLs are provided.

- Also on the Production -> Keys & OAuth page, add the following Redirect Uri:


- Save all changes.


Step 2:

Access the Accounting Integration on the companies settings page in OMS. Enable the integration for the desired client and enter the client_id and client_secret keys in the respective fields as obtained in Step 1 above. Also enter https://oms.custom-gateway.net/v2/settings/companies-pre-alpha/quickbooks-landing in the Redirect URI field on the settings popup and click the 'Save' button to save.

Once saved, open the integration popup once again and click on the 'Get Access Token' button. This will redirect to the Intuit developer authentication page. If not previously logged in, you will need to login with the intuit developer User ID and Password. Once logged in, a connect button is provided to connect with the clients company in QuickBooks. Click on the 'Connect' button and the page should redirect back to the OMS settings popup page. The API Access Token, Access Token Expiration Timestamp, Realm ID, API Refresh Token, and Refresh Token Expiration Timestamp fields should now be automatically filled in. Click the 'Save' button again to ensure these values are saved.

Step 3:

The following account fields must be provided by the client during set up. The integration will query the values in the name fields. If a match is not found for the provided account name, the integration will fail.

Please note only the name fields are required, the account number (if available) and Id fields will be obtained by the integration using the value in the name field.

Enter the Client's accounts payable name in 'Accounts Payable Name' field on the settings page in OMS. This field is required to create purchase orders on QuickBooks Online. 

Enter the client's Sales Account Name. This should be an account of type 'Sales of Product Income'. This account is required for creating items intended to be included in the invoice creation. This means when the process stream is set to 'Sales Ledger (Invoice)', this value must be specified. The integration will fail otherwise.

Enter the client's Expense Account Name. This must be an account of type 'Cost of Goods sold'. When the process stream is set to 'Purchase Order', this field must be specified. The integration will fail otherwise.

Enter the Client's Asset Account name in the 'Other Current Asset Account Name' field. This must be an account of type 'Other Current Asset'. When the process stream is set to 'Purchase Order and Invoices', this field must be specified. The integration will fail otherwise.


Step 4:

Enter the Clients Vendor Name in the 'Vendor Name' field. This is the name of the seller in QuickBooks from which the company purchases any service or product. This name is required for creating a purchase order and the integration will fail if not provided or if the provided name does not exist in QuickBooks.

Step 5:

Enter the client's tax Agency Name in the 'Tax Agency Name' field.

How it Works

Purchase Order Stream

When the purchase order stream is selected on the integration settings for a client, the integration first queries QuickBooks Online API to see if the Accounts Payable Name, Expense Account Name and the Vendor Name are all valid names in QuickBooks. It will then get all orders in OMS that are on the statuses 'On Hold' or 'Received'. For each order it will query the API for the customer email and the customer Name. It will also query the API for the item (product) name on the order. If the customer email doesn't exist, it'll create a new customer using details on the order. Also if any of the Items on the order doesn't exist in QuickBooks, it will create a new item using details in the Order Items and the Expense Account Information provided. A purchase order is then created in Quickbooks. The order attribute is also updated in OMS with the Id value of the purchase order in QuickBooks. This ensures the order is no longer picked up for purchase order or for sales ledger.



See below example payload sent to create a purchase order in QuickBooks

{
  TotalAmt: <Total Unit Sale Price of Items in Order>,
  "Line": [
    {
      DetailType: "ItemBasedExpenseLineDetail",
      Amount: <Unit Sale Price for item 1 in the order>,
      ItemBasedExpenseLineDetail: {
        ItemRef: {
          name: <Product Name of item 1 in QuickBooks. Should match product name in OMS>,
          value: <Product Id of item in QuickBooks>
        },
        CustomerRef: {
          name: <Name of customer in QuickBooks. Should match name of customer in the order>,
          value: <Customer Id in QuickBooks>
        },
        Qty: <Quantity of item in OMS>,
        TaxCodeRef: {
          value: <Tax code ref based on the item's tax code in Oms>
        },
        BillableStatus: NotBillable,
        UnitPrice: <Unit Sale Price for item 1 in the order>
      }
    },
   {
      DetailType: "ItemBasedExpenseLineDetail",
      Amount: <Unit Sale Price for item 2 in the order>,
      ItemBasedExpenseLineDetail: {
        ItemRef: {
          name: <Product Name of item 2 in QuickBooks. Should match product name in OMS>,
          value: <Product Id of item in QuickBooks>
        },
        CustomerRef: {
          name: <Name of customer in QuickBooks. Should match name of customer in the order>,
          value: <Customer Id in QuickBooks>
        },
        Qty: <Quantity of item 2 in OMS>,
        TaxCodeRef: {
          value: <Tax code ref based on the item's tax code in Oms>
        },
        BillableStatus: NotBillable,
        UnitPrice: <Unit Sale Price for item 2 in the order>
      }
    },
  ],
  APAccountRef: {
    name: <Name of Accounts Payable in QuickBooks. Should match accounts payable name in settings>,
    value: <ID of account in QuickBooks>
  },
  VendorRef: {
    name: <Name of Vendor in QuickBooks. Should match Vendor Name in the integration Settings>,
    value: <Id of vendor in QuickBooks>
  }
}



Sales Ledger (Invoice) Stream

The integration only implements the Invoice API in QuickBooks for sales ledger. When this stream is selected on the integration settings for the client in OMS, it will first query the QuickBooks Online API for the Income Account Name. (Please note that this account should be of type 'Sales of Product Income'.) It will then get all orders on the statuses 'Dispatched' or 'Dispatched Notified'. For each order, it will query the API for the customer and the order items. If the customer or items on the order doesn't exist, they are created in QuickBooks. Note also that the items are created using the details in the order items and the Income account information provided. An invoice is then created in QuickBooks. The order attribute is also update in OMS with the id value of the invoice in QuickBooks. This ensures the order is no longer picked up for purchase order or for sales ledger.



See below example payload sent to create invoice in QuickBooks

{
  "Line": [
    {
      "DetailType: SalesItemLineDetail,

      Amount: <Unit Sale Price of Item in OMS>,

      SalesItemLineDetail: {

        ItemRef: {
          name: <Product Name of item in QuickBooks. Should match name of product in OMS>,
          value: <Item Id in QuickBooks>
        }
      }
    }
  ],
  CustomerRef: {
    "value": <Customer Id in QuickBooks>
  }
}



Purchase Order and Invoices Stream

This does both the purchase order and the invoice one after the other.
    • Related Articles

    • What is a Accounting Integration?

      This video covers what an accounting integration in the Custom Gateway platform actually does.
    • Xero Accounting Integration

      Overview OMS now integrates with Xero Accounting API to create invoices and purchase orders. The integration uses Oauth2 for authorization as specified in the Xero Api documentation Xero Requirements 1. This integration requires each client to create ...
    • XML Accounting Integration

      The following video details the XML accounting integrations that Custom Gateway has created to allow order details once dispatched to pass to an XML file via SFTP to a location where they can be collected and imported into your accounts package.
    • RIP Integration | Aeoon

      Introduction This article has been created to show how to setup the RIP Integration that Kornit X has built to connect to Aeoon.  Setup To setup the Aeoon RIPS integration, please head to your Production Centre company and within the advanced ...
    • Supplier Integration | Dubow

      Introduction This article has been created to show how to setup the supplier integration Kornit X has built to connect to OnPrintShop.  Setup To setup the Dubow integration, please head to your company and within the advanced settings head to ...