Skip to main content

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:
  • 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​

  1. Using the POST /companies endpoint, 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 company
    POST https://api.codat.io/companies
    Request 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).

  2. Using the POST /companies/{companyId}/connections endpoint, 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 connection
    POST https://api.codat.io/companies/{companyId}/connections
    Request body - Xero
    {
    "platformKey": "gbol"
    }

    The endpoint returns a dataConnection object in PendingAuth status, 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. id and a linkUrl. Later, you'll use the linkUrl to 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"
    }
  3. Using the POST /bankFeedAccounts endpoint, add one or more source bank accounts:

    Create bank feed bank accounts
    POST /companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccounts

    For 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. id you received in the response from POST /connection request.

    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 types

    Xero 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 accountType value when setting up source bank accounts, namely "Debit" for type "BANK" and "Credit" for type "CREDITCARD".

  4. The endpoint returns a 200 code and the created bank account.

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.


Was this page useful?
👏
👍
🤔
👎
😭