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
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.
- TypeScript
- Python
- C#
- Go
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);
company_request = shared.CompanyRequestBody(
name=company_name,
)
company_response = payables_client.companies.create(company_request)
if company_response.status_code != 200:
raise Exception('Could not create company')
company_id = company_response.company.id
print(company_id)
var companyResponse = await payablesClient.Companies.CreateAsync(new() {
Name = companyName,
});
if(companyResponse.StatusCode != 200){
throw new Exception("Could not create company");
}
var companyId = companyResponse.Company.Id;
console.log(companyId)
ctx := context.Background()
companyResponse, err := payablesClient.Companies.Create(ctx, &shared.CompanyRequestBody{
Name: companyName,
})
if companyResponse.StatusCode == 200 {
companyID := companyResponse.Company.ID
fmt.Println("%s", 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.
- Async Bill Pay
- Sync Bill Pay
| Accounting software | platformKey |
|---|---|
| MYOB Business | pdvj |
| Oracle NetSuite | akxx |
| QuickBooks Online | qhyg |
| QuickBooks Desktop | pqsw |
| Sage Intacct | knfz |
| Xero | gbol |
| Accounting software | platformKey |
|---|---|
| FreeAgent | fbrh |
| Oracle NetSuite | akxx |
| QuickBooks Online | qhyg |
| Xero | gbol |
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..
- TypeScript
- Python
- C#
- Go
const connectionResponse = payablesClient.connections.create({
requestBody: {
platformKey: "qhyg",
},
companyId: companyResponse.company.id,
});
console.log(connectionResponse.connection.linkUrl);
connection_request = operations.CreateConnectionRequest(
request_body=operations.CreateConnectionRequestBody(
platform_key='qhyg',
),
company_id=company_response.company.id,
)
connection_response = payables_client.connections.create(connection_request)
console.log(connection_response.connection.link_url)
var connectionResponse = await payablesClient.Connections.CreateAsync(new() {
RequestBody = new CreateConnectionRequestBody() {
PlatformKey = "qhyg",
},
CompanyId = companyResponse.Company.Id,
});
Console.WriteLine(connectionResponse.Connection.LinkUrl)
ctx := context.Background()
connectionResponse, err := payablesClient.Connections.Create(ctx, operations.CreateConnectionRequest{
RequestBody: &operations.CreateConnectionRequestBody{
PlatformKey: syncforpayables.String("qhyg"),
},
CompanyID: companyResponse.Company.ID,
})
fmt.Println(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.
- TypeScript
- Python
- C#
- Go
const unlinkResponse = payablesClient.connections.unlink({
requestBody: {
status: DataConnectionStatus.Unlinked,
},
companyId: companyResponse.company.id,
connectionId: connectionResponse.connection.id,
});
unlink_request = operations.UnlinkConnectionRequest(
request_body=operations.UnlinkConnectionUpdateConnection(
status=shared.DataConnectionStatus.UNLINKED
),
company_id=company_response.company.id,
connection_id=connection_response.connection.id,
)
unlink_response = payables_client.connections.unlink(unlink_request)
var unlinkResponse = await payablesClient.Connections.UnlinkAsync(new() {
RequestBody = new UnlinkConnectionUpdateConnection() {
Status = DataConnectionStatus.Unlinked
},
CompanyId = companyResponse.Company.Id,
ConnectionId = connectionResponse.Connection.Id,
});
ctx := context.Background()
unlinkResponse, err := payablesClient.Connections.Unlink(ctx, operations.UnlinkConnectionRequest{
RequestBody: &operations.UnlinkConnectionUpdateConnection{
Status: shared.DataConnectionStatusUnlinked
},
CompanyID: companyResponse.Company.ID,
ConnectionID: connectionResponse.Connection.ID,
})
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.
Read next
- Manage your customer's suppliers asynchronously or synchronously
- Manage your customer's bills asynchronously or synchronously
- Pay your customer's bills asynchronously or synchronously