Skip to content

Latest commit

 

History

History
133 lines (101 loc) · 6.08 KB

File metadata and controls

133 lines (101 loc) · 6.08 KB

Configuration

(configuration)

Overview

Configure bank feeds for a company.

Available Operations

  • get - Get configuration
  • set - Set configuration

get

The Get configuration endpoint returns the current configuration for a given company ID.

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.configuration.get({
    companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
  });

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

run();

Parameters

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.

Response

Promise<operations.GetConfigurationResponse>

Errors

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

set

Use Set configuration endpoint to configure a given company ID.

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.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();

Parameters

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.

Response

Promise<operations.SetConfigurationResponse>

Errors

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