import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient"; import * as core from "../../../../core"; import type * as Square from "../../../index"; export declare namespace InvoicesClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } export declare class InvoicesClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options?: InvoicesClient.Options); /** * Returns a list of invoices for a given location. The response * is paginated. If truncated, the response includes a `cursor` that you * use in a subsequent request to retrieve the next set of invoices. * * @param {Square.ListInvoicesRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.invoices.list({ * locationId: "location_id", * cursor: "cursor", * limit: 1 * }) */ list(request: Square.ListInvoicesRequest, requestOptions?: InvoicesClient.RequestOptions): Promise>; /** * Creates a draft [invoice](entity:Invoice) * for an order created using the Orders API. * * A draft invoice remains in your account and no action is taken. * You must publish the invoice before Square can process it (send it to the customer's email address or charge the customer’s card on file). * * @param {Square.CreateInvoiceRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.invoices.create({ * invoice: { * locationId: "ES0RJRZYEC39A", * orderId: "CAISENgvlJ6jLWAzERDzjyHVybY", * primaryRecipient: { * customerId: "JDKYHBWT1D4F8MFH63DBMEN8Y4" * }, * paymentRequests: [{ * requestType: "BALANCE", * dueDate: "2030-01-24", * tippingEnabled: true, * automaticPaymentSource: "NONE", * reminders: [{ * relativeScheduledDays: -1, * message: "Your invoice is due tomorrow" * }] * }], * deliveryMethod: "EMAIL", * invoiceNumber: "inv-100", * title: "Event Planning Services", * description: "We appreciate your business!", * scheduledAt: "2030-01-13T10:00:00Z", * acceptedPaymentMethods: { * card: true, * squareGiftCard: false, * bankAccount: false, * buyNowPayLater: false, * cashAppPay: false * }, * customFields: [{ * label: "Event Reference Number", * value: "Ref. #1234", * placement: "ABOVE_LINE_ITEMS" * }, { * label: "Terms of Service", * value: "The terms of service are...", * placement: "BELOW_LINE_ITEMS" * }], * saleOrServiceDate: "2030-01-24", * storePaymentMethodEnabled: false * }, * idempotencyKey: "ce3748f9-5fc1-4762-aa12-aae5e843f1f4" * }) */ create(request: Square.CreateInvoiceRequest, requestOptions?: InvoicesClient.RequestOptions): core.HttpResponsePromise; private __create; /** * Searches for invoices from a location specified in * the filter. You can optionally specify customers in the filter for whom to * retrieve invoices. In the current implementation, you can only specify one location and * optionally one customer. * * The response is paginated. If truncated, the response includes a `cursor` * that you use in a subsequent request to retrieve the next set of invoices. * * @param {Square.SearchInvoicesRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.invoices.search({ * query: { * filter: { * locationIds: ["ES0RJRZYEC39A"], * customerIds: ["JDKYHBWT1D4F8MFH63DBMEN8Y4"] * }, * sort: { * field: "INVOICE_SORT_DATE", * order: "DESC" * } * }, * limit: 100 * }) */ search(request: Square.SearchInvoicesRequest, requestOptions?: InvoicesClient.RequestOptions): core.HttpResponsePromise; private __search; /** * Retrieves an invoice by invoice ID. * * @param {Square.GetInvoicesRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.invoices.get({ * invoiceId: "invoice_id" * }) */ get(request: Square.GetInvoicesRequest, requestOptions?: InvoicesClient.RequestOptions): core.HttpResponsePromise; private __get; /** * Updates an invoice. This endpoint supports sparse updates, so you only need * to specify the fields you want to change along with the required `version` field. * Some restrictions apply to updating invoices. For example, you cannot change the * `order_id` or `location_id` field. * * @param {Square.UpdateInvoiceRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.invoices.update({ * invoiceId: "invoice_id", * invoice: { * version: 1, * paymentRequests: [{ * uid: "2da7964f-f3d2-4f43-81e8-5aa220bf3355", * tippingEnabled: false * }] * }, * idempotencyKey: "4ee82288-0910-499e-ab4c-5d0071dad1be" * }) */ update(request: Square.UpdateInvoiceRequest, requestOptions?: InvoicesClient.RequestOptions): core.HttpResponsePromise; private __update; /** * Deletes the specified invoice. When an invoice is deleted, the * associated order status changes to CANCELED. You can only delete a draft * invoice (you cannot delete a published invoice, including one that is scheduled for processing). * * @param {Square.DeleteInvoicesRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.invoices.delete({ * invoiceId: "invoice_id", * version: 1 * }) */ delete(request: Square.DeleteInvoicesRequest, requestOptions?: InvoicesClient.RequestOptions): core.HttpResponsePromise; private __delete; /** * Uploads a file and attaches it to an invoice. This endpoint accepts HTTP multipart/form-data file uploads * with a JSON `request` part and a `file` part. The `file` part must be a `readable stream` that contains a file * in a supported format: GIF, JPEG, PNG, TIFF, BMP, or PDF. * * Invoices can have up to 10 attachments with a total file size of 25 MB. Attachments can be added only to invoices * in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. * * __NOTE:__ When testing in the Sandbox environment, the total file size is limited to 1 KB. * * @param {Square.CreateInvoiceAttachmentRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * import { createReadStream } from "fs"; * await client.invoices.createInvoiceAttachment({ * invoiceId: "invoice_id" * }) */ createInvoiceAttachment(request: Square.CreateInvoiceAttachmentRequest, requestOptions?: InvoicesClient.RequestOptions): core.HttpResponsePromise; private __createInvoiceAttachment; /** * Removes an attachment from an invoice and permanently deletes the file. Attachments can be removed only * from invoices in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. * * @param {Square.DeleteInvoiceAttachmentRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.invoices.deleteInvoiceAttachment({ * invoiceId: "invoice_id", * attachmentId: "attachment_id" * }) */ deleteInvoiceAttachment(request: Square.DeleteInvoiceAttachmentRequest, requestOptions?: InvoicesClient.RequestOptions): core.HttpResponsePromise; private __deleteInvoiceAttachment; /** * Cancels an invoice. The seller cannot collect payments for * the canceled invoice. * * You cannot cancel an invoice in the `DRAFT` state or in a terminal state: `PAID`, `REFUNDED`, `CANCELED`, or `FAILED`. * * @param {Square.CancelInvoiceRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.invoices.cancel({ * invoiceId: "invoice_id", * version: 0 * }) */ cancel(request: Square.CancelInvoiceRequest, requestOptions?: InvoicesClient.RequestOptions): core.HttpResponsePromise; private __cancel; /** * Publishes the specified draft invoice. * * After an invoice is published, Square * follows up based on the invoice configuration. For example, Square * sends the invoice to the customer's email address, charges the customer's card on file, or does * nothing. Square also makes the invoice available on a Square-hosted invoice page. * * The invoice `status` also changes from `DRAFT` to a status * based on the invoice configuration. For example, the status changes to `UNPAID` if * Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion of the * invoice amount. * * In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` permissions, `CUSTOMERS_READ` * and `PAYMENTS_WRITE` are required when publishing invoices configured for card-on-file payments. * * @param {Square.PublishInvoiceRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.invoices.publish({ * invoiceId: "invoice_id", * version: 1, * idempotencyKey: "32da42d0-1997-41b0-826b-f09464fc2c2e" * }) */ publish(request: Square.PublishInvoiceRequest, requestOptions?: InvoicesClient.RequestOptions): core.HttpResponsePromise; private __publish; }