> ## Documentation Index
> Fetch the complete documentation index at: https://docs.refold.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup

> Connect to your QuickBooks app for OAuth.

To setup your QuickBooks app in Refold for OAuth, you will need the following credentials from your [Intuit Developer Account](https://developer.intuit.com/app/developer/homepage):

* Client ID
* Client Secret
* Scopes

### Pre-requisites

1. Intuit Developer Account. You can create one [here](https://developer.intuit.com/app/developer/homepage).

### Required Settings

* **Mandatory Scopes**

1. com.intuit.quickbooks.accounting
2. openid

<Info>If you haven't already created an app in QuickBooks, you'd need to create one.</Info>

### Creating an app in QuickBooks

To create a QuickBooks app and acquire the above mentioned credentials, please follow the steps mentioned below:

1. Log in to your [QuickBooks Developer Portal](https://developer.intuit.com/app/developer/homepage).
2. Click on the `Dashboard` icon in the top navigation bar.

<img height="200" src="https://mintcdn.com/cobalt-55/JZIwRzAqkgW8vPoP/images/Quickbooks/quickbooks_navigation.png?fit=max&auto=format&n=JZIwRzAqkgW8vPoP&q=85&s=8ff7fb1db1339494ef982e3d2b42a47d" alt="Navigation for App setup" data-path="images/Quickbooks/quickbooks_navigation.png" />

3. Click on `+ Create an App` button in the right and choose `QuickBooks Online and Payments`.
4. Enter the unique App Name for your application, select the **mandatory scope** and click on `Create app` button.
5. Go to your [`Apps catalog`](https://app.gocobalt.io/apps) in **Refold** > Search for `QuickBooks` > `Settings` > `Use your credentials` > `Callback Url` > Copy it.
6. In the OAuth app created for **QuickBooks**, depending on whether the application is in `Development` or `Production`, navigate to `Keys & credentials` in the left menu and got to `Redirect URIs` section.
7. Remove the default URI given > Paste the Callback Url copied from **Refold** > Click on the `Save` button.

<img height="200" src="https://mintcdn.com/cobalt-55/JZIwRzAqkgW8vPoP/images/Quickbooks/quickbooks_config.png?fit=max&auto=format&n=JZIwRzAqkgW8vPoP&q=85&s=858cdb6ca9d5e4ba1501f36b6b54a395" alt="Setting up QuickBooks Developer app" data-path="images/Quickbooks/quickbooks_config.png" />

8. Go to `Keys` section in `Keys & credentials` and copy the **Client ID** and **Client Secret** from here.

<img height="200" src="https://mintcdn.com/cobalt-55/JZIwRzAqkgW8vPoP/images/Quickbooks/quickbooks_credentials.png?fit=max&auto=format&n=JZIwRzAqkgW8vPoP&q=85&s=929f92ca823f5191e007f82986baa2b6" alt="Getting Credentials" data-path="images/Quickbooks/quickbooks_credentials.png" />

#### Configuring credentials in Refold

App settings page lets you configure the authentication settings for an `OAuth2` based application. For your customers to provide you authorization to access their data,
they would first need to install your application. This page lets you set up your application credentials.

<img height="200" src="https://mintcdn.com/cobalt-55/JZIwRzAqkgW8vPoP/images/Quickbooks/quickbooks_cobalt.png?fit=max&auto=format&n=JZIwRzAqkgW8vPoP&q=85&s=dc0d1f48e4e8fcd4325157920c2395e0" alt="Setting up application client credentials" data-path="images/Quickbooks/quickbooks_cobalt.png" />

Provide the acquired Client ID and Client Secret under Settings of the app and save it.

#### Configuring Scopes

Refold lets you configure what permissions to ask from your users while they install your application. The scopes can be added or removed from the App settings page, under `Permissions & Scopes`
section.

For some applications Refold sets **mandatory scopes** which cannot be removed. Additional scopes can be selected from the drop down. Refold also has the provision to add any
custom scopes supported by the respective platform.

<img height="200" src="https://mintcdn.com/cobalt-55/JZIwRzAqkgW8vPoP/images/Quickbooks/quickbooks_scopes.png?fit=max&auto=format&n=JZIwRzAqkgW8vPoP&q=85&s=f7da7b1ca989915750d81d25bdce5fd3" alt="OAuth Scopes" data-path="images/Quickbooks/quickbooks_scopes.png" />

Once the scopes has been added to the application in Refold, go to your [Intuit Developer Account](https://developer.intuit.com/app/developer/homepage) and update the scopes as added on Refold.

<Info>
  Scopes cannot be removed once they are assigned to an App.
</Info>

Select the OAuth App created for Refold > Click on `Production Settings` in the left menu > Scroll down to `Scope for the API` section > Select the Scope > Click on the `Save` button.

<Warning>
  If you are facing scopes missing or invalid scope error. Make sure you are not passing any custom scope not supported by the platform. And, the scopes selected here are
  identical to the ones selected in the platform.
</Warning>

#### Actions and triggers

Once the above setup is completed, you can create orchestrations of your use-cases using QuickBooks actions and triggers. Following are the set of QuickBooks actions and triggers
supported by Refold.

<Tabs>
  <Tab title="Actions">
    <AccordionGroup>
      <Accordion title="Bill">
        1. **Create Bill** - Create a new bill in QuickBooks.
        2. **Update Bill** - Update a bill in QuickBooks.
        3. **Delete Bill** - Delete a bill in QuickBooks.
      </Accordion>

      <Accordion title="Invoice">
        4. **Create Invoice** - Create an invoice in QuickBooks.
        5. **Update Invoice** - Update an invoic in QuickBooks.
        6. **Delete Invoice** - Delete an invoic in QuickBooks.
      </Accordion>

      <Accordion title="Customer">
        7. **Create Customer** - Create a customer in QuickBooks.
        8. **Update Customer** - Update a customer in QuickBooks.
      </Accordion>

      <Accordion title="Item">
        9. **Create Item** - Create an item in QuickBooks.
        10. **Update Item** - Update an item in QuickBooks.
      </Accordion>

      <Accordion title="Payment">
        11. **Create Payment** - Create a payment in QuickBooks.
        12. **Update Payment** - Update a payment in QuickBooks.
      </Accordion>

      <Accordion title="Others">
        13. **HTTP Request** - Make HTTP API calls to any QuickBooks documented REST APIs.
      </Accordion>
    </AccordionGroup>
  </Tab>

  <Tab title="Triggers">
    There are no triggers in this application.
  </Tab>
</Tabs>
