Skip to main content

Configure your SMB customer in Codat

Create a company and its connection that form the structure required to execute the bill pay process

Overview

When implementing your Bill Pay solution, you need to create your SMBSMB The primary customer segment that Codat helps businesses serve, typically companies with annual revenues under $500 million. customer as a companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. in Codat before registering their accounting software as a connectionConnection A link between a Codat company and a data source (like an accounting platform). Each connection represents authorized access to pull or push data from that platform.. You can do that when the customer starts interacting with your application.

We have highlighted this sequence of steps in our detailed process diagram below.

Detailed process diagram
Authorize your API calls

Remember to authenticate when making calls to our APIAPI A set of rules and protocols that allows different software applications to communicate with each other. Codat provides APIs for accessing financial data from accounting, banking, and commerce platforms.. Navigate to Developers > APIAPI A set of rules and protocols that allows different software applications to communicate with each other. Codat provides APIs for accessing financial data from accounting, banking, and commerce platforms. keys in the Portal to pick up your authorization header.

Create a companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources.

Within Bill Pay, a companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. represents your SMBSMB The primary customer segment that Codat helps businesses serve, typically companies with annual revenues under $500 million. customer that pays and manages their bills using your application. To create it, use our Create company (async) or Create company (sync) endpoints.

The endpoints return the companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. schema containing the ID that you will use to establish a connectionConnection A link between a Codat company and a data source (like an accounting platform). Each connection represents authorized access to pull or push data from that platform. to an accounting software.

const companyResponse = payablesClient.companies.create({
name: companyName,
});

if (companyResponse.statusCode == 200) {
throw new Error("Could not create company");
}

const companyId = companyResponse.company.id;
console.log(companyId);

Create a connectionConnection A link between a Codat company and a data source (like an accounting platform). Each connection represents authorized access to pull or push data from that platform.

Next, use the Create connection (async) or Create connection (sync) endpoints to connect the companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. to an accounting data sourceData source An external platform (such as QuickBooks, Xero, or a bank) that Codat integrates with to pull or push financial data. via one of our integrations.

This will allow you to synchronize data with that source, fetching or creating suppliers, bills, and payment methods. In the request body, specify a platformKey of the accounting software you're looking to connect.

Accounting softwareplatformKey
MYOB Businesspdvj
Oracle NetSuiteakxx
QuickBooks Onlineqhyg
QuickBooks Desktoppqsw
Sage Intacctknfz
Xerogbol

As an example, let's create a QuickBooks Online (QBO) connectionConnection A link between a Codat company and a data source (like an accounting platform). Each connection represents authorized access to pull or push data from that platform.. In response, the endpoint returns a dataConnection object with a PendingAuth status and a linkUrl. Direct your customer to the linkUrl to initiate our Link auth flow and enable them to authorize this connectionConnection A link between a Codat company and a data source (like an accounting platform). Each connection represents authorized access to pull or push data from that platform..

const connectionResponse = payablesClient.connections.create({
requestBody: {
platformKey: "qhyg",
},
companyId: companyResponse.company.id,
});

console.log(connectionResponse.connection.linkUrl);

Deauthorize a connectionConnection A link between a Codat company and a data source (like an accounting platform). Each connection represents authorized access to pull or push data from that platform.

If your customer wants to revoke their approval and sever the connectionConnection A link between a Codat company and a data source (like an accounting platform). Each connection represents authorized access to pull or push data from that platform. to their accounting software, use the Unlink connection (async) or Unlink connection (sync) endpoints.

You can learn more about connectionConnection A link between a Codat company and a data source (like an accounting platform). Each connection represents authorized access to pull or push data from that platform. management best practices and see how you can provide this functionality in your app's UI.

const unlinkResponse = payablesClient.connections.unlink({
requestBody: {
status: DataConnectionStatus.Unlinked,
},
companyId: companyResponse.company.id,
connectionId: connectionResponse.connection.id,
});
Recap

You have created the structure of key objects required by Codat's Bill Pay solution: a companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. and its connectionConnection A link between a Codat company and a data source (like an accounting platform). Each connection represents authorized access to pull or push data from that platform. to an accounting data sourceData source An external platform (such as QuickBooks, Xero, or a bank) that Codat integrates with to pull or push financial data..

Next, you can choose to manage your customer's suppliers, bills or payment methods prior to paying the bills.



Was this page useful?
👏
👍
🤔
👎
😭