import * as utils from "../internal/utils"; import * as operations from "../sdk/models/operations"; import { SDKConfiguration } from "./sdk"; import { AxiosRequestConfig } from "axios"; /** * Invoices */ export declare enum DownloadAttachmentAcceptEnum { applicationJson = "application/json", applicationOctetStream = "application/octet-stream" } export declare enum DownloadPdfAcceptEnum { applicationJson = "application/json", applicationPdf = "application/pdf" } export declare class Invoices { private sdkConfiguration; constructor(sdkConfig: SDKConfiguration); /** * Create invoice * * @remarks * The *Create invoice* endpoint creates a new [invoice](https://docs.codat.io/accounting-api#/schemas/Invoice) for a given company's connection. * * [Invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. * * **Integration-specific behaviour** * * Required data may vary by integration. To see what data to post, first call [Get create/update invoice model](https://docs.codat.io/accounting-api#/operations/get-create-update-invoices-model). * * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support creating an account. * */ create(req: operations.CreateInvoiceRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * Delete invoice * * @remarks * The *Delete invoice* endpoint allows you to delete a specified invoice from an accounting platform. * * [Invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. * * ### Process * 1. Pass the `{invoiceId}` to the *Delete invoice* endpoint and store the `pushOperationKey` returned. * 2. Check the status of the delete operation 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 invoice object was deleted from the accounting platform. * 3. (Optional) Check that the invoice was deleted from the accounting platform. * * ### Effect on related objects * * Be aware that deleting an invoice from an accounting platform might cause related objects to be modified. For example, if you delete a paid invoice from 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. * > We're increasing support for object deletion across various accounting platforms and data types. You can check our [Accounting API Public Product Roadmap](https://portal.productboard.com/codat/7-public-product-roadmap/tabs/46-accounting-api) for the latest status. */ delete(req: operations.DeleteInvoiceRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * Download invoice attachment * * @remarks * The *Download invoice attachment* endpoint downloads a specific attachment for a given `invoiceId` and `attachmentId`. * * [Invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. * * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support downloading an invoice attachment. * */ downloadAttachment(req: operations.DownloadInvoiceAttachmentRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig, acceptHeaderOverride?: DownloadAttachmentAcceptEnum): Promise; /** * Get invoice as PDF * * @remarks * Download invoice as a pdf. */ downloadPdf(req: operations.DownloadInvoicePdfRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig, acceptHeaderOverride?: DownloadPdfAcceptEnum): Promise; /** * Get invoice * * @remarks * The *Get invoice* endpoint returns a single invoice for a given invoiceId. * * [Invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. * * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support getting a specific invoice. * * 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.GetInvoiceRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * Get invoice attachment * * @remarks * The *Get invoice attachment* endpoint returns a specific attachment for a given `invoiceId` and `attachmentId`. * * [Invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. * * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support getting an invoice attachment. * */ getAttachment(req: operations.GetInvoiceAttachmentRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * Get create/update invoice model * * @remarks * The *Get create/update invoice model* endpoint returns the expected data for the request payload when creating and updating an [invoice](https://docs.codat.io/accounting-api#/schemas/Invoice) for a given company and integration. * * [Invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. * * **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=invoices) for integrations that support creating and updating an invoice. * */ getCreateUpdateModel(req: operations.GetCreateUpdateInvoicesModelRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * List invoices * * @remarks * The *List invoices* endpoint returns a list of [invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) for a given company's connection. * * [Invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. * * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/codat-api#/operations/refresh-company-data). * * ### Useful queries * * - Outstanding invoices - `query = amountDue > 0` * - Invoices due after a certain date: `query = dueDate > 2021-01-28` * * [Read more about querying](https://docs.codat.io/using-the-api/querying). */ list(req: operations.ListInvoicesRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * List invoice attachments * * @remarks * The *List invoice attachments* endpoint returns a list of attachments available to download for given `invoiceId`. * * [Invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. * * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support listing invoice attachments. * */ listAttachments(req: operations.ListInvoiceAttachmentsRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * Update invoice * * @remarks * The *Update invoice* endpoint updates an existing [invoice](https://docs.codat.io/accounting-api#/schemas/Invoice) for a given company's connection. * * [Invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. * * **Integration-specific behaviour** * * Required data may vary by integration. To see what data to post, first call [Get create/update invoice model](https://docs.codat.io/accounting-api#/operations/get-create-update-invoices-model). * * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support creating an account. * */ update(req: operations.UpdateInvoiceRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * Upload invoice attachment * * @remarks * The *Upload invoice attachment* endpoint uploads an attachment and assigns it against a specific `invoiceId`. * * [Invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. * * **Integration-specific behaviour** * * For more details on supported file types by integration see [Attachments](https://docs.codat.io/accounting-api#/schemas/Attachment). * * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support uploading an invoice attachment. * */ uploadAttachment(req: operations.UploadInvoiceAttachmentRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; }