import * as utils from "../internal/utils"; import * as operations from "../sdk/models/operations"; import { SDKConfiguration } from "./sdk"; import { AxiosRequestConfig } from "axios"; /** * Bills */ export declare enum DownloadAttachmentAcceptEnum { applicationJson = "application/json", applicationOctetStream = "application/octet-stream" } export declare class Bills { private sdkConfiguration; constructor(sdkConfig: SDKConfiguration); /** * Create bill * * @remarks * The *Create bill* endpoint creates a new [bill](https://docs.codat.io/accounting-api#/schemas/Bill) for a given company's connection. * * [Bills](https://docs.codat.io/accounting-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. * * **Integration-specific behaviour** * * Required data may vary by integration. To see what data to post, first call [Get create/update bill model](https://docs.codat.io/accounting-api#/operations/get-create-update-bills-model). * * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support creating an account. * */ create(req: operations.CreateBillRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * Delete bill * * @remarks * The *Delete bill* endpoint allows you to delete a specified bill from an accounting platform. * * [Bills](https://docs.codat.io/accounting-api#/schemas/Bill) are itemized records of goods received or services provided to the SMB. * * ### Process * 1. Pass the `{billId}` to the *Delete bill* endpoint and store the `pushOperationKey` returned. * 2. Check the status of the delete operation by checking the status of the 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 bill object was deleted from the accounting platform. * 3. (Optional) Check that the bill was deleted from the accounting platform. * * ### Effect on related objects * * Be aware that deleting a bill from an accounting platform might cause related objects to be modified. For example, if you delete a paid bill in QuickBooks Online, the bill is deleted but the bill payment against that bill is not. The bill 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 Delete | Details | * |-------------|-------------|--------------------------------------------------------------------------------------------------------------| * | QuickBooks Online | No | - | * | Oracle NetSuite | No | When deleting a bill that's already linked to a bill payment, you must delete the linked bill payment first. | | * | Sage Intacct | No | When deleting a bill that's already linked to a bill payment, you must delete the linked bill payment first. | * * > **Supported Integrations** * > * > This functionality is currently supported for our QuickBooks Online, Xero, Oracle NetSuite and Sage Intacct integrations. */ delete(req: operations.DeleteBillRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * Download bill attachment * * @remarks * The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`. * * [Bills](https://docs.codat.io/accounting-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. * * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support downloading a bill attachment. * */ downloadAttachment(req: operations.DownloadBillAttachmentRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig, acceptHeaderOverride?: DownloadAttachmentAcceptEnum): Promise; /** * Get bill * * @remarks * The *Get bill* endpoint returns a single bill for a given billId. * * [Bills](https://docs.codat.io/accounting-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. * * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support getting a specific bill. * * 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.GetBillRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * Get bill attachment * * @remarks * The *Get bill attachment* endpoint returns a specific attachment for a given `billId` and `attachmentId`. * * [Bills](https://docs.codat.io/accounting-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. * * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support getting a bill attachment. * */ getAttachment(req: operations.GetBillAttachmentRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * Get create/update bill model * * @remarks * The *Get create/update bill model* endpoint returns the expected data for the request payload when creating and updating a [bill](https://docs.codat.io/accounting-api#/schemas/Bill) for a given company and integration. * * [Bills](https://docs.codat.io/accounting-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. * * **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=bills) for integrations that support creating and updating a bill. * */ getCreateUpdateModel(req: operations.GetCreateUpdateBillsModelRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * List bills * * @remarks * The *List bills* endpoint returns a list of [bills](https://docs.codat.io/accounting-api#/schemas/Bill) for a given company's connection. * * [Bills](https://docs.codat.io/accounting-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. * * 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.ListBillsRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * List bill attachments * * @remarks * The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`. * * [Bills](https://docs.codat.io/accounting-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. * * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support listing bill attachments. * */ listAttachments(req: operations.ListBillAttachmentsRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * Update bill * * @remarks * The *Update bill* endpoint updates an existing [bill](https://docs.codat.io/accounting-api#/schemas/Bill) for a given company's connection. * * [Bills](https://docs.codat.io/accounting-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. * * **Integration-specific behaviour** * * Required data may vary by integration. To see what data to post, first call [Get create/update bill model](https://docs.codat.io/accounting-api#/operations/get-create-update-bills-model). * * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support creating an account. * */ update(req: operations.UpdateBillRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; /** * Upload bill attachment * * @remarks * The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`. * * [Bills](https://docs.codat.io/accounting-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. * * **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=bills) for integrations that support uploading a bill attachment. * */ uploadAttachment(req: operations.UploadBillAttachmentRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise; }