QuickBooks Integrations from Five?

Do you have any examples of using Five to post entries to QuickBooks Web version using their API’s?

Thanks…

Hi Ron,

We will prepare an example for you on this, and will give you the steps shortly.

Hi Jo-Anne,

Any progress on this yet? I have a QuickBooks integration project coming up, and am wondering if I can do this in Five.

Hi @RMittelman

Here is a quick example of a function that creates an account in a Sandbox Company inside QuickBooks:

function QuickBooksIntegration(five, context, result) {
   //Capturing the name of the account from the app
    const name = context.Name;


    const bearerToken = 'MyBearerTokenHere'
    
    const url = 'https://sandbox-quickbooks.api.intuit.com/v3/company/9341452063613570/account?minorversion=40&Accept=application/json'

    // we send posts and get requests through five.httpClient();
    const client = five.httpClient();
     // The content type is taken from the documentation of QuickBooks
            client.setContent(`{
        "Name": "${name}", 
        "AccountType": "Accounts Receivable"
        }`)

    client.setContentType("application/json");


    client.addHeader('Authorization', `Bearer ${bearerToken}`);
    
    let results = client.post(url)

    five.log(JSON.stringify(results))

    return five.success(result);
}

From the function, you can see that the post request was sent through five.httpClient() which allows us to send requests to APIs such as Get, Put, etc, you can use the link below to understand how you can use the httpClient to communicate with your API

HTTPClient Object | Five | Low-Code For Real Developers

This function is attached to a ‘Do Complete’ event of a process inside Five. It works in a way that it expects the name of the account to be specified and then sends a post request to QuickBooks to create that account. You can see from the screenshot below that a successful call was made: