(transactions)
Transactions represent debits and credits from a source account.
- create - Create bank transactions
- getCreateOperation - Get create operation
- listCreateOperations - List create operations
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.
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();
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. |
Promise<operations.CreateBankTransactionsResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Retrieve push operation.
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();
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. |
Promise<operations.GetCreateOperationResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
List create operations.
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();
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. |
Promise<operations.ListCreateOperationsResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |