Skip to main content

_create-connection

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 endpoint 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.

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);

Was this page useful?
👏
👍
🤔
👎
😭