(companies)
Create and manage your Codat companies.
- create - Create company
- delete - Delete a company
- get - Get company
- list - List companies
- update - Update company
Use the Create company endpoint to create a new company that represents your customer in Codat.
A company represents a business sharing access to their data. Each company can have multiple connections to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.
If forbidden characters (see name
pattern) are present in the request, a company will be created with the forbidden characters removed. For example, Company (Codat[1])
with be created as Company Codat1
.
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.companies.create({
description: "Requested early access to the new financing scheme.",
groups: [
{
id: "60d2fa12-8a04-11ee-b9d1-0242ac120002",
},
],
name: "Bank of Dave",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
shared.CompanyRequestBody | ✔️ | 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. |
Promise<operations.CreateCompanyResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
The Delete company endpoint permanently deletes a company, its connections and any cached data. This operation is irreversible.
A company represents a business sharing access to their data. Each company can have multiple connections to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.
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.companies.delete({
companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.DeleteCompanyRequest | ✔️ | 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. |
Promise<operations.DeleteCompanyResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
The Get company endpoint returns a single company for a given companyId
.
A company represents a business sharing access to their data. Each company can have multiple connections to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.
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.companies.get({
companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetCompanyRequest | ✔️ | 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. |
Promise<operations.GetCompanyResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
The List companies endpoint returns a list of [companies] associated to your instances.
A company represents a business sharing access to their data. Each company can have multiple connections to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.
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.companies.list({
orderBy: "-modifiedDate",
page: 1,
pageSize: 100,
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ListCompaniesRequest | ✔️ | 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. |
Promise<operations.ListCompaniesResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Use the Update company endpoint to update both the name and description of the company. If you use groups to manage a set of companies, use the Add company or Remove company endpoints to add or remove a company from a group.
A company represents a business sharing access to their data. Each company can have multiple connections to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.
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.companies.update({
companyRequestBody: {
description: "Requested early access to the new financing scheme.",
groups: [
{
id: "60d2fa12-8a04-11ee-b9d1-0242ac120002",
},
],
name: "Bank of Dave",
},
companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.UpdateCompanyRequest | ✔️ | 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. |
Promise<operations.UpdateCompanyResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |