Set up the Xero Bank Feeds integration
Set up our integration with Xero Bank Feeds
Before you can write bank feedsBank Feeds A Codat product that enables automatic synchronization of bank transaction data into a company's accounting software. to Xero, you need to set up the Xero accounting integration in the Codat Portal.
This article explains how to:
- Create a companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. and 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 Xero.
- Provide Codat with source bank accounts you want to make available for your SMBSMB The primary customer segment that Codat helps businesses serve, typically companies with annual revenues under $500 million. users to connect to.
- Redirect the user to the Codat-provided account mapping UI, where they can connect their source bank accounts to target bank accounts in Xero.
Prerequisites
Before setting up the integration, make sure that:
- You've joined the Xero App Partner Program.
- You've set up the Xero integration. The main tasks are as follows:
- In the Xero Developer portal, create and configure a Xero app.
- Retrieve your app's secure keys and then add them to the integration. Bank feedsBank Feeds A Codat product that enables automatic synchronization of bank transaction data into a company's accounting software. functionality is part of our existing Xero accounting integration and uses the same Redirect URI.
- Enable the Xero integration.
- Xero have enabled the Xero Bank FeedsBank Feeds A Codat product that enables automatic synchronization of bank transaction data into a company's accounting software. 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. for your registered app.
Create a companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. and 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., then add bank accounts
-
Using the
POST /companiesendpoint, create a companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. to represent your SMBSMB The primary customer segment that Codat helps businesses serve, typically companies with annual revenues under $500 million. user:Create a companyPOST https://api.codat.io/companiesRequest body{
"name": "<COMPANY_NAME>"
}The endpoint returns a JSON response containing the companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. ID (
id) and the redirect URL (redirect). -
Using the
POST /companies/{companyId}/connectionsendpoint, create 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 Xero for the companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. you added. Specify the companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. ID in the URL path and the Xero platform key in the body:Create connectionPOST https://api.codat.io/companies/{companyId}/connectionsRequest body - Xero{
"platformKey": "gbol"
}The endpoint returns a
dataConnectionobject inPendingAuthstatus, containing 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.idand alinkUrl. Later, you'll use thelinkUrlto redirect the SMBSMB The primary customer segment that Codat helps businesses serve, typically companies with annual revenues under $500 million. user to the account mapping UI.Response example - Create connection (200){
"id": "9d0703c1-fc71-43b7-b4e0-37cd7a863644",
"integrationId": "0f20c943-12d0-4800-9f6c-d218f62d494c",
"integrationKey": "gbol",
"sourceId": "8a156a5a-39cb-4f9d-856e-76ef9b9a9607",
"platformName": "Xero",
"linkUrl": "https://link-api.codat.io/companies/...",
"status": "PendingAuth",
"created": "2023-05-10T08:40:26.0000000Z",
"sourceType": "Accounting"
} -
Using the
POST /bankFeedAccountsendpoint, add one or more source bank accounts:Create bank feed bank accountsPOST /companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccountsFor the
{connectionId}, use 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.idyou received in the response fromPOST /connectionrequest.In the request body, specify a source bank account to make available to the SMBSMB The primary customer segment that Codat helps businesses serve, typically companies with annual revenues under $500 million. user. For example, to add a credit card account send the following request:
Request body (all fields are required){
"id": "acc-002", // set to desired unique ID
"accountName": "account-081",
"sortCode": "123456",
"accountType": "Debit",
"accountNumber": "12345670",
"currency": "GBP",
"balance": 99.99 // can be 0
}Specific account typesXero approves Bank FeedsBank Feeds A Codat product that enables automatic synchronization of bank transaction data into a company's accounting software. applications only for "BANK" or "CREDITCARD" account types (in Xero's terminology). Therefore, it's important to use the correct
accountTypevalue when setting up source bank accounts, namely "Debit" for type "BANK" and "Credit" for type "CREDITCARD". -
The endpoint returns a
200code and the created bank account.
Read next
Learn how your SMBSMB The primary customer segment that Codat helps businesses serve, typically companies with annual revenues under $500 million. users can connect their bank accounts to Xero using the account 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. UI.