(configuration)
Configure bank feeds for a company.
The Get configuration endpoint returns the current configuration for a given company ID.
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.configuration.get({
companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetConfigurationRequest | ✔️ | 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.GetConfigurationResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Use Set configuration endpoint to configure a given company ID.
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.configuration.set({
configuration: {
companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
configuration: {
syncAsBankFeeds: {
bankAccountOptions: [
{},
],
},
syncAsExpenses: {
bankAccountOptions: [
{},
],
customer: {
customerOptions: [
{},
],
},
supplier: {
supplierOptions: [
{},
],
},
},
},
schedule: {
frequencyOptions: [
"string",
],
},
},
companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.SetConfigurationRequest | ✔️ | 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.SetConfigurationResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |