Skip to content

Latest commit

 

History

History
182 lines (124 loc) · 10.7 KB

File metadata and controls

182 lines (124 loc) · 10.7 KB

BankAccounts

(bankAccounts)

Overview

Access bank accounts in an SMBs accounting platform.

Available Operations

create

The Create bank account endpoint creates a new bank account for a given company's connection.

Bank accounts are financial accounts maintained by a bank or other financial institution.

Integration-specific behaviour

Required data may vary by integration. To see what data to post, first call Get create/update bank account model.

Check out our coverage explorer for integrations that support creating an account.

Example Usage

import { CodatBankFeeds } from "@codat/bank-feeds";
import { BankAccountType } from "@codat/bank-feeds/dist/sdk/models/shared";

async function run() {
  const sdk = new CodatBankFeeds({
    security: {
      authHeader: "Basic BASE_64_ENCODED(API_KEY)",
    },
  });

  const res = await sdk.bankAccounts.create({
    bankAccountPrototype: {
      currency: "USD",
    },
    companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
    connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171",
  });

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
request operations.CreateBankAccountRequest ✔️ The request object to use for the request.
retries utils.RetryConfig Configuration to override the default retry behavior of the client.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.CreateBankAccountResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

getCreateModel

The Get create/update bank account model endpoint returns the expected data for the request payload when creating and updating a bank account for a given company and integration.

Bank accounts are financial accounts maintained by a bank or other financial institution.

Integration-specific behaviour

See the response examples for integration-specific indicative models.

Check out our coverage explorer for integrations that support creating and updating a bank account.

Example Usage

import { CodatBankFeeds } from "@codat/bank-feeds";

async function run() {
  const sdk = new CodatBankFeeds({
    security: {
      authHeader: "Basic BASE_64_ENCODED(API_KEY)",
    },
  });

  const res = await sdk.bankAccounts.getCreateModel({
    companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
    connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171",
  });

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetCreateBankAccountsModelRequest ✔️ The request object to use for the request.
retries utils.RetryConfig Configuration to override the default retry behavior of the client.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetCreateBankAccountsModelResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

list

The List bank accounts endpoint returns a list of bank accounts for a given company's connection.

Bank accounts are financial accounts maintained by a bank or other financial institution.

Before using this endpoint, you must have retrieved data for the company.

Example Usage

import { CodatBankFeeds } from "@codat/bank-feeds";

async function run() {
  const sdk = new CodatBankFeeds({
    security: {
      authHeader: "Basic BASE_64_ENCODED(API_KEY)",
    },
  });

  const res = await sdk.bankAccounts.list({
    companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
    connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171",
    orderBy: "-modifiedDate",
    page: 1,
    pageSize: 100,
  });

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
request operations.ListBankAccountsRequest ✔️ The request object to use for the request.
retries utils.RetryConfig Configuration to override the default retry behavior of the client.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.ListBankAccountsResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /