import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; import * as core from "../../../../core/index.js"; import * as Whop from "../../../index.js"; export declare namespace InvoicesClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } /** * An Invoice is a receipt with an invoice number. Create a draft from variant-backed items, set its recipient and due date, and edit it until it is sent. Its `pay_` ID is also the payment ID when collected. * * Draft creation does not create access or charge the buyer. The recipient's contact details live on the account's member. Financial fields and caller metadata can only be edited in draft. */ export declare class InvoicesClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options?: InvoicesClient.Options); /** * Lists receipt-backed invoices for accounts the caller can read. Legacy invoices are excluded. * * @param {Whop.ListInvoicesRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.invoices.list() */ list(request?: Whop.ListInvoicesRequest, requestOptions?: InvoicesClient.RequestOptions): Promise>; /** * Creates a draft invoice backed by a receipt, with saved items, quantities, prices, and recipients. Issue the draft to resolve final tax and open the invoice. The pay_ ID stays the same when paid. * * @param {Whop.CreateInvoicesRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.invoices.create({ * account_id: "biz_xxxxxxxxxxxxxx", * items: [] * }) */ create(request: Whop.CreateInvoicesRequest, requestOptions?: InvoicesClient.RequestOptions): core.HttpResponsePromise; private __create; /** * Retrieves a receipt-backed invoice by its pay_ ID. * * @param {Whop.RetrieveInvoicesRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.invoices.retrieve({ * id: "id" * }) */ retrieve(request: Whop.RetrieveInvoicesRequest, requestOptions?: InvoicesClient.RequestOptions): core.HttpResponsePromise; private __retrieve; /** * Updates draft invoice items and billing fields. Recipient-only updates are also allowed on unpaid invoices. Edit customer contact details through the member API. * * @param {Whop.UpdateInvoicesRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.invoices.update({ * id: "id" * }) */ update(request: Whop.UpdateInvoicesRequest, requestOptions?: InvoicesClient.RequestOptions): core.HttpResponsePromise; private __update; /** * Generates the invoice as a PDF and returns a short-lived link to download it. A draft shows its estimated totals. The buyer's name and email need `member:basic:read` and `member:email:read`, and the Pay now link on an open invoice needs `payment:charge`. Each call generates a new file and link, so this endpoint does not replay `Idempotency-Key` responses. * * @param {Whop.GeneratePdfInvoicesRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.invoices.generatePdf({ * id: "id" * }) */ generatePdf(request: Whop.GeneratePdfInvoicesRequest, requestOptions?: InvoicesClient.RequestOptions): core.HttpResponsePromise; private __generatePdf; /** * Resolves final tax and opens a draft invoice without emailing it. An invoice with a `payment_method_id` is charged to it off-session, as `POST /payments` charges a saved payment method: at `charge_at` if given, otherwise on `due_at` while it is still ahead, otherwise right away (see `scheduled_charge_at`). With a future `due_at` and no `charge_at`, the customer is charged on the due date without being emailed first. Issuing an open invoice again retains its totals and charges nothing. * * @param {Whop.IssueInvoicesRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.invoices.issue({ * id: "id" * }) */ issue(request: Whop.IssueInvoicesRequest, requestOptions?: InvoicesClient.RequestOptions): core.HttpResponsePromise; private __issue; /** * Marks an open invoice as uncollectible. Its checkout link stops working. * * @param {Whop.MarkUncollectibleInvoicesRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.invoices.markUncollectible({ * id: "id" * }) */ markUncollectible(request: Whop.MarkUncollectibleInvoicesRequest, requestOptions?: InvoicesClient.RequestOptions): core.HttpResponsePromise; private __markUncollectible; /** * Issues a draft and emails it to its recipients, with reminders after the due date. A draft with a `payment_method_id` needs `payment:charge`: with a `charge_at`, or when its `due_at` is still ahead, it is emailed now and charged to that method at that time (see `scheduled_charge_at`); otherwise it is charged right away instead of emailed. Voiding the invoice, marking it uncollectible, or paying it first cancels the scheduled charge, and its recipients get the payment link if a charge fails. Sending an open invoice emails it again, up to three emails a day including the first send. With `send_at`, the draft is sent at that time instead, and cannot be edited, except its recipients, until it is sent or unscheduled. Each email, reminders included, is sent separately to the customer email shown on the invoice and to each address in `recipient_emails`, so recipients never see each other's addresses. * * @param {Whop.SendInvoicesRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.invoices.send({ * id: "id" * }) */ send(request: Whop.SendInvoicesRequest, requestOptions?: InvoicesClient.RequestOptions): core.HttpResponsePromise; private __send; /** * Cancels a draft's scheduled send, so it can be edited again. An invoice with no scheduled send is returned unchanged. * * @param {Whop.UnscheduleInvoicesRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.invoices.unschedule({ * id: "id" * }) */ unschedule(request: Whop.UnscheduleInvoicesRequest, requestOptions?: InvoicesClient.RequestOptions): core.HttpResponsePromise; private __unschedule; /** * Voids a draft or unpaid invoice. * * @param {Whop.VoidInvoicesRequest} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.invoices.void({ * id: "id" * }) */ void(request: Whop.VoidInvoicesRequest, requestOptions?: InvoicesClient.RequestOptions): core.HttpResponsePromise; private __void; }