import * as utils from "../internal/utils"; import * as operations from "../sdk/models/operations"; import { SDKConfiguration } from "./sdk"; import { AxiosRequestConfig } from "axios"; /** * Journal entries */ export declare class JournalEntries { private sdkConfiguration; constructor(sdkConfig: SDKConfiguration); /** * Create journal entry * * @remarks * The *Create journal entry* endpoint creates a new [journal entry](https://docs.codat.io/accounting-api#/schemas/JournalEntry) for a given company's connection. * * [Journal entries](https://docs.codat.io/accounting-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved. * * **Integration-specific behaviour** * * Required data may vary by integration. To see what data to post, first call [Get create journal entry model](https://docs.codat.io/accounting-api#/operations/get-create-journalEntries-model). * * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journalEntries) for integrations that support creating an account. * */ create(req: operations.CreateJournalEntryRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * Delete journal entry * * @remarks * > **Use with caution** * > * >Because journal entries underpin every transaction in an accounting platform, deleting a journal entry can affect every transaction for a given company. * > * > **Before you proceed, make sure you understand the implications of deleting journal entries from an accounting perspective.** * * The *Delete journal entry* endpoint allows you to delete a specified journal entry from an accounting platform. * * [Journal entries](https://docs.codat.io/accounting-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved. * * ### Process * 1. Pass the `{journalEntryId}` to the *Delete journal entry* endpoint and store the `pushOperationKey` returned. * 2. Check the status of the delete by checking the status of push operation either via * 1. [Push operation webhook](https://docs.codat.io/introduction/webhooks/core-rules-types#push-operation-status-has-changed) (advised), * 2. [Push operation status endpoint](https://docs.codat.io/codat-api#/operations/get-push-operation). * * A `Success` status indicates that the journal entry object was deleted from the accounting platform. * 3. (Optional) Check that the journal entry was deleted from the accounting platform. * * ### Effect on related objects * * Be aware that deleting a journal entry from an accounting platform might cause related objects to be modified. For example, if you delete the journal entry for a paid invoice in QuickBooks Online, the invoice is deleted but the payment against that invoice is not. The payment is converted to a payment on account. * * ## Integration specifics * Integrations that support soft delete do not permanently delete the object in the accounting platform. * * | Integration | Soft Deleted | * |-------------|--------------| * | QuickBooks Online | Yes | * * > **Supported Integrations** * > * > This functionality is currently only supported for our QuickBooks Online integration. Check out our [public roadmap](https://portal.productboard.com/codat/7-public-product-roadmap/tabs/46-accounting-api) to see what we're building next, and to submit ideas for new features. */ delete(req: operations.DeleteJournalEntryRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * Get journal entry * * @remarks * The *Get journal entry* endpoint returns a single journal entry for a given journalEntryId. * * [Journal entries](https://docs.codat.io/accounting-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved. * * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journalEntries) for integrations that support getting a specific journal entry. * * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/codat-api#/operations/refresh-company-data). * */ get(req: operations.GetJournalEntryRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * Get create journal entry model * * @remarks * The *Get create journal entry model* endpoint returns the expected data for the request payload when creating a [journal entry](https://docs.codat.io/accounting-api#/schemas/JournalEntry) for a given company and integration. * * [Journal entries](https://docs.codat.io/accounting-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved. * * **Integration-specific behaviour** * * See the *response examples* for integration-specific indicative models. * * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journalEntries) for integrations that support creating a journal entry. * */ getCreateModel(req: operations.GetCreateJournalEntriesModelRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * List journal entries * * @remarks * The *List journal entries* endpoint returns a list of [journal entries](https://docs.codat.io/accounting-api#/schemas/JournalEntry) for a given company's connection. * * [Journal entries](https://docs.codat.io/accounting-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved. * * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/codat-api#/operations/refresh-company-data). * */ list(req: operations.ListJournalEntriesRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; }