# Authorizing the QuickBooks’ API

The QuickBooks API is a RESTful API which allows you to read or write data to and from QuickBooks. It uses ‘*OAuth 2*’ authentication type. You can configure a QuickBooks API in Astera by using the *Import API* option present in the API Browser.

QuickBooks does not provide Open API definition, so we will add the request manually by using a *Custom API* in Astera.

We only need to follow steps from *Development > Create and Configure an App* from the following link:

Authentication steps: <https://developer.intuit.com/app/developer/qbo/docs/build-your-first-app>

Where the *Redirect Url* used in step 7 in the above link for Astera would be:

*Redirect Url for Astera Server*: http\://{Server\_Name}:8050/)

{% hint style="info" %}
**Note:** Save ClientID and secret to use it afterwards in Astera Data Stack authentication.
{% endhint %}

### Follow these steps to authorize QuickBooks’ API in Astera

1. Create an integration project in Astera.
2. Create a *Custom API* and provide a *Name* and *Base Url*.

*Base Url (Sandbox):* <https://sandbox-quickbooks.api.intuit.com>

*Base Url (Production):* [URL:https://quickbooks.api.intuit.com](url:https://quickbooks.api.intuit.com)

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F1s4aTXt8Rb0z8VZhC07v%2F2-QB-Import-API.png?alt=media\&token=77a9a404-9765-4f9c-af7a-88814d023836)

3. Now, you need to authenticate QuickBooks APIs to be able to use them in your dataflow. Without authentication, you will get an error. To authenticate an API, go to the Project Explorer and double click on the API’s .sact file under the *Shared Connection* node.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FQEEqiYBsXe66VDrvgorn%2F1-QB-Sact.png?alt=media\&token=804bace6-96ec-4f4d-ac64-496fc2b02cc2)

The *QuickBooks* .sact file will open in the designer. Now, right click on the Shared Action file’s header and select *Properties*.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FYyzHI1ijWIYGy1EgV504%2F3-QB-Properties.png?alt=media\&token=004af9a5-9088-4db5-980b-bc9b42ddb154)

4. QuickBooks uses ‘*OAuth 2*’ *Security Type* with *Grant Type*, ‘*Authentication Code*’.

*Auth Url:* <https://appcenter.intuit.com/connect/oauth2>

*Token Url:* <https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer>

*ClientID:* {ClientID}

*Client Secret:* {Client\_Secret}

*Scope:* {Scope}

*State:* {State}

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FxxKDwDjlu4xTz8ZL68c5%2F04-QB-Authentication.png?alt=media\&token=3daa90aa-76a9-418a-a57e-a3b2edfb3925)

*Additional Info* - You can modify the authorization by mentioning the names of only those permissions that you want to access from QuickBooks in Astera.

{% hint style="info" %}
**Note:** While working with QuickBooks APIs, it is necessary to specify *Scope* and *State* to generate the access token.
{% endhint %}

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FOEG92ZDo8WCgAlLuqUQD%2Fimage-20200816154231711.png?alt=media\&token=82d00a78-b095-48c8-949a-38b0f258a296)

5. Click *OK*, and save the Shared Action file (.sact).
6. Add methods in the REST API Browser which you want to access in Astera by adding requests and you are ready to use QuickBooks APIs in Astera.

This concludes authorizing the QuickBooks API.
