import { Methods } from "./methods.js"; import { Sale } from "./types/gumroad.js"; //#region src/sales.d.ts /** Bindings for Array of {@link Sale} */ interface SalesProps { /** The key for next page of sales if available */ readonly next_page_key: string | undefined; /** The API endpoint for next page of sales if available */ readonly next_page_url: string | undefined; /** * Retrieves the next successful sales * * @returns On success, an Array of {@link Sale} | `null` if next page does not exists */ next(requestOptions?: { signal?: AbortSignal; }): Promise<((Sale & SaleProps)[] & SalesProps) | null>; } /** Bindings for {@link Sale} */ interface SaleProps { /** * Marks the sale as shipped * * @returns On success, a {@link Sale} */ markAsShipped(options: { tracking_url?: string | undefined; }, requestOptions?: { signal?: AbortSignal; }): Promise; /** * Refunds the sale * * @returns On success, a {@link Sale} */ refund(options: { amount_cents?: number | undefined; }, requestOptions?: { signal?: AbortSignal; }): Promise; } /** A class having API methods related to Sales */ declare class SalesMethods extends Methods { protected _bindSales(object: { next_page_url?: string; next_page_key?: string; sales: Sale[]; }): (Sale & SaleProps)[] & SalesProps; protected _bindSale(sale: Sale): Sale & SaleProps; /** * Retrieves all of the successful sales by the authenticated user. * * @param options (Optional) Options * * @returns On success, an Array of {@link Sales} * * @see https://app.gumroad.com/api#get-/sales * * **Only available with the `view_sales` scope** */ list(options?: { /** Date in form `YYYY-MM-DD` - Only return sales after this date */ after?: string; /** Date in form `YYYY-MM-DD` - Only return sales before this date */ before?: string; /** Filter sales by this product */ product_id?: string; /** Filter sales by this email */ email?: string; /** Filter sales by this Order ID */ order_id?: string; /** Filter sales by customer name */ name?: string; /** Filter sales by license key */ license_key?: string; /** A key representing a page of results. It is given in the response as `next_page_key`. */ page_key?: string; }, { signal }?: { signal?: AbortSignal; }): Promise<(Sale & SaleProps)[] & SalesProps>; /** * Retrieves the details of a sale by this user * * @param sale_id The id of the sale * * @returns On success, a {@link Sale} * * @see https://app.gumroad.com/api#get-/sales/:id * * **Only available with the `view_sales` scope** */ get(sale_id: string, { signal }?: { signal?: AbortSignal; }): Promise; /** * Marks a sale as shipped. * * @param sale_id The id of the sale * * @returns On success, a {@link Sale} * * @see https://app.gumroad.com/api#put-/sales/:id/mark_as_shipped * * **Only available with the `mark_sales_as_shipped` scope** */ markAsShipped(sale_id: string, options?: { /** The tracking url */ tracking_url?: string; }, { signal }?: { signal?: AbortSignal; }): Promise; /** * Refunds a sale. * * @param sale_id The id of the sale * * @returns On success, a {@link Sale} * * @see https://app.gumroad.com/api#put-/sales/:id/refund * * **Only available with the `refund_sales` scope** */ refund(sale_id: string, options?: { /** * Amount in cents (in currency of the sale) to be refunded. * If set, issue partial refund by this amount. * If not set, issue full refund. * You can issue multiple partial refunds per sale until it is fully refunded. */ amount_cents?: number; }, { signal }?: { signal?: AbortSignal; }): Promise; } //#endregion export { SaleProps, SalesMethods, SalesProps }; //# sourceMappingURL=sales.d.ts.map