Skip to content

Latest commit

 

History

History
181 lines (130 loc) · 10.2 KB

File metadata and controls

181 lines (130 loc) · 10.2 KB

Transactions

(transactions)

Overview

Transactions represent debits and credits from a source account.

Available Operations

create

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

Bank transactions are records of monetary amounts that have moved in and out of an SMB's bank account.

Integration-specific behaviour

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

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

Example Usage

import { CodatBankFeeds } from "@codat/bank-feeds";
import { BankTransactionType } 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.transactions.create({
    createBankTransactions: {
      accountId: "7110701885",
      transactions: [
        {
          amount: 999.99,
          balance: -999.99,
          counterparty: "ACME INC",
          date: "2022-10-23T00:00:00Z",
          description: "Debit for Payment Id sdp-1-57379a43-c4b8-49f5-bd7c-699189ee7a60",
          id: "716422529",
          reconciled: false,
          reference: "reference for transaction",
        },
      ],
    },
    accountId: "7110701885",
    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.CreateBankTransactionsRequest ✔️ 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.CreateBankTransactionsResponse>

Errors

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

getCreateOperation

Retrieve push operation.

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.transactions.getCreateOperation({
    companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
    pushOperationKey: "1fb73c31-a851-46c2-ab8a-5ce6e25b57b8",
  });

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

run();

Parameters

Parameter Type Required Description
request operations.GetCreateOperationRequest ✔️ 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.GetCreateOperationResponse>

Errors

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

listCreateOperations

List create operations.

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.transactions.listCreateOperations({
    companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
    orderBy: "-modifiedDate",
    page: 1,
    pageSize: 100,
  });

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

run();

Parameters

Parameter Type Required Description
request operations.ListCreateOperationsRequest ✔️ 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.ListCreateOperationsResponse>

Errors

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