Skip to main content

Connections

Concept overview and key details

A data 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. represents a company's 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 a data sourceData source An external platform (such as QuickBooks, Xero, or a bank) that Codat integrates with to pull or push financial data. and allows you to synchronize data (read and/or write) with that source.

A companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. can have multiple data connectionsConnection 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. depending on the type of data sourceData source An external platform (such as QuickBooks, Xero, or a bank) that Codat integrates with to pull or push financial data. it is connecting to. For example, a single companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. can linkLink The authorization flow that allows end users to connect their accounting, banking, or commerce platforms to your application via Codat. to:

  • Accounting data - 1 active 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..
  • Banking data - Multiple active connectionsConnection 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..
  • Commerce data - Multiple active connectionsConnection 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..

Any combination of accounting, banking, and commerce data connectionsConnection 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. is allowed.

Before you can use a data 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 read or write data, the companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. must grant you access to their business data by linking the connection.

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

ConnectionsConnection 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. can have one of the statuses described in the following table.

StatusDefinition
LinkedThe 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. is linked to a data sourceData source An external platform (such as QuickBooks, Xero, or a bank) that Codat integrates with to pull or push financial data.; you can use it to read and write a companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources.'s consented data to and from the underlying provider's platform.
PendingAuthThe companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. hasn't authorized access to their financial platform (the data sourceData source An external platform (such as QuickBooks, Xero, or a bank) that Codat integrates with to pull or push financial data.). The SMBSMB The primary customer segment that Codat helps businesses serve, typically companies with annual revenues under $500 million. customer selected the platform in LinkLink The authorization flow that allows end users to connect their accounting, banking, or commerce platforms to your application via Codat. but did not complete the authorization flow.
DeauthorizedThe 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. was linked but is no longer able to access data from the underlying provider's platform.
You can access any data that was already read or written using this data 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.. However, you can't perform any new read or write operations until 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. is re-linked.
A data 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. usually becomes Deauthorized if the companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. revoked your access or an expiry time was reached.
UnlinkedThe data 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. was previously linked but you asked for your access to be revoked (see Disconnect a data connection to revoke your access to a data source).
Similar to Deauthorized, you can still access any data that was already read or written using the data 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., but can't perform any new read or write operations unless 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. is re-linked.
No connectionsConnection 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.The companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. has been created but does not have any connectionsConnection 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 financial platforms established in any of the above statuses.

Linked data 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. example

Verify that 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. returns a Linked status using one of our Connections endpoints.

In the response, note the following fields:

  • sourceId identifies the source of information, like a bank or accounting software;
  • integrationId identifies the Codat integration that supports the data sourceData source An external platform (such as QuickBooks, Xero, or a bank) that Codat integrates with to pull or push financial data..
GET /companies/{companyId}/connections
{
"id": "00000000-0000-0000-0000-000000000000",
"integrationId": "18cb53c4-3807-4a5a-8da9-303053a40002",
"sourceId": "58e1d32f-a092-438a-bffb-3bf6af9ba8ec",
"platformName": "Sage 50 (UK & Ireland)",
"linkUrl": "https://link.codat.io/companies/00000000-0000-0000-0000-000000000000/connections/00000000-0000-0000-0000-000000000000/start",
"status": "Linked",
"lastSync": "2022-01-01T12:00:00.0000000Z",
"created": "2021-01-01T12:00:00Z",
"sourceType": "Accounting"
}

Disconnect a data 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 revoke your access to a data sourceData source An external platform (such as QuickBooks, Xero, or a bank) that Codat integrates with to pull or push financial data.

You can disconnect a data 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. using the Codat Portal. Navigate to Companies, choose the companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. you want to manage connectionsConnection 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. for, then select Manage connectionsConnection 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. and use the three-dot menu to unlink 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..

This revokes your access to synchronize data with the linked companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. and sets the data 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.'s status to Unlinked.

Alternatively, you can use our Unlink connection endpoint. To disconnect a data 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'll need to provide:

  • The companyId of the linked companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. as a path parameter.
  • The connectionId of the data 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 disconnect as a path parameter.
  • A status of Unlinked in the request body.

When 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. is set to Unlinked, you can continue to access any data that was already read or written to the data sourceData source An external platform (such as QuickBooks, Xero, or a bank) that Codat integrates with to pull or push financial data., but you can't perform any new read or write operations (unless 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. is re-linked).

Unlinking data connections

Only Linked data connectionsConnection 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. can be unlinked.

Example: Disconnect a data 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.

curl --request PATCH \
--url "https://api.codat.io/companies/{companyId}/connections/{connectionId}" \
--header "Authorization: {codatAuthHeader}" \
--header "accept: application/json" \
--header "content-type: application/json" \
--data '{
"status": "Unlinked"
}'

Sample response to Unlinked request

{
"id": "69c25cc8-e1cd-4b63-b43d-75da021df35d",
"integrationId": "43b64770-a953-46d6-ab30-46c21094a276",
"sourceId": "9a96f326-226a-4e0f-923a-6758fdba40cc",
"platformName": "Stripe",
"linkUrl": "https://link.codat.io/link/start/c9219b93-4eff-4806-99d8-ed3337b6ded2/69c25cc8-e1cd-4b63-b43d-75da021df35d",
"status": "Unlinked",
"lastSync": "2021-02-11T12:12:13.1988465Z",
"created": "2021-02-11T12:04:53Z",
"sourceType": "Commerce"
}

Delete a data 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 delete a data 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. using the Codat Portal. Navigate to Companies, choose the companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. you want to manage connectionsConnection 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. for, then select Manage connectionsConnection 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. and use the three-dot menu to delete 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..

Alternatively, you can send a request to the DELETE /connectionId endpoint and provide the companyId and connectionId as path parameters.

curl --request DELETE \
--url "https://api.codat.io/companies/{companyId}/connections/{connectionId}" \
--header "Authorization: {codatAuthHeader}" \

When you delete a data 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't make any data read or write operations against the underlying data provider.
  • The data 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. isn't returned by GET /connections or GET /companies.

Provide credentials or tokens for a data 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 you are migrating an existing integration to use Codat, you can provide tokens for 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 migrate your users access. You can read more about how to do this on our migration page.


  • Next concept: Integrations
  • GET /connections 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. reference

Was this page useful?
👏
👍
🤔
👎
😭