5 Things to know when Integrating Quickbooks with salesforce

5 Things to know when Integrating Quickbooks with salesforce

1. Know the Limitations of Quickbooks online API

While it is a great and flexible way to use custom Integration over automation using the external app, it gives us more privileges of molding things down as per our use case it is not always the case that the complex requirements can be achieved since there are some limitations from API as well. Therefore, it is preferred that you spend some time exploring the use case and checking the feasibility of your solution. 

It may be possible some of the time that going with an External app will save you from later disappointment.

Some of the things You can put on your list before moving ahead in the API Integration could be: –  

    • Objects You want to connect with salesforce.
    • API You need to use, i.e., Do you need Payment API as well, or Just Accounting API will get the job done for you?
    • The license you are using for your Quickbooks Online Company
    • Do you want other objects and fields other than the Standards that quick book provides

2. Different API which one do you need

Quickbooks Provide its Accounting data through Accountings API. All accounting objects, fields, and Forms have access through Accounting API. 

You can access them through That API. You can perform crud operations through API callouts and manipulate data in QuickBooks. We will speak of that in a minute. 

Besides manipulating records and data of your Customer, invoices, payments, and Refunds, there is a different API for handling Payments. So the Payments API lets you take care of all your payments you can manage all your transactions. You can set up recurring and one-time payments in Quickbooks. Once your Integration is Complete, the process is seamless. 

Both the Accounting and payment API uses HTTP REST framework and accepts JSON as an input, and you can do the GET, POST, and PATCH(Sparse /full Update, yes, that is what Quickbooks call it). Requests.

3. Forming the JSON for Request.

Well, Using REST APIs and discussing understanding JSON is a bit Obvious not because it is an integral part of it but also cause it is a little twisted here in QuickBooks(It’s not difficult, it is just different).

QuickBooks Object’s response has lots of nested javascript objects, so we must be careful while forming the JSON. 

We can first prepare a map for the Object, and for all the nested objects, we can organize another map and nest it inside the first one. So the first would be a Map of String and object, and the Second map would depend upon the contents inside it, a Map of String and String or Map of string and Objects if it has another list of or map of Objects inside it. (Lost already ? yes, this is a little twisted)  So the first one would be a Map of objects, a list, and the nested one could be a Map of string and string but be careful when you create a map like that because if we make a map incorrectly, it will cause a bad request. 

Once Completed with the map, you use JSON. Serialize typed or Untyped serialization to form the JSON String.

Does this seem like a lot of work? Is it not? So I have another way of saving the day, which is more traditional but gets the job done with fewer chances of errors. Also, the Apex Serialization ignores white space, but the same in Quickbooks API regards it, so another reason you might get a lousy body request even if your map is correct. So yes, it probably got some extra White space during serialization, which QuickBooks API does not recognize and does not want at the time of deserialization. So I would take a Sample JSON from the Documentation, manually create the JSON, form it in the structure, and the stringify it with JSON2Apex (You can find it on the Web). Once you convert your JSON To string, you can put it into code and add line breaks and white space with \n and escape sequence according to your need. 

 

This Could Give you an idea of how you can do it. Trust me, this looks like a lot of manual work, but it will save you a lot more time and stressful debugging if you form your JSON String through Serializing Map of the values. (I say this Explicitely just for Quickbooks API for other Integration and Systems Map is always a way to go).

4. Custom Fields if you are Considering 

Okay, I remember we talked about limitations earlier, so here is the first one on the list. If you are considering custom fields, one thing you should keep in mind is that the customer object does allow the creation of a custom field in QuickBooks. Still, they do not give access to custom fields for customers through its API or send those custom fields through the REST GET method. I am still wondering why this needs to be this way, but we must live with that until Quickbooks decides to change that. Instead, they allow access and manipulation of custom fields through API for other objects.

There is a specific way for describing and sending custom fields in your JSON request. I will show you a sample.

    “Custom Field”:    [

{

“DefinitionId” : “1”,

“Name” :   “Crew #”,

“Type”   :   ”StringType”,

“StringValue” :  “102”

}

            ]

5. Creating an App 

Just like we use a connected app in salesforce for authorizing and connecting it to another external system or another salesforce org, we need to create an app in the intuit developer accounts for your company.

 Log in to your Intuit developers account with your company credentials. 

> Go to dashboards 

> Create an App – give a relevant name to your app 

> There you are on the screen of customizing your app for API interactions according to your use case.

Process and fill in the details. Here comes the main catch, and you need to keep in mind and be exact with specifying your needs. You must be clear about what you want to achieve and the features you will implement.

For Account purposes, it is pretty simple. You just have to mention that you are building this app for interacting with account data and objects. Then, provide the link that asked you to create this app. mention where and who will use it and can access and interact with it. Simple details. And you are good to go. However, for creating an App that also handles Payments and allows payments API, the details you need to put might be a little more. Once you make the App, you will have a questionnaire section wherein you have further to describe your use case and Company’s policies. Once complete. You get your Consumer secret and consumer key which you can use for authorization in Oauth 2.0.

Summary
Article Name
5 Things to know when Integrating Quickbooks with salesforce
Description
It is a flexible way to use custom Integration over automation using the external app, it gives us more privileges of molding things down as per our use case.
Author
Publisher Name
BugendaiTech Pvt Ltd
Publisher Logo
Spread the updates

1 comment

Askling questions aare in fat fastidious thingg if you are not understanding anyything completely, however thios paragrap gives good uderstanding
yet.

Leave a reply