import * as z from "zod/v3"; import { Decimal as Decimal$ } from "../../types/decimal.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { BankAccountStatus } from "./bankaccountstatus.js"; import { Links } from "./links.js"; /** * The type of transactions and balances on the account. * * @remarks * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. */ export declare const BankAccountsBankAccountType: { readonly Unknown: "Unknown"; readonly Credit: "Credit"; readonly Debit: "Debit"; }; /** * The type of transactions and balances on the account. * * @remarks * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. */ export type BankAccountsBankAccountType = ClosedEnum; export type Metadata = { /** * Indicates whether the record has been deleted in the third-party system this record originated from. */ isDeleted?: boolean | null | undefined; }; /** * Supplemental data is additional data you can include in our standard data types. * * @remarks * * It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. */ export type SupplementalData = { content?: { [k: string]: { [k: string]: any; }; } | null | undefined; }; /** * > **Accessing Bank Accounts through Banking API** * * @remarks * > * > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. * > * > To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/bank-feeds-api#/schemas/Account) data type. * * ## Overview * * A list of bank accounts associated with a company and a specific data connection. * * Bank accounts data includes: * * The name and ID of the account in the accounting software. * * The currency and balance of the account. * * The sort code and account number. */ export type AccountingBankAccount = { modifiedDate?: string | undefined; sourceModifiedDate?: string | undefined; /** * Identifier for the account, unique for the company in the accounting software. */ id?: string | undefined; /** * Name of the bank account in the accounting software. */ accountName?: string | null | undefined; /** * The type of transactions and balances on the account. * * @remarks * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. */ accountType?: BankAccountsBankAccountType | undefined; /** * Code used to identify each nominal account for a business. */ nominalCode?: string | null | undefined; /** * Sort code for the bank account. * * @remarks * * Xero integrations * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. */ sortCode?: string | null | undefined; /** * Account number for the bank account. * * @remarks * * Xero integrations * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. * * FreeAgent integrations * For Credit accounts, only the last four digits are required. For other types, the field is optional. */ accountNumber?: string | null | undefined; /** * International bank account number of the account. Often used when making or receiving international payments. */ iBan?: string | null | undefined; /** * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. * * @remarks * * ## Unknown currencies * * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. * * There are only a very small number of edge cases where this currency code is returned by the Codat system. */ currency?: string | undefined; /** * Balance of the bank account. */ balance?: Decimal$ | number | null | undefined; /** * The institution of the bank account. */ institution?: string | null | undefined; /** * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. */ availableBalance?: Decimal$ | number | null | undefined; /** * Pre-arranged overdraft limit of the account. * * @remarks * * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. */ overdraftLimit?: Decimal$ | number | null | undefined; /** * Status of the bank account. */ status?: BankAccountStatus | undefined; metadata?: Metadata | undefined; /** * Supplemental data is additional data you can include in our standard data types. * * @remarks * * It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. */ supplementalData?: SupplementalData | undefined; }; export type BankAccounts = { results?: Array | undefined; /** * Current page number. */ pageNumber: number; /** * Number of items to return in results array. */ pageSize: number; /** * Total number of items. */ totalResults: number; links: Links; }; /** @internal */ export declare const BankAccountsBankAccountType$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const Metadata$inboundSchema: z.ZodType; export declare function metadataFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const SupplementalData$inboundSchema: z.ZodType; export declare function supplementalDataFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const AccountingBankAccount$inboundSchema: z.ZodType; export declare function accountingBankAccountFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const BankAccounts$inboundSchema: z.ZodType; export declare function bankAccountsFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=bankaccounts.d.ts.map