Get Started with Expenses

This guide will help you set up your Expenses integration and make your first expense sync.

Overview

When implementing your Expenses solution, you need to:

  1. Create a company - Represent your SMB customer in Sync2Books

  2. Create an accounting connection - Connect to your customer's accounting software

  3. Configure expense mapping - Set up default accounts, suppliers, and tax rates

  4. Create expense transactions - Submit expenses for sync

  5. Monitor sync status - Track the sync process and handle any errors

Prerequisites

Before you begin, ensure you have:

  • API Key - Your application's API key from the Sync2Books Dashboard

  • Access to accounting software - Your customer's QuickBooks, Xero, or Sage account credentials

Authorize your API calls

Remember to authenticate when making calls to our API. Navigate to Applications → Select your application in the Sync2Books Dashboardarrow-up-right to pick up your authorization header.

Your API key will look like: sk_live_abc123... or sk_test_xyz789...

Example Authentication:

Step 1: Create a company

Within Expenses, a company represents your SMB customer that manages their expenses using your application. To create it, use our Create company endpoint. It returns a JSON response containing the company id. You will use this id to establish a connection to an accounting software.

Request

Response

Step 2: Create accounting connection

Next, use the authorization URL returned when creating a company to connect the company to an accounting data source via one of our integrations. This will allow you to synchronize data with that source.

QuickBooks Online

  1. Open the authUrl from the company creation response in a browser

  2. Complete the OAuth authorization flow with QuickBooks

  3. After authorization, the connection is automatically created

You can also get the authorization URL for an existing company:

Response

Step 3: Configure expense mapping (optional)

Before creating expenses, you can configure default mappings at the company level. This ensures expenses are automatically categorized correctly even if specific references are omitted.

Request

See Map transactions for detailed configuration options.

Step 4: Create your first expense

Now that you have a company and connection set up, you can create expense transactions:

Request

Response

The response includes a syncBatchId that you can use to monitor the sync status.

Step 5: Monitor sync status

Use the syncBatchId to monitor the sync progress:

Request

Response

See Sync transactions for detailed status tracking and error handling.

Recap

You have created the structure of key objects required by Sync2Books Expenses: a company and its connection to an accounting data source. You've also created and synced your first expense transaction.

Last updated