Overview
When implementing your Expenses solution, you need to create your SMB customer as a company in Sync2Books before registering their accounting software as a connection. You can do that when the customer starts interacting with your application. Next, you will connect the company to a data source via one of our integrations. With Expenses, each company will have at least one data connection: one to the SMB’s accounting software. A diagram displaying the relationship of a company and data connectionsAuthorize your API calls
Remember to authenticate when making calls to our API. Navigate to Applications → Select your application in the Sync2Books Dashboard to pick up your authorization header. Your API key will look like:sk_production_a1b2c3... or sk_development_x9y8z7...
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 companyid. You will use this id to establish a connection to an accounting software.
Request
Response
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.Supported accounting software
QuickBooks Online connection
As an example, let’s create a QuickBooks Online connection. In response, the endpoint returns anauthUrl. Direct your customer to the authUrl to initiate our Link auth flow and enable them to authorize this connection.
Get authorization URL
Response
Complete authorization
- Open the
authUrlin a browser - Complete the OAuth authorization flow with QuickBooks
- After authorization, the connection is automatically created
List connections
Response
Connection status
Connections can have the following statuses:Deauthorize a connection
If your customer wants to revoke their approval and sever the connection to their accounting software, use the disconnect endpoint. This marks the connectiondisconnected and wipes its stored OAuth tokens.
Request
Recap
You have created the structure of key objects required by Sync2Books Expenses: a company and its connection to an accounting data source. Next, learn how to configure the company to associate the expenses with correct accounts, suppliers, and customers and enable your customers to indicate their preferred expense mapping options.Read next
- Map transactions - Configure expense mapping preferences
- Create transactions - Learn how to create expense transactions