# How to Create OAuth Credentials for FreshBooks

This guide will help you set up your FreshBooks OAuth app to connect with Apideck and start using the Accounting API.

## Prerequisites

Before you begin, make sure you have:

1. **A FreshBooks account** - Sign up at [FreshBooks](https://www.freshbooks.com/signup)
2. Access to the [FreshBooks Developer Hub](https://www.freshbooks.com/developers)
3. An Apideck account

## 1. Enable the FreshBooks connector in Apideck

1. Navigate to the [Apideck Dashboard](https://platform.apideck.com)
2. Go to **Configuration** > **Accounting** > **FreshBooks**
3. The connector will be available for configuration

## 2. Create OAuth App in FreshBooks Developer Portal

### Access Developer Portal

1. Log in to your FreshBooks account
2. Navigate to the [FreshBooks Developer Hub](https://www.freshbooks.com/developers)

![FreshBooks - Developer Portal](https://res.cloudinary.com/apideck/image/upload/v1767616411/docs/connectors/freshbooks/freshbooks-developer-hub.png)

3. Click **Create an App** or **Get Started** to begin creating your OAuth application

### Configure Basic Information

Fill out the basic information about your OAuth app in the following order:

1. **Application Name**: Enter a descriptive name for your app (e.g., "Apideck Integration")

2. **App Type**: Select the type of app you want to create:
   - **Test App**: For testing and development purposes
   - **Private App**: For internal use within your organization
   - **Public App**: For distribution to other FreshBooks users (requires FreshBooks review)


3. **Website URL**: Enter your application's website URL (optional but recommended)

4. **Application Settings URL**: Enter the URL where users can manage your app's settings, for example: https://vault.apideck.com (optional)


![FreshBooks - Basic Information](https://res.cloudinary.com/apideck/image/upload/v1767616411/docs/connectors/freshbooks/freshbooks-create-application.png)

5. **Scopes**: Select the OAuth scopes that match the resources you need to access through the FreshBooks API. Common scopes include:
   - `user:profile:read` - View personal and business details (required by default)
   - `user:clients:read` / `user:clients:write` - Access client information
   - `user:invoices:read` / `user:invoices:write` - Access invoice data
   - `user:payments:read` / `user:payments:write` - Access payment information
   - `user:expenses:read` / `user:expenses:write` - Access expense data
   - `user:account:read` / `user:account:write` - Access chart of accounts
   - And other scopes as needed for your integration


6. **Redirect URI**: Enter **exactly** `https://unify.apideck.com/vault/callback`


![FreshBooks - Basic Information](https://res.cloudinary.com/apideck/image/upload/v1767616410/docs/connectors/freshbooks/freshbooks-redirect-uri.png)

### Get Your Credentials

After creating your app, FreshBooks will generate your OAuth credentials:

- **Client ID** - This is your application's public identifier
- **Client Secret** - This is your application's secret key

![FreshBooks - Copy Credentials](https://res.cloudinary.com/apideck/image/upload/v1767616410/docs/connectors/freshbooks/freshbooks-copy-credentials.png)


## 3. Configure the FreshBooks connector in Apideck

1. Navigate to the [FreshBooks connector configuration](https://platform.apideck.com/configuration/accounting/freshbooks) in the Apideck Dashboard
2. Select the **Use your client credentials** option
3. Enter your OAuth credentials:
   - **Client ID** - Paste the Client ID from your FreshBooks Developer Portal app
   - **Client Secret** - Paste the Client Secret from your FreshBooks Developer Portal app
4. Review that the scopes granted in FreshBooks match with the scopes you are requesting in Apideck
5. Click **Save settings** to save your credentials

![Apideck - Configure FreshBooks connector](https://res.cloudinary.com/apideck/image/upload/v1767616410/docs/connectors/freshbooks/apideck-configuration-connector.png)

## 4. Test Your Connection

You can test your FreshBooks connector by clicking **Test Vault** in the Apideck dashboard.

1. Click **Authorize** to start the OAuth flow

![FreshBooks - Unauthorized Connection](https://res.cloudinary.com/apideck/image/upload/v1767616410/docs/connectors/freshbooks/apideck-unauthorized.png)

2. You'll be redirected to FreshBooks to grant permissions
3. Select the business/account you want to connect from the dropdown list (you must have owner or admin role)
5. After successful authorization, the connection will show as **Connected**


![FreshBooks - Authorized Connection](https://res.cloudinary.com/apideck/image/upload/v1767616410/docs/connectors/freshbooks/apideck-connected.png)


## 5. Do your first API call to the Accounting API

1. Connect through [Vault](https://platform.apideck.com/vault)
2. Test with this call:

```bash
curl --location 'https://unify.apideck.com/accounting/customers' \
 --header 'x-apideck-consumer-id: test-consumer' \
 --header 'x-apideck-app-id: {APIDECK_APP_ID}' \
 --header 'x-apideck-service-id: freshbooks' \
 --header 'Authorization: Bearer {APIDECK_API_KEY}'
```

--- 
Now your app and FreshBooks integration are configured! 🎉

