# Authorizing QuickBooks’ API in Astera

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

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

We only need to follow the 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 afterward in Astera 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):* [https://quickbooks.api.intuit.com](url:https://quickbooks.api.intuit.com)

![](https://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2F3z49J95GgWBuSFM6HBQA%2F0.png?alt=media)

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://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2FCQC239jLa4IHIDw7AarY%2F1.png?alt=media)

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

![](https://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2F8CcJwG9nFAp8TMfqVTaU%2F2.png?alt=media)

4. QuickBooks uses the ‘*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://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2FPbCSBkYP4I8ZAWpsg2Tg%2F3.png?alt=media)

*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://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2Fp1hTS8F90hSmORnLRT6N%2F4.png?alt=media)

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

Reference Link: <https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/account>.

This concludes authorizing a QuickBooks API in Astera.
